get_geodatastore

Contents

get_geodatastore#

get_geodatastore() CloudPath | Path[source]#

Get database directory.

If USE_S3_STORAGE is set to 1, this function returns AnyPath("s3://sertit-geodatastore").

If USE_S3_STORAGE is set to 0 it returns:

  • AnyPath("//ds2/database02/BASES_DE_DONNEES") if code is running on Windows

  • AnyPath(/home/ds2_db2/BASE_DE_DONNESS`) if code is running in a Docker containers on Windows

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