Examples
In ODP-SDK GitHub Repository, we have provided a few examples to help you get started with the ODP-SDK. The examples are located in the examples directory of the repository.
To work with the examples you can use git to clone into the repository and start using the examples by going into the
examples
folder. You need to clone the repository using the command below in your local terminal or command prompt:
git clone https://github.com/C4IROcean/odp-sdk-python.git
If you are using an ODP Workspace, you can open the terminal by clicking on the blue button with a plus sign inside it and by selecting the Terminal option from the newly opened Launcher page. You can then use the command above to clone the repository into your workspace storage.
Here is a list of functionalities that are covered in the example files:
Catalog Client Example
- Listing datasets
- Creating a data catalog
- Querying for a dataset
- Deleting a dataset
Raw Client Example
- Creating a dataset
- Uploading a file to a dataset
- Listing files in a dataset
- Downloading a file from a dataset
- Deleting a file from a dataset
- Deleting a dataset
Tabular Client Example
- Creating a dataset
- Creating a schema for a dataset
- Inserting data into a dataset
- Querying for data in a dataset
- Updating data in a dataset
- Deleting data from a dataset
- Deleting a schema from a dataset
- Deleting a dataset
Observables Example
- Listing observables
- Creating an observable
- Querying for an observable
- Querying for observables using a geolocation filter
- Deleting an observable
Workspace Examples
Here are a few examples that are in Jupyter notebook format for ease of use in ODP Workspaces:
Raw Roundtrip
- Demonstrates the process of uploading a file to a dataset, downloading the file, and deleting the file.
- In Jupyter notebook format for ease of use in ODP workspaces.
Tabular Roundtrip
- Demonstrates the process of creating a dataset, creating a schema for the dataset, inserting data into the dataset, querying for data in the dataset, updating data in the dataset, deleting data from the dataset, deleting the schema from the dataset, and deleting the dataset.
- In Jupyter notebook format for ease of use in ODP workspaces.