Domino provides secure, programmatic access to datasets through the Datasource Proxy. This allows your application to treat Domino datasets as standard datasources.
When a user interacts with your app, Domino automatically includes an authorization token in the request header. Your app uses this token to access datasets on behalf of the user, ensuring that data access adheres to their permissions.
Although you can call the Datasource Proxy API directly, we recommend using the Domino client library for Python. This library simplifies integration and results in cleaner, more maintainable code.
Note: Example code snippets are available on each dataset’s detail page in the Domino UI.
from domino_data.datasets import DatasetClient, DatasetConfig
# instantiate a client
dataset = DatasetClient(token = request.headers.get('Authorization', '')[7:]).get_dataset("dataset-quick-start-67bca8d95df4c35e79db40f5")
# select a specific snapshot, if a specific snapshot is not set the read/write snapshot is used
dataset.update(config=DatasetConfig(snapshot_id="[your own snapshotID]"))
# list files in the dataset
dataset.list_files()
# get files in the dataset
dataset.get("/path/to/file")