Settings

Contains default configurations for interacting with the database engines

If you wish to override the default configurations, simply instantiate the class and set the value you desire. For example, you wish to lengthen the expiry date of a BigQuery table from 3 hours (the default) to 12 hours:

from geomancer import BQConfig
myconfig = BQConfig()
assert myconfig.EXPIRY == 3 # Default value
myconfig.EXPIRY = 12 # Update config
assert myconfig.EXPIRY == 12

geomancer.backend.settings.Config

class geomancer.backend.settings.Config[source]

Bases: abc.ABC

Base abstract configuration

name

geomancer.backend.settings.BQConfig

class geomancer.backend.settings.BQConfig[source]

Bases: geomancer.backend.settings.Config

Configuration for interacting with BigQuery

DATASET_ID

str – Specify the BQ dataset where the input pandas.DataFrame will be loaded into. Internally, we load the dataframe into a BigQuery table before running the actual query. Default is geomancer.

EXPIRY

int, None – Number of hours for a given table to expire. Default is 3

MAX_RETRIES

int – Number of retries for the upload job to ensure that the table exists. Default is 10

DATASET_ID = 'geomancer'
EXPIRY = 3
MAX_RETRIES = 10
name

geomancer.backend.settings.SQLiteConfig

class geomancer.backend.settings.SQLiteConfig[source]

Bases: geomancer.backend.settings.Config

Configuration for interacting with a SQLite Database

INDEX

bool – Write pandas.DataFrame index as column. Uses INDEX_LABEL for column name Default is False

INDEX_LABEL

str or None – Column label for the index columns Default is None

IF_EXISTS

str – How to behave if the table already exists. Default is replace (drop the table before inserting new values). Other options are fail (raise a ValueError) and append (insert new values to the existing table)

IF_EXISTS = 'replace'
INDEX = False
INDEX_LABEL = None
name