API Reference¶
This section contains the auto-generated API documentation from docstrings.
Core Modules¶
main¶
read¶
write¶
transform¶
gtfs¶
Utility Modules¶
config¶
Configuration and Logging Module¶
This module provides application configuration, AWS client setup, and logging configuration for the Amtrak Ingestion system.
- amtraker_ingestion.chalicelib.config.s3_client¶
Configured S3 client for AWS operations.
- Type:
boto3.client
- amtraker_ingestion.chalicelib.config.AMTRAK_ENABLED¶
Flag to enable/disable Amtrak data processing.
- Type:
- amtraker_ingestion.chalicelib.config.VIA_ENABLED¶
Flag to enable/disable VIA Rail data processing.
- Type:
- amtraker_ingestion.chalicelib.config.BRIGHTLINE_ENABLED¶
Flag to enable/disable Brightline data processing.
- Type:
- amtraker_ingestion.chalicelib.config.Functions¶
- ---------
- class amtraker_ingestion.chalicelib.config.JSONFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)[source]¶
Bases:
FormatterJSON log formatter for structured Datadog log ingestion.
- format(record)[source]¶
Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
- amtraker_ingestion.chalicelib.config.setup_logging()[source]¶
Configure logging for the application. Emits JSON-structured logs compatible with Datadog log ingestion via Forwarder.
- amtraker_ingestion.chalicelib.config.get_logger(name)[source]¶
Get a logger instance for a specific module.
- Args:
name: Usually __name__ from the calling module
- Returns:
Logger instance configured with the application settings
constants¶
Constants and Configuration Values¶
This module defines constants used throughout the Amtrak Ingestion system, including API endpoints, S3 bucket names, file paths, and data schemas.
- amtraker_ingestion.chalicelib.constants.AMTRAKER_API¶
URL for the Amtraker trains API endpoint.
- Type:
- amtraker_ingestion.chalicelib.constants.S3_BUCKET¶
Name of the S3 bucket for data storage.
- Type:
- amtraker_ingestion.chalicelib.constants.CSV_FIELDS¶
Field names for event CSV files.
- amtraker_ingestion.chalicelib.constants.EASTERN_TIME¶
Eastern timezone for service date calculations.
- Type:
ZoneInfo