Utilitary functions
Utils
- b3alien.utils.detect_runtime()[source]
Detects the runtime environment where the code is executed.
- Returns:
str
- Return type:
One of “Jupyter Notebook”, “IPython Terminal”, or “Standard Python Script”
- b3alien.utils.in_ipython()[source]
Returns True if running inside any IPython shell (not standard Python).
- b3alien.utils.in_script()[source]
Returns True if running in a standard Python script (non-interactive).
- b3alien.utils.to_geoparquet(csvFile, geoFile, leftID='eqdcellcode', rightID='cellCode', exportPath='./data/export.parquet')[source]
Convert a GBIF cube download into a GeoParquet file, using the geometry of a GPKG
- Parameters:
csvFile (str) – Path to the GBIF cube csv file.
geoFile (str) – Path to the GeoPackage file.
leftID (str, optional) – Column name within the GBIF cube to match the geometry. Default is ‘edqcellcode’.
rightID (str, optional) – Column name within the GeoPackage geometry. Default is ‘cellCode’
exportPath (str, optional) – Path to which the GeoParquet file needs to be exported.
- Return type:
A GeoParquet file at the location of exportPath