Configuration#

Configuration#

To start using pygeodes, you need to configure it. It can be done by several ways :

From the default filename#

You can also use the default filename, pygeodes-config.json :

from pygeodes import Config

conf = Config.from_file() # works only if the default filename is in your cwd

From a specified file#

pygeodes let’s you also specify a file from which to load your config :

from pygeodes import Config

conf = Config.from_file("path/to/my/conf-file.json")

Manually#

You can also specify manually all the config parameters in the pygeodes.utils.config.Config class :

from pygeodes import Config

conf = Config(api_key="myApiKey",logging_level="DEBUG")

Config parameters#

Here is a list of all the config parameters that you can use :

name

type

default

description

api_key

str

Your geodes api key (to learn how to get one, see geodes docs)

logging_level

["DEBUG","INFO"]

"INFO"

The logging level you want to have, DEBUG is more verbose than INFO

download_dir

str

The default directory in which your file downloads will be placed

checksum_error

bool

True

Wether to raise an error if the checksum of your file is different from the server checksum

use_async_requests

bool

True

Wether to use async requests in geodes (doesn’t work in notebook environments)

aws_access_key_id

str

See boto3 configuration

aws_secret_access_key

str

See boto3 configuration

aws_session_token

str

See boto3 configuration

region_name

str

"us-east-1"

See boto3 configuration

Here’s an example of what your configuration could look like (it’s a minimal example) :

{"api_key" : "myApiKey","logging_level" : "DEBUG","download_dir" : "/tmp"}

Creating your Geodes object#

When you have your pygeodes.utils.config.Config ready, you can start working with geodes :

from pygeodes import Geodes

geodes = Geodes(conf=conf)

Then you can start working around by searching for some collections, see Search for collections.