Vai al contenuto principale
Jmail Il client Python di Jmail è distribuito come file singolo, senza necessità di installazione. Utilizza le dipendenze inline di PEP 723, quindi uv run gestisce tutto automaticamente.

Configurazione

Non è necessaria alcuna installazione. Esegui semplicemente con uv:
uv run clients/python/jmail.py emails --head 5
Oppure utilizzalo come libreria nei tuoi script:
from jmail import JmailClient

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

Uso della libreria

Uso di base

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)

# Documenti con testo completo estratto (scarica file frammentati)
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()

Ottenere gli URL diretti

Per l’utilizzo con DuckDB, Polars o altri strumenti:
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"

Disabilitare la cache

# Scarica sempre una versione aggiornata (nessuna cache locale)
client = JmailClient(cache=False)

Riferimento dell’interfaccia a riga di comando (CLI)

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

Esempi

# 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

# Print dataset URLs for use elsewhere
uv run jmail.py urls

# Ottieni il manifest con i checksum dei dataset
uv run jmail.py manifest

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

Dipendenze

Il client ha tre dipendenze, gestite automaticamente da uv:
  • pandas — gestione dei DataFrame
  • pyarrow — lettura di file Parquet
  • requests — download HTTP
Queste dipendenze sono dichiarate inline tramite PEP 723:
# /// script
# requires-python = ">=3.9"
# dependencies = ["pandas", "pyarrow", "requests"]
# ///