get_geodatastore

Contents

get_geodatastore#

get_geodatastore() CloudPath | Path[source]#

Get database directory.

If the environment variable USE_S3_STORAGE=1, this function returns AnyPath(“s3://sertit-geodatastore”).

If USE_S3_STORAGE=0, it returns path to the DS2: AnyPath(“//ds2/database02/BASES_DE_DONNEES”) or AnyPath(/home/ds2_db2/BASE_DE_DONNESS)`

Returns:

Database directory

Return type:

AnyPath

Example

Don’t set manually USE_S3_STORAGE with os.environ !

>>> from sertit.unistra import get_geodatastore
>>> import os
>>> os.environ["USE_S3_STORAGE"] = "1"
>>> print(get_geodatastore())
s3://sertit-geodatastore
>>> from sertit.unistra import get_geodatastore
>>> import os
>>> os.environ["USE_S3_STORAGE"] = "0"
>>> print(get_geodatastore())
\ds2\database02\BASES_DE_DONNEES\GLOBAL