Skip to main content

1scribe (Python)

pip install 1scribe

The PyPI package is 1scribe; the import name is onescribe, because a Python module name cannot start with a digit.

Python form of the 1Scribe SDK packages @1scribe/core, @1scribe/client and @1scribe/server. Same checks, same platform calls, same result reasons; held to the shared conformance vectors in packages/1scribe-conformance/vectors.json. Unpublished (publishing waits on TL-05).

Module TypeScript twin What it does
onescribe @1scribe/core verify_access_document, canonicalize (offline verification)
onescribe.client @1scribe/client OneScribeClient (code, activate, refresh, machine), LicenseSession, store
onescribe.server @1scribe/server verify_signature, receive_code_delivery, VendorApiClient

Runtime dependency: cryptography (core only). HTTP and HMAC use the standard library.

Product (installed app)

from onescribe.client import DeviceInfo, FileLicenseStore, LicenseSession, OneScribeClient, get_or_create_device_id

client = OneScribeClient(base_url="https://agentskope.com")
device = DeviceInfo(id=get_or_create_device_id(app_dir / "device-id"), reference_name="Front desk PC")
code = client.request_code(key=license_key, email=email, device=device)
result = client.activate(challenge_id=code.challenge_id, code=typed_code, device=device)

session = LicenseSession(base_url="https://agentskope.com", product_id=PRODUCT_ID, client=client,
                         store=FileLicenseStore(app_dir / "license.json"), device_id=device.id)
if result.ok:
    session.save(result.document, result.keys)
decision = session.check()  # offline; refreshes only when past its grace

Calls never raise for network problems: they return reason="unavailable".

Vendor backend

from onescribe.server import VendorApiClient, receive_code_delivery

delivery = receive_code_delivery(signature_header=request.headers.get("X-Scribe-Signature"),
                                 raw_body=request.get_data(), secret=CODE_DELIVERY_SECRET)
vendor = VendorApiClient(base_url="https://agentskope.com", api_key=os.environ["SCRIBE_API_KEY"])
access = vendor.vouched_access(product_id=PRODUCT_ID, subject_id=user.id)

Pass the raw request bytes to the signature check, never re-serialised JSON.

Base URL rule (both languages)

base_url is optional and defaults to https://agentskope.com (DEFAULT_PLATFORM_URL); the same platform is also reachable at https://1scribe.xyz (ALTERNATE_PLATFORM_URL). When given, it must be https:// for any host. Plain http:// is allowed only for the exact loopback hosts localhost, 127.0.0.1 and [::1] (local development). Anything else raises ValueError (TypeError in TypeScript) before a request is made: remote http, userinfo (user:pass@), look-alike hosts such as localhost.evil.com, backslashes, whitespace, query, fragment, bad ports and Unicode host names (pass the xn-- form). OneScribeClient, LicenseSession and VendorApiClient all apply it, and the default transport re-checks every URL. Otherwise anyone on the network could read the license key, code or vendor key, and replace the signed access document or the trusted keys.

Differences from the TypeScript packages

  • Synchronous API (standard-library urllib); inject any transport callable for async stacks or proxies.
  • The default transport never follows redirects, refuses non-HTTP schemes and plain http to a non-loopback host, caps responses at 2 MiB and times out after 15 s.
  • VendorApiClient.request raises ValueError for a path that does not start with a single / or an unknown method, so the API key cannot be sent to another host.
  • Signature header t must be decimal digits (1e9 or -5 are malformed_header).
  • Malformed success answers from the platform are unavailable instead of passed through.

Tests

python -m pytest packages/onescribe-py      # needs: pip install cryptography pytest

Metadata

Release files for 1scribe 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for 1scribe 2.1.0
File Size Uploaded Provenance Actions
1scribe-2.1.0.tar.gz 33.2 kB Without provenance Details for 1scribe-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for 1scribe 2.1.0
File Interpreter ABI Platform Actions
1scribe-2.1.0-py3-none-any.whl Python 3 none any Details for 1scribe-2.1.0-py3-none-any.whl

Total release size: 58.6 kB

Release files / 1scribe-2.1.0.tar.gz

Download URL 1scribe-2.1.0.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
4923c19815dd0470e1cbb48d460558f4c62370a78f3b88fbde816a156c8cb400
BLAKE2b-256 checksum
How to use checksums
4d11a0fdeed2c666f71bd0fc41ad84b5e4a43d8ba436a8df680b13a32a4eaab4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / 1scribe-2.1.0-py3-none-any.whl

Download URL 1scribe-2.1.0-py3-none-any.whl
Size 25.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7dac73eb5461f87dec95a098fc634dfb1541c1406dde47ca4a7bc145bfd8b56
BLAKE2b-256 checksum
How to use checksums
6baa964d265531aa6f63d74a24fbe13e5b7004bb789299f9427f71356d946b80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Security for 1scribe 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page