Official Python SDK for the Minerva Data API — resolve, enrich, validate, usage.
Project description
Minerva SDK
The official Python SDK for the Minerva Data API — identity resolution, person enrichment, and validation, with one client, typed responses, and input validation baked in.
from minerva import Minerva
mc = Minerva() # reads MINERVA_API_KEY from the environment
mc.status.health() # quick liveness check (unauthenticated) -> HealthStatus(ok=True, ...)
results = mc.api.enrich([{"record_id": "1", "linkedin_url": "https://www.linkedin.com/in/example"}])
df = results.to_df() # straight to a DataFrame
Early access. Data API surface — resolve, enrich, LinkedIn lookup, email validation, country inference, and usage tallies — is wired and tested.
Installation
pip install minerva-sdk
Optional extras:
pip install "minerva-sdk[pandas]" # results.to_df()
pip install "minerva-sdk[table]" # results.to_table()
pip install "minerva-sdk[all]" # everything
Requires Python 3.11+ (tested through 3.14).
Authentication
Minerva is the single entry point. The only credential you need is your API key:
| Variable | Used for |
|---|---|
MINERVA_API_KEY |
every call the SDK makes |
mc = Minerva() # api_key from MINERVA_API_KEY
mc = Minerva(api_key="mk_live_...") # explicit
The SDK sends the API key as the x-api-key header on every request. The server-side authorizer
decides what your key is entitled to.
Quickstart
from minerva import Minerva
mc = Minerva(api_key="mk_live_...")
# Resolve — match records to a Minerva PID
mc.api.resolve([{"record_id": "1", "first_name": "Jane", "last_name": "Doe",
"emails": ["jane.doe@example.com"]}])
# Enrich — full profiles (up to 500 records per call)
resp = mc.api.enrich(
[{"record_id": "1", "linkedin_url": "https://www.linkedin.com/in/example"}],
match_condition_fields=["linkedin_url"], # only count it a match if a LinkedIn URL is on file
)
for r in resp.results:
print(r.record_id, r.is_match, r.minerva_pid, r.match_score)
# Tabular output
resp.to_df() # pandas DataFrame (needs [pandas])
resp.to_csv("out.csv") # write a CSV
resp.to_dicts() # list[dict]
Validate before you call — dry_run
Every input-bearing method takes dry_run=True. It validates your input locally and returns
the exact request that would be sent — without touching the network. Invalid input raises
MinervaValidationError immediately, with a precise field message.
from minerva import Minerva, MinervaValidationError
mc = Minerva()
req = mc.api.enrich(records, match_condition_fields=["linkedin_url"], dry_run=True)
# -> EnrichRequest (nothing sent). Inspect req.model_dump() to see the payload.
try:
mc.api.enrich([], dry_run=True) # 0 records — must be at least 1
except MinervaValidationError as e:
print("caught before any API call:", e)
Great for checking a batch is well-formed (record limits, allowed match_condition_fields,
record shape, …) before spending a call.
What you can do
| Namespace | Highlights |
|---|---|
mc.api |
resolve, enrich, get_li_contact_info, validate_emails, infer_record_country, call |
mc.usage |
tallies() — your per-endpoint API usage |
mc.status |
health() — unauthenticated liveness probe for the API |
Every response is a typed model with IDE autocomplete, and the list-shaped ones support
.to_df() / .to_csv() / .to_dicts() / .to_table().
Liveness — mc.status.health()
Unauthenticated probe of the Minerva API. Never raises — failure is surfaced as
ok=False with the cause, so it's safe to call in a polling loop.
mc = Minerva()
h = mc.status.health()
if not h.ok:
print("API is down:", h.error, "(status_code=", h.status_code, ")")
else:
print(f"API is up — {h.latency_ms:.0f} ms")
Returns a HealthStatus(ok, latency_ms, status_code, status, error). Works without an
API key (the probe is unauthenticated).
Custom / tailored endpoints — mc.api.call
For client-specific routes (preview endpoints, partner integrations, paths Minerva built just
for your org) on the Data API, use the generic mc.api.call:
result = mc.api.call("POST", "/v2/acme/lookup", json={"record_id": "abc"})
Same x-api-key auth, same error mapping, same rate-limit handling as the typed methods — the
difference is the SDK doesn't know the response schema, so you get back the raw parsed JSON.
The server enforces entitlement; callers without it see a 403 → MinervaAuthError.
Error handling
All errors derive from MinervaError:
from minerva import (
MinervaValidationError, # bad input — raised locally, before the call
MinervaAuthError, # 401/403 — bad key, not entitled
MinervaRateLimitError, # 429 — has .retry_after
MinervaAPIError, # other 4xx/5xx — has .status_code and .api_request_id
)
try:
mc.api.enrich(records)
except MinervaRateLimitError as e:
time.sleep(e.retry_after or 1)
except MinervaAPIError as e:
print("request failed:", e.api_request_id) # quote this to support
Responses are forward-compatible: new fields the API adds won't break an older client.
Python support
3.11, 3.12, 3.13, 3.14. Fully type-annotated (ships py.typed).
License
MIT © Minerva Data.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minerva_sdk-0.0.9.tar.gz.
File metadata
- Download URL: minerva_sdk-0.0.9.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e27f67a76d2c81691bc0fef40f57a9543cffb02e16b1eed287189911389cffd6
|
|
| MD5 |
94bc37eab9a5c524fd7db2cca23a51a1
|
|
| BLAKE2b-256 |
6772af2b86b8c3752ba9d0cf5f2b05f9daedbb3476bdb1efddd9c2cd9cc8502c
|
Provenance
The following attestation bundles were made for minerva_sdk-0.0.9.tar.gz:
Publisher:
sdk-publish-pypi-public.yml on minervadata-hq/md-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minerva_sdk-0.0.9.tar.gz -
Subject digest:
e27f67a76d2c81691bc0fef40f57a9543cffb02e16b1eed287189911389cffd6 - Sigstore transparency entry: 1705546402
- Sigstore integration time:
-
Permalink:
minervadata-hq/md-core@df19545545de93d7398fbc859999fa9e53647bc2 -
Branch / Tag:
refs/heads/prod - Owner: https://github.com/minervadata-hq
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-publish-pypi-public.yml@df19545545de93d7398fbc859999fa9e53647bc2 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file minerva_sdk-0.0.9-py3-none-any.whl.
File metadata
- Download URL: minerva_sdk-0.0.9-py3-none-any.whl
- Upload date:
- Size: 21.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d7464220ba74e4a6e8847199c8ef7fe8d9663705321be4dd889e007f227979f
|
|
| MD5 |
fb13744112ac788f31621e2dc6dd7f43
|
|
| BLAKE2b-256 |
427bd4114034dc334af6bc724d65e6fee10d51ee781ea1c719be961e78b28be3
|
Provenance
The following attestation bundles were made for minerva_sdk-0.0.9-py3-none-any.whl:
Publisher:
sdk-publish-pypi-public.yml on minervadata-hq/md-core
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
minerva_sdk-0.0.9-py3-none-any.whl -
Subject digest:
5d7464220ba74e4a6e8847199c8ef7fe8d9663705321be4dd889e007f227979f - Sigstore transparency entry: 1705546483
- Sigstore integration time:
-
Permalink:
minervadata-hq/md-core@df19545545de93d7398fbc859999fa9e53647bc2 -
Branch / Tag:
refs/heads/prod - Owner: https://github.com/minervadata-hq
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-publish-pypi-public.yml@df19545545de93d7398fbc859999fa9e53647bc2 -
Trigger Event:
workflow_dispatch
-
Statement type: