aisdb.database.decoder_csv module
Simplified decoder - CSV ExactEarth only Uses existing csvreader.rs directly, eliminating Python layers
- aisdb.database.decoder_csv.decode_csv_files(filepaths: List[str | Path], dbconn: PostgresDBConn, source: str, verbose: bool = True, workers: int = 4) List[str][source]
Decode ExactEarth CSV files directly in Rust.
This is a simplified interface that uses the existing csvreader.rs. All heavy processing happens in Rust: - CSV reading - Column parsing - PostgreSQL insertion
- Parameters:
filepaths – List of CSV files to process
dbconn – PostgreSQL connection
source – Data source identifier
verbose – Show progress
workers – Number of parallel workers
- Returns:
List of successfully processed files
Example
>>> conn = PostgresDBConn(libpq_connstring=os.environ["AISDB_PG_DSN"]) >>> files = ["/data/exactEarth_2020-10-01.csv"] >>> processed = decode_csv_files(files, conn, source="EXACTEARTH") >>> print(f"Processed {len(processed)} files")
- aisdb.database.decoder_csv.decode_exactearth_csv(filepaths: List[str | Path], dbconn: PostgresDBConn, source: str, verbose: bool = True, workers: int = 4) List[str]
Decode ExactEarth CSV files directly in Rust.
This is a simplified interface that uses the existing csvreader.rs. All heavy processing happens in Rust: - CSV reading - Column parsing - PostgreSQL insertion
- Parameters:
filepaths – List of CSV files to process
dbconn – PostgreSQL connection
source – Data source identifier
verbose – Show progress
workers – Number of parallel workers
- Returns:
List of successfully processed files
Example
>>> conn = PostgresDBConn(libpq_connstring=os.environ["AISDB_PG_DSN"]) >>> files = ["/data/exactEarth_2020-10-01.csv"] >>> processed = decode_csv_files(files, conn, source="EXACTEARTH") >>> print(f"Processed {len(processed)} files")