Utilities

Global configuration settings can be changed using the settings object.

urbanaccess.config.settings

A set of configuration variables to initiate the configuration settings for UrbanAccess.

Parameters:
data_folder : str

location to save and load data files

logs_folder : str

location to write log files

log_file : bool

if true, save log output to a log file in logs_folder

log_console : bool

if true, print log output to the console

log_name : str

name of the logger

log_filename : str

name of the log file

gtfs_api : dict

dictionary of the name of the GTFS API service as the key and the GTFS API server root URL as the value to pass to the GTFS loader

By default the global configuration settings are already set, however they can be changed by using the functions in the urbanaccess_config class:

class urbanaccess.config.urbanaccess_config(data_folder='data', logs_folder='logs', log_file=True, log_console=False, log_name='urbanaccess', log_filename='urbanaccess', gtfs_api={'gtfsdataexch': 'http://www.gtfs-data-exchange.com/api/agencies?format=csv'})

A set of configuration variables to initiate the configuration settings for UrbanAccess.

Parameters:
data_folder : str

location to save and load data files

logs_folder : str

location to write log files

log_file : bool

if true, save log output to a log file in logs_folder

log_console : bool

if true, print log output to the console

log_name : str

name of the logger

log_filename : str

name of the log file

gtfs_api : dict

dictionary of the name of the GTFS API service as the key and the GTFS API server root URL as the value to pass to the GTFS loader

classmethod from_yaml(configdir='configs', yamlname='urbanaccess_config.yaml')

Create a urbanaccess_config instance from a saved YAML configuration.

Parameters:
configdir : str, optional

Directory to load a YAML file.

yamlname : str or file like, optional

File name from which to load a YAML file.

Returns
——-
urbanaccess_config
to_dict()

Return a dict representation of an urbanaccess_config instance.

to_yaml(configdir='configs', yamlname='urbanaccess_config.yaml', overwrite=False)

Save a urbanaccess_config representation to a YAML file.

Parameters:
configdir : str, optional

Directory to save a YAML file.

yamlname : str or file like, optional

File name to which to save a YAML file.

overwrite : bool, optional

if true, overwrite an existing same name YAML file in specified directory

Returns
——-
Nothing