Skip to content

N5GEH/n5geh.tutorials.createdb

Repository files navigation

Query data from a CrateDB

  • Example of querying data directly from a CrateDB
  • Configuration via:
    • Environmental Variables in .env:
      CRATE_DB_URL = 
      CRATE_DB_USER = 
      CRATE_DB_PW = 
      CRATE_DB_SSL = true
      FIWARE_CONFIG_PATH = # Path to "fiware_params.json" if you use a different one
      TIME_STEP = 1 # in seconds
      FROM_DATE=  # optional, if you run the script directly
      TO_DATE=    # optional, if you run the script directly
      
    • Configuration file fiware_params_example.json --> You will need to create your own `fiware_params.json' for use.
  • Data is retrieved, resampled and interpolated so that data is available in standardised increments.
  • Use Poetry - pyproject.toml for necessary packages
  • data_query.ipynb: Shows an example how to use the query

Functions for data retrieval

  • Functions in the [cratedb] module (cratedb.py)
    • get_data`: Retrieve in raw format
    • get_data_grouped: Retrieve data with grouping function --> faster and safer retrieval
    • get_columns`: Get existing column names (attributes)

About

Example of data query from a CrateDB

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published