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. Codes and BIOCT1_ tokens from the portal work without a browser.
  • 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.
  • 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.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 biocognia 0.1.0
File Size Uploaded
biocognia-0.1.0.tar.gz 58.8 kB Details

Built distribution (wheel)

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

Total release size: 117.5 kB

Release files / biocognia-0.1.0.tar.gz

Download URL biocognia-0.1.0.tar.gz
Size 58.8 kB
Tags Source
SHA-256 checksum
How to use checksums
42a2c9e9bf39db033f27c1831118967376ef09f2dd24d72e1bbca73dc0c556c6
BLAKE2b-256 checksum
How to use checksums
e340f03bd2be19b79f4505350c35b1974aeec1a7c14a900399adae528ccd884c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

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

Download URL biocognia-0.1.0-py3-none-any.whl
Size 58.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85fc3a5ce56a3ef09ec0126e1a13e1cc8718818e9661c350df9e6550c1f2c33f
BLAKE2b-256 checksum
How to use checksums
16ff1f426046c97a469cfacf94a97cb23a49cd72f659fde4e6dd97d38e53c02d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.14

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

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