pygeodes.utils.config.Config#

class pygeodes.utils.config.Config(api_key: str | None = None, logging_level: Literal['DEBUG', 'INFO'] = 'INFO', download_dir: str = '.', checksum_error: bool = True, use_async_requests: bool = True, aws_access_key_id: str | None = None, aws_secret_access_key: str | None = None, aws_session_token: str | None = None, region_name: str = 'us-east-1')[source]#

Bases: object

This class helps the user configuring Geodes

__init__(api_key: str | None = None, logging_level: Literal['DEBUG', 'INFO'] = 'INFO', download_dir: str = '.', checksum_error: bool = True, use_async_requests: bool = True, aws_access_key_id: str | None = None, aws_secret_access_key: str | None = None, aws_session_token: str | None = None, region_name: str = 'us-east-1') None#

Methods

__init__([api_key, logging_level, ...])

check_s3_config()

Checks if the current conf has s3 parameters

from_file([file])

Checks if a filepath exists and reads info from a it and returns a Config

has_s3_parameters()

Returns wether the conf object has s3 parameters with not-None values

to_dict()

Returns the config in Python dict format

Attributes

api_key

aws_access_key_id

aws_secret_access_key

aws_session_token

checksum_error

download_dir

has_api_key

Returns wether the current config has an api key

logging_level

region_name

s3_parameters

Returns all the conf params related to AWS S3

use_async_requests

check_s3_config()[source]#

Checks if the current conf has s3 parameters

Raises:
MissingConfParamException
classmethod from_file(file: str = 'pygeodes-config.json')[source]#

Checks if a filepath exists and reads info from a it and returns a Config

Parameters:
filestr, optional

the filepath, by default CONFIG_DEFAULT_FILENAME

Returns:
Config

the config object

property has_api_key: bool#

Returns wether the current config has an api key

Returns:
bool

Returns wether the current config has an api key

has_s3_parameters() bool[source]#

Returns wether the conf object has s3 parameters with not-None values

Returns:
bool

wether the conf has S3 parameters

property s3_parameters: dict#

Returns all the conf params related to AWS S3

Returns:
dict

the parameters

to_dict() dict[source]#

Returns the config in Python dict format

Returns:
dict

the config in dict