Skip to content

nexscope-ai/nexscope-ecommerce-skills / ecommerce-patent-description-data-translation

ecommerce.patent-description-data-translation

Verified

Retrieve translated patent description (specification) text from Nexscope. Triggered when users request patent specification translation, patent full text in other languages, translated patent full text, or want to view patent specifications in Chinese, English, or Japanese, patent specification translation, patent description translation, Nexscope, or patent translation. Also triggered when users provide a patent ID or publication number and request specification/description content in another language, or mention "patent specification translation," "description translation," "translated full text," or similar intent.

FileKindSize
SKILL.mdskill md8.0 KB
manifest.jsonconfig333 B
references/api.mdmarkdown5.5 KB
scripts/patent_description_data_translation.pyscript1.7 KB

scripts/patent_description_data_translation.py

View on GitHub
#!/usr/bin/env python3
"""Standard-library proxy client for /zhihuiya/descriptionDataTranslated."""
import json
import os
import sys
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen

API_PATH = '/zhihuiya/descriptionDataTranslated'

def call_api(params):
    base = os.environ.get("NEXSCOPE_PROXY_BASE", "").strip()
    key = os.environ.get("NEXSCOPE_API_KEY", "").strip()
    if not base or not key:
        raise SystemExit("NEXSCOPE_PROXY_BASE and NEXSCOPE_API_KEY are required")
    body = json.dumps(params, ensure_ascii=False).encode("utf-8")
    request = Request(base.rstrip("/") + API_PATH, data=body, method="POST", headers={
        "Authorization": "Bearer " + key,
        "Content-Type": "application/json",
        "Accept": "application/json",
    })
    try:
        with urlopen(request, timeout=120) as response:
            return json.loads(response.read().decode("utf-8"))
    except HTTPError as error:
        raw = error.read().decode("utf-8", errors="replace") if error.fp else ""
        try:
            return json.loads(raw)
        except ValueError:
            return {"error": "HTTP {}: {}".format(error.code, error.reason), "details": raw}
    except URLError as error:
        return {"error": "Connection failed: {}".format(error.reason)}

def main():
    if len(sys.argv) != 2:
        raise SystemExit("Usage: {} '<JSON object>'".format(sys.argv[0]))
    try:
        params = json.loads(sys.argv[1])
    except json.JSONDecodeError as error:
        raise SystemExit("Invalid JSON parameters: {}".format(error))
    if not isinstance(params, dict):
        raise SystemExit("Parameters must be a JSON object")
    print(json.dumps(call_api(params), ensure_ascii=False))

if __name__ == "__main__":
    main()
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall