Skip to main content

edutap.esc_router_api

Async Python client for the ESC Router, the registry behind the European Student Card. It is where a higher education institution registers its students and the cards it issues them, and where anybody scanning a card's QR code is sent to ask whether that card is still valid.

Complete coverage of the router's V2 API: persons, cards, card pictures, the public status endpoint, offline and server-side card number minting, and the bulk import dry run.

Install

pip install edutap.esc_router_api

Python 3.13 or newer.

Use

from edutap.esc_router_api import ESCRouterClient

async with ESCRouterClient.from_settings() as client:
    status = await client.get_card_status("25539be8-6423-103e-add8-988999978433")
    print(status.status)  # ACTIVE

Configuration comes from the environment, prefixed ESC_, or from a .env file:

ESC_API_KEY=your-key
# ESC_ENVIRONMENT=production   # omit and you talk to the sandbox

The default is the sandbox, not production. A deployment that forgets the variable writes to a test register rather than to a live one.

In a service that already keeps an httpx2.AsyncClient, hand it in and it will be borrowed rather than duplicated -- and not closed:

client = ESCRouterClient.from_settings(client=my_shared_httpx_client)

There is a module-level function per operation as well, for scripts and notebooks:

from edutap.esc_router_api.api import get_person

person = await get_person("urn:schac:personalUniqueCode:int:esi:lmu.de:12345")

Documentation

https://docs.edutap.eu/packages/edutap_esc_router_api/index.html

Start with the tutorial if the router is new to you, the operation table if it is not, and migrating to 0.1.0 if you are coming from an earlier release -- fullName moved, failures raise instead of returning None, and three picture operations that never worked now do.

Develop

make venv             # .venv with the package and its dev dependencies
make lint             # ruff check, ruff format --check, ty check
make test-local       # the unit suite -- no network, well under a second
make docs             # sphinx-build -W
make help             # everything else

The unit suite never opens a socket: it drives the real client over an httpx2.MockTransport. The tests that talk to a real router are held behind a marker -- see Run the integration tests.

Contributing

See CONTRIBUTING.md. Releases are described in RELEASING.md.

Licence

EUPL 1.2. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

edutap_esc_router_api-0.1.0.tar.gz (81.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

edutap_esc_router_api-0.1.0-py3-none-any.whl (28.8 kB view details)

Uploaded Python 3

File details

Details for the file edutap_esc_router_api-0.1.0.tar.gz.

File metadata

  • Download URL: edutap_esc_router_api-0.1.0.tar.gz
  • Upload date:
  • Size: 81.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for edutap_esc_router_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 188400d66cf4123a4c5db2c7110ce5a52a26a2069c7cfbcff839ccb7660f5cb5
MD5 9a290d170043f14e50293f7081018d21
BLAKE2b-256 a489dfcebb8ba057d366e87fdae482b2283704f1e646f542b3137fb00e018580

See more details on using hashes here.

Provenance

The following attestation bundles were made for edutap_esc_router_api-0.1.0.tar.gz:

Publisher: release.yaml on edutap-eu/edutap.esc_router_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file edutap_esc_router_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for edutap_esc_router_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 deee2202ca1d32a25c20d11456a240379a9be50f3a895e2161907c81b4d41ca5
MD5 cf2291c42d444f0ed7ad8a386282844a
BLAKE2b-256 726429eb5f442d16a8a5e32c0c509fe0a7376f9052bc9045a2bbaa43146aa434

See more details on using hashes here.

Provenance

The following attestation bundles were made for edutap_esc_router_api-0.1.0-py3-none-any.whl:

Publisher: release.yaml on edutap-eu/edutap.esc_router_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page