Configuration file

Config Example

An example for a minimal working config
{
  "files": {
    "base_directory": "",  # Fill with a full path to the download dir
    "child_directories": {
      "gtfs_feeds": "gtfs_feeds",
      "output": "output",
      "filtered_feeds": "filtered_feeds",
      "logs": "logs"
    },
    "output_file_name_regexp": "^(?P<date_str>[^_]+?)_(?P<type>\\w+)",
    "output_file_type": "csv.gz"
  },

  "s3": {
    "access_key_id": "Your Access key id",  # Fill with your key parameters
    "secret_access_key": "Your secret access key",  # Fill with your key parameters
    "s3_endpoint_url": "https://ams3.digitaloceanspaces.com",
    "bucket_name": "obus-do2",
  },

  "use_data_from_today": false,
  "date_range": ["2019-03-07", "2019-03-07"],
}

Parameters description

Main configuration object parameter

The configuration for a gtfs_stats run
type object
properties
  • files
Files object parameters
  • s3
S3 object parameters
  • date_range
First and last date of the gtfs files to be download from bucket. only relevant if use_data_from_today is set to false. {Format: YYYY-MM-DD}
type array
maxLength 2
minLength 2
items
type string
pattern ^d{4}-d{2}-d{2}$
First and last date of the gtfs files to be download from bucket. only relevant if use_data_from_today is set to false. {Format: YYYY-MM-DD}
type array
maxLength 2
minLength 2
  • use_data_from_today
Download only gtfs data from today (overrides date_range).
type boolean
default False
  • max_gtfs_size_in_mb
Limit the maximum size of the downloaded gtfs files (in MB). If not set, the limit is only free disk space.
type integer
default sys.maxsize
  • display_download_progress_bar
If true, displays a proggress bar while downloading.
type boolean
default False
  • display_size_on_progress_bar
If true, displays file size on the download status bar.
type boolean
default False
  • delete_downloaded_gtfs_zip_files
If true, delete the gtfs files after parsing them.
type boolean
default True
  • write_filtered_feed
If true, writes a filtered version of the gtfs for the specific dates.
type boolean
default False
  • console_verbosity
Lowest logging level to be printed to console.
type string
enum DEBUG, INFO, WARNING, ERROR, CRITICAL
default ‘ERROR’
additionalProperties False
The configuration for a gtfs_stats run
type object
anyOf

Files object parameters

files info would be under the files tag.
type object
properties
  • base_directory
base directory for the created files.
type string
  • output_file_name_regexp
A regular expression used to find existing output files.
type string
  • output_file_type
The file type for the outputs.
type string
enum pkl.gz, csv.gz, csv
  • child_directories
Names of dirs that will be used (name is relative to base_directory
type object
properties
  • gtfs_feeds
The name of the directory the GTFS files would be downloaded to.
type string
  • output
The name of the directory for the output files.
type string
  • filtered_feeds
The name of the directory for the filtered feeds, if exists.
type string
  • logs
The name of the directory for the log files.
type string
additionalProperties False
Names of dirs that will be used (name is relative to base_directory
type object
additionalProperties False
files info would be under the files tag.
type object

S3 object parameters

All the info about S3 connection parameters would come here (under s3 tag).
type object
properties
  • access_key_id
Authorization access key id for S3.
type string
  • secret_access_key
Authorization secret access key for S3.
type string
  • s3_endpoint_url
Connection endpoint url for S3.
type string
  • bucket_name
Bucket name for S3.
type string
  • upload_results
If true, upload the analyzed results back to S3.
type boolean
  • results_path_prefix
Prefix path on S3 for the uploaded results.
type string
additionalProperties False
All the info about S3 connection parameters would come here (under s3 tag).
type object