> ## Documentation Index
> Fetch the complete documentation index at: https://jmail.world/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Cliente de Python

> Cliente de Python de un solo archivo con caché ETag

![Jmail](https://mintcdn.com/jmail/F-FAi3RZzojcIyie/images/jmail-app.png?fit=max\&auto=format\&n=F-FAi3RZzojcIyie\&q=85\&s=3d45d0246f3c69c7024d9a467fcfad28)

El cliente de Python de Jmail es un único archivo sin requisitos de instalación previa. Usa dependencias en línea según [PEP 723](https://peps.python.org/pep-0723/), por lo que [`uv run`](https://docs.astral.sh/uv/) se encarga de todo automáticamente.

## Configuración

No necesitas instalar nada. Simplemente ejecútalo con `uv`:

```bash theme={null}
uv run clients/python/jmail.py emails --head 5
```

O bien úsalo como biblioteca en tus propios scripts:

```python theme={null}
from jmail import JmailClient

client = JmailClient()
df = client.emails()
```

## Uso de la librería

### Uso básico

```python theme={null}
from jmail import JmailClient

client = JmailClient()

# All emails with full body text
df = client.emails()

# Network-only (no body text, much smaller download)
df = client.emails(slim=True)

# Documentos con texto completo extraído (descarga archivos fragmentados)
docs = client.documents(include_text=True)

# Photos, people, and facial recognition data
photos = client.photos()
people = client.people()
faces = client.photo_faces()

# iMessage conversations and messages
convos = client.imessage_conversations()
messages = client.imessage_messages()

# Crowd-sourced star counts
stars = client.star_counts()

# Release batch metadata
batches = client.release_batches()
```

### Obtener URL sin procesar

Para usar con DuckDB, Polars u otras herramientas:

```python theme={null}
url = client.url("emails-slim")
# → "https://data.jmail.world/v1/emails-slim.parquet"

url = client.url("emails-slim", fmt="ndjson.gz")
# → "https://data.jmail.world/v1/emails-slim.ndjson.gz"
```

### Desactivar caché

```python theme={null}
# Siempre descargar datos nuevos (sin caché local)
client = JmailClient(cache=False)
```

## Referencia de la interfaz de línea de comandos

```
Usage: uv run jmail.py <command> [options]

Commands:
  manifest          Print manifest JSON
  emails            Download emails (--slim for network-only, --head N)
  documents         Download documents (--include-text for full text, --head N)
  photos            Download photos metadata (--head N)
  people            Download people (--head N)
  photo_faces       Download photo face data (--head N)
  imessage_conversations  Download iMessage conversations (--head N)
  imessage_messages       Download iMessage messages (--head N)
  star_counts       Download star counts (--head N)
  release_batches   Download release batches (--head N)
  urls              Print all dataset URLs
  duckdb-examples   Print example DuckDB SQL queries

Options:
  --head N          Show first N rows
  --slim            (emails) Omit body text columns
  --include-text    (documents) Include full extracted text
  --no-cache        Skip local caching, always download fresh
```

### Ejemplos

```bash theme={null}
# First 10 emails, network-only view
uv run jmail.py emails --slim --head 10

# All documents with full text
uv run jmail.py documents --include-text

# Imprimir URLs de conjuntos de datos para usar en otros lugares
uv run jmail.py urls

# Get manifest with dataset checksums
uv run jmail.py manifest

# Fresh download (skip cache)
uv run jmail.py emails --no-cache --head 5
```

## Dependencias

El cliente tiene tres dependencias, gestionadas automáticamente por `uv`:

* `pandas` -- gestión de DataFrames
* `pyarrow` -- lectura de archivos Parquet
* `requests` -- descargas HTTP

Estas dependencias se declaran en línea mediante PEP 723:

```python theme={null}
# /// script
# requires-python = ">=3.9"
# dependencies = ["pandas", "pyarrow", "requests"]
# ///
```


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