serva
Official Python client for the Serva encode/decode API.
Install
pip install serva
Usage
Generate an API key from serva.servamind.com, then:
from serva import Serva
client = Serva(api_key="sk_live_...") # or set SERVA_API_KEY
# Encode a file to the .serva format
result = client.encode("photo.raw", password="my-secret")
print(result.output_path, result.savings_percent)
# Decode it back
client.decode("photo.serva", password="my-secret", output="photo.raw")
Hugging Face
Push encoded .serva datasets to the Hugging Face Hub and pull them back. Set your Hugging Face token as HF_TOKEN, or pass hf_token=... to Serva. Nothing extra to install, the Hugging Face support ships with serva.
from serva import Serva
client = Serva(api_key="sk_live_...") # HF_TOKEN read from the environment
# Encode, then push to a dataset repo
result = client.encode("photo.raw", password="my-secret")
client.hub.push(result, repo_id="your-name/my-dataset")
# Pull it back and decode
path = client.hub.pull("your-name/my-dataset", "photo.serva")
client.decode(path, password="my-secret", output="photo.raw")
Pushing the encode result writes a dataset card with the size and savings. A plain file path works too, and the card simply leaves the savings out.
Configuration
| Setting | How | Default |
|---|---|---|
| API key | Serva(api_key=...) or SERVA_API_KEY |
— (required) |
Errors
All failures raise a subclass of ServaError: AuthError (401),
PaymentRequiredError (403), FileTooLargeError (413), RateLimitError (429).
A Hugging Face Hub operation that fails raises HubError, for example a missing
token, a repo that does not exist, or no access.
Versioning
Semantic versioning. The current version is available as serva.__version__.
Metadata
Release files for serva 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| serva-0.2.0.tar.gz | 7.3 kB | Without provenance | Details for serva-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| serva-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for serva-0.2.0-py3-none-any.whl |
Total release size: 16.1 kB
Release files / serva-0.2.0.tar.gz
| Download URL | serva-0.2.0.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b06ebae7ce6bfd5af96c53cdfdd8a8479b251fe1b5a04aee405e17d20b2ae3c
|
|
BLAKE2b-256 checksum How to use checksums |
57e7246ee445d176216ca0d1e31c060855ae0a9f3a9e6af17c3c1fc5d25a0ecf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Release files / serva-0.2.0-py3-none-any.whl
| Download URL | serva-0.2.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02fa7f0d07c06b655740f7e8c09eb097fd2dd0315e264c6a9b46eb37f013b326
|
|
BLAKE2b-256 checksum How to use checksums |
d573b961450dc842eafa1d402ee5ec68fcbd66c684b89477fcdc2e2d5b909224
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.6
|
Security for serva 0.2.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.