Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Repository files navigation

Vital Python Library

pypifern shield

Important

This repository has been archived and will not receive further updates.

The maintained SDK lives at junction-api/junction-python
and is published to PyPI as junction-api-sdk.

See the migration guide for upgrade instructions.

Documentation

API reference documentation is available here.

Installation

Add this dependency to your project's build file:

pip install vital
# or
poetry add vital

Usage

fromvital.clientimportVitalvital_client=Vital(
api_key="YOUR_API_KEY",
)
lab_test=vital_client.lab_tests.get('order-id')
print(lab_test)

Please note: To ensure future compatibility, we ask that you avoid exhaustive matching on enum values such as an order’s status. We may introduce new statuses (and other enum values) over time, and code that assumes all current values are exhaustive could break or fail to compile with SDK upgrades.

To stay compatible and benefit from future enhancements, treat unknown values gracefully—for example, by using default cases or limiting checks to only the values your integration depends on.

Async Client

The SDK also exports an async client.

fromvital.clientimportAsyncVitalimportasynciovital_client=AsyncVital(
api_key="YOUR_API_KEY",
)
asyncdefget_lab_test() ->None:
lab_test=vital_client.lab_tests.get('order-id')
print(lab_test)
asyncio.run(get_lab_test())

Handling Errors

All exceptions thrown by the SDK will sublcass ApiError.

fromvital.coreimportApiErrorfromvitalimportBadRequestErrortry:
vital_client.lab_tests.get('order-id')
exceptBadRequestErrorase:
# handle bad request errorexceptAPIErrorase:
# handle any api related error

Environments

When you sign up to Vital you get access to two environments, Sandbox and Production.

Environment URLs
productionapi.tryvital.io
production-euapi.eu.tryvital.io
sandboxapi.sandbox.tryvital.io
sandbox-euapi.sandbox.eu.tryvital.io

By default, the SDK uses the production environment. See the snippet below for an example on how ot change the environment.

fromvital.clientimportVitalfromvital.environmentimportVitalEnvironmentvital_client=Vital(
api_key="YOUR_API_KEY",
environment=VitalEnvironment.Sandbox
)

Timeouts

By default, the client is configured to have a timeout of 60 seconds. You can customize this value at client instantiation.

fromvital.clientimportVitalfromvital.environmentimportVitalEnvironmentvital_client=Vital(
api_key="YOUR_API_KEY",
environment=VitalEnvironment.Sandbox,
timeout=15
)

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README are always very welcome!

About

Vital python

Resources

Stars

13 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages