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 |
---|---|---|---|
|
|
Your geodes api key (to learn how to get one, see geodes docs) |
|
|
|
|
The logging level you want to have, DEBUG is more verbose than INFO |
|
|
The default directory in which your file downloads will be placed |
|
|
|
|
Wether to raise an error if the checksum of your file is different from the server checksum |
|
|
|
Wether to use async requests in geodes (doesn’t work in notebook environments) |
|
|
||
|
|
||
|
|
||
|
|
|
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.