Skip to content

Module src.config

Variables

ALLOW_BIND_ZIP_FILTER
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
BUCKET_NAME
CELERY_BROKER_URL
CELERY_RESULT_BACKEND
CONFIG_FILE_PATH
DEFAULT_HARD_TASK_LIMIT
DEFAULT_QUEUE_NAME
DEFAULT_README_TEXT
DEFAULT_SOFT_TASK_LIMIT
ENABLE_CUSTOM_EXPORTS
ENABLE_HDX_EXPORTS
ENABLE_METRICS_APIS
ENABLE_POLYGON_STATISTICS_ENDPOINTS
ENABLE_SOZIP
ENABLE_TILES
EXPORT_MAX_AREA_SQKM
EXPORT_PATH
EXTRA_README_TXT
FILE_UPLOAD_METHOD
HDX_HARD_TASK_LIMIT
HDX_SOFT_TASK_LIMIT
INDEX_THRESHOLD
LIMITER
LOG_LEVEL
MAX_WORKERS
ONDEMAND_QUEUE_NAME
PARALLEL_PROCESSING_CATEGORIES
POLYGON_STATISTICS_API_RATE_LIMIT
POLYGON_STATISTICS_API_URL
PROCESS_SINGLE_CATEGORY_IN_POSTGRES
RATE_LIMITER_STORAGE_URI
RATE_LIMIT_PER_MIN
SENTRY_DSN
SENTRY_RATE
USE_CONNECTION_POOLING
USE_DUCK_DB_FOR_CUSTOM_EXPORTS
USE_S3_TO_UPLOAD
WORKER_PREFETCH_MULTIPLIER
config
level
logger

Functions

get_bool_env_var

def get_bool_env_var(
    key,
    default=False
)

get_db_connection_params

def get_db_connection_params(

) -> dict
Return a python dict that can be passed to psycopg2 connections to authenticate to Postgres Databases

Returns: connection_params (dict): PostgreSQL connection parameters corresponding to the configuration section.

get_oauth_credentials

def get_oauth_credentials(

) -> tuple
Get OAuth2 credentials from env file and return a config dict

Return an ordered python tuple that can be passed to functions that authenticate to OSM.

Order of precedence: 1. Environment Variables 2. Config File 3. Default fallback

Returns: oauth2_credentials (tuple): Tuple containing OAuth2 client secret, client ID, and redirect URL.

not_raises

def not_raises(
    func,
    *args,
    **kwargs
)