Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.minerva.io/llms.txt

Use this file to discover all available pages before exploring further.

resp = mc.api.enrich(records)

resp.to_dicts()        # list[dict]
resp.to_df()           # pandas DataFrame   (needs [pandas])
resp.to_csv("out.csv") # write a CSV
resp.to_table()        # pretty terminal table   (needs [table])
Nested fields are flattened where it makes sense — personal_information.full_name becomes a top-level full_name column in the DataFrame, etc.

Map results to your own schema

Project any result onto your pydantic model — missing fields become None (with a one-time warning), so it never breaks:
from pydantic import BaseModel

class Lead(BaseModel):
    record_id: str
    full_name: str | None = None
    estimated_income_range: str | None = None
    crm_id: str | None = None          # not a Minerva field → stays None, warns once

leads = mc.api.enrich(records).map_to(Lead)      # -> list[Lead]
Pass strict=True to validate instead — raises on mismatch:
leads = mc.api.enrich(records).map_to(Lead, strict=True)
# raises pydantic.ValidationError if any record can't fit the Lead shape

Which extras you need

MethodExtraWhy
to_dicts()Pure stdlib
to_df()[pandas]DataFrame construction
to_csv(path)Pure stdlib (uses csv module)
to_table()[table]Pretty box-drawing via tabulate
map_to(Model)Pydantic is already a core dep

Which responses support them

The list-shaped responses (EnrichResponse, ResolveResponse, UsageResponse) implement the TabularMixin — they have to_dicts / to_df / to_csv / to_table / map_to. The dict-returning methods (get_li_contact_info, validate_emails, infer_record_country, mc.api.call) return raw dict — convert to your preferred format yourself if needed:
import pandas as pd

result = mc.api.validate_emails(["test@example.com"])
df = pd.DataFrame(result["results"])