Skip to main content

biocognia

The client every BioCognia product (SCIMAP Pro, Plexora, and the tools that join later) uses for its licence, its devices and its AI credits. A port of Plexora's licensing client, parameterised by product.

from biocognia import Guard, Licensing, Product

PRODUCT = Product.from_manifest("manifest.json", version=__version__)
LICENSING = Licensing(PRODUCT)
GUARD = Guard(LICENSING)

GUARD.check("streaming")      # raises EntitlementRequired, or returns
GUARD.limit("max_cells")      # an int, or None for unlimited
  • Certificates. BIOC1.<kid>.<canonical JSON>.<Ed25519>, signed only by the platform (bioc-core), verified offline here. aud names one product; entitlements and limits are that product's own. No personal data.
  • Devices. One random secret per machine (environment.json), shared by every product; the platform is told its hash and compares it on every certificate. Connecting a device from one product connects it for all.
  • Activation. <cli> license activate prints a short code; the person approves it at account.biocognia.com; the certificates arrive. Without a browser, the seat's licence key (BIOC-XXXX-XXXX-XXXX-XXXX, emailed with the seat, shown again on request under Licences in the portal, and reusable on each of the seat's devices), a one-time activation code or a BIOCT1_ token does the same.
  • Offline. Cached certificate to expiry, then grace, then the product's free tier. .bioc files for air-gapped machines; BIOCD1 job certificates for clusters without $HOME; BIOCOGNIA_OFFLINE=1 forbids every call.
  • https only. The platform, portal and gateway addresses, whether from BIOCOGNIA_SERVER, BIOCOGNIA_PORTAL, BIOCOGNIA_AI_GATEWAY or the platform's own reply, must be https unless the host is this machine; BIOCOGNIA_ALLOW_HTTP=1 allows plain http for a development server.
  • AI. gateway.TokenSource exchanges the certificate for a 30-minute BIOCAI1 token; gateway.GatewayClient is the transport and the account endpoints. The model call itself lives in the harness.

import biocognia is stdlib-only: no file, thread, socket or third-party import until something asks.

Layout

Module Does
product Product from the product's manifest; validate_manifest
certificate, delegation BIOC1 and BIOCD1 parse and verify
entitlements colon-path grants with ancestor match
environment, store the device secret, where files live, the environment variables
state Licensing: resolution, expiry, refresh, activation, lease
client api.biocognia.com/v1
guard Guard: check, allows, limit, refusal as data
gateway TokenSource, GatewayClient
cli the shared license verbs
codes the platform's error codes, pinned by both halves
testing Issuer, FakeService, opt-in pytest fixtures

Vectors

vectors/biocognia-vectors.json holds certificates signed with a public, test-only key. The platform's test suite re-signs every payload and compares bytes; this repository verifies every one. python tools/make_test_vectors.py --check fails when the file is stale.

Development

uv venv ~/.venvs/biocognia && VIRTUAL_ENV=~/.venvs/biocognia uv pip install -e . pytest
~/.venvs/biocognia/bin/python -m pytest

Keep the virtual environment outside any synced folder.

Metadata

Release files for biocognia 0.1.2

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

Source distribution (sdist)

Source distribution for biocognia 0.1.2
File Size Uploaded Provenance Actions
biocognia-0.1.2.tar.gz 64.3 kB Without provenance Details for biocognia-0.1.2.tar.gz

Built distribution (wheel)

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

Total release size: 125.7 kB

Release files / biocognia-0.1.2.tar.gz

Download URL biocognia-0.1.2.tar.gz
Size 64.3 kB
Tags Source
SHA-256 checksum
How to use checksums
464e28a59d0b6e43405d42bd24486ef85216913111d0702a8efd5d93c3ed9c82
BLAKE2b-256 checksum
How to use checksums
6040feacd82a598641431bf375208f890118b49749bfdb0179aa2200c229705f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / biocognia-0.1.2-py3-none-any.whl

Download URL biocognia-0.1.2-py3-none-any.whl
Size 61.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
82be3d89d6e129662420efc1e50e17e4f2c4d176b0bf2745ba517707cf7d6a84
BLAKE2b-256 checksum
How to use checksums
b8489f3d75e6d7527894953a8373bdc36af15ae47fe787b99014edd2ce59c9a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for biocognia 0.1.2

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.

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