Interface URI universelle
uri() est le point d’accès universel recommandé, qui détecte automatiquement le type de source :
Référence de la syntaxe des URI
| Type de source | Format d’URI | Exemple |
|---|---|---|
| Fichier local | path/to/file | data.csv, /abs/path/data.parquet |
| S3 | s3://bucket/path | s3://mybucket/data.parquet?nosign=true |
| GCS | gs://bucket/path | gs://mybucket/data.csv |
| Azure | az://container/path | az://mycontainer/data.parquet |
| HTTP/HTTPS | https://url | https://example.com/data.csv |
| MySQL | mysql://user:pass@host:port/db/table | mysql://root:pass@localhost:3306/mydb/users |
| PostgreSQL | postgresql://user:pass@host:port/db/table | postgresql://postgres:pass@localhost:5432/mydb/users |
| SQLite | sqlite:///path?table=name | sqlite:///data.db?table=users |
| ClickHouse | clickhouse://host:port/db/table | clickhouse://localhost:9000/default/hits |
Sources de données de type fichier
from_file
| Paramètre | Type | Par défaut | Description |
|---|---|---|---|
path | str | obligatoire | Chemin de fichier (local ou URL) |
format | str | None | Format de fichier (détecté automatiquement si None) |
compression | str | None | Type de compression (détecté automatiquement si None) |
Fonctions de lecture compatibles avec Pandas
Stockage Cloud
from_s3
| Paramètre | Type | Par défaut | Description |
|---|---|---|---|
url | str | obligatoire | URL S3 (s3://bucket/path) |
access_key_id | str | None | ID de la clé d’accès AWS |
secret_access_key | str | None | Clé d’accès secrète AWS |
format | str | None | Format de fichier (détecté automatiquement) |
from_gcs
from_azure
from_hdfs
from_url
Bases de données
from_mysql
| Paramètre | Type | Par défaut | Description |
|---|---|---|---|
host | str | obligatoire | Hôte MySQL |
database | str | obligatoire | Nom de la base de données |
table | str | obligatoire | Nom de la table |
user | str | obligatoire | Nom d’utilisateur |
password | str | obligatoire | Mot de passe |
port | int | 3306 | Numéro de port |
from_postgresql
from_clickhouse
from_mongodb
from_sqlite
Lacs de données
from_iceberg
from_delta
from_hudi
Sources en mémoire
from_df / from_dataframe
Constructeur DataFrame
Sources spéciales
from_numbers
from_random
run_sql
Tableau récapitulatif
| Méthode | Type de source | Exemple |
|---|---|---|
uri() | Universel | DataStore.uri("s3://bucket/data.parquet") |
from_file() | Fichiers locaux/distants | DataStore.from_file("data.csv") |
read_csv() | Fichiers CSV | pd.read_csv("data.csv") |
read_parquet() | Fichiers Parquet | pd.read_parquet("data.parquet") |
from_s3() | Amazon S3 | DataStore.from_s3("s3://bucket/path") |
from_gcs() | Google Cloud Storage | DataStore.from_gcs("gs://bucket/path") |
from_azure() | Azure Blob | DataStore.from_azure("az://container/path") |
from_hdfs() | HDFS | DataStore.from_hdfs("hdfs://host/path") |
from_url() | HTTP/HTTPS | DataStore.from_url("https://example.com/data.csv") |
from_mysql() | MySQL | DataStore.from_mysql(host, db, table, user, pass) |
from_postgresql() | PostgreSQL | DataStore.from_postgresql(host, db, table, user, pass) |
from_clickhouse() | ClickHouse | DataStore.from_clickhouse(host, db, table) |
from_mongodb() | MongoDB | DataStore.from_mongodb(uri, db, collection) |
from_sqlite() | SQLite | DataStore.from_sqlite("data.db", table) |
from_iceberg() | Apache Iceberg | DataStore.from_iceberg("/path/to/table") |
from_delta() | Delta Lake | DataStore.from_delta("/path/to/table") |
from_hudi() | Apache Hudi | DataStore.from_hudi("/path/to/table") |
from_df() | pandas DataFrame | DataStore.from_df(pandas_df) |
DataFrame() | Dictionnaire / DataFrame | pd.DataFrame({'a': [1, 2, 3]}) |
from_numbers() | Nombres séquentiels | DataStore.from_numbers(1000000) |
from_random() | Données aléatoires | DataStore.from_random(rows=1000, columns=5) |
run_sql() | SQL brut | DataStore.run_sql("SELECT * FROM ...") |