> ## 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.

# Output formats

> Every list-shaped result → dicts, DataFrame, CSV, or a pretty terminal table.

```python theme={null}
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])
```

Enrich results are already flat, so person fields such as `full_name` map
straight to columns. Nested objects are flattened where it makes sense — the
keys of `premium_fields` become top-level columns in the DataFrame, etc.

## Map results to your own schema

Build your own pydantic model from `to_dicts()` — results are flat, so field
names line up directly:

```python theme={null}
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

leads = [Lead(**row) for row in mc.api.enrich(records).to_dicts()]
```

## Which extras you need

| Method | Extra | Why |
| - | - | - |
| `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` |

## Which responses support them

The list-shaped responses (`EnrichResponse`, `ResolveResponse`, `UsageResponse`)
implement the `TabularMixin` — they have `to_dicts` / `to_df` / `to_csv` /
`to_table`.

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:

```python theme={null}
import pandas as pd

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.