Python package for accessing open data websites powered by dkan
Add the library to your project with your preferred package manager, e.g.
pip install dkanyuv add dkanypipenv install dkany
See ./scratch/basic_run.py for example code using the library to create, update, and delete datasets.
We're using uv, since pipenv was having a hard time building. Install it with pip install uv, then it should work almost identically to pipenv
To install the package and it's dependences for development, run
uv sync --dev
uv can manage your python versions for you. Try out uv python list or uv python install 3.13
The default behavior of this app can be changed with environment variables.
The easiest way to set these is by adding them to a .env file in the base directory of this repo. This file is not commited to the repo, as it might change in different contexts, but you can see the .env_example to get a sense of how this might look.
Here are the environment variables the app is currently using:
There are many ways to run the tests associated with this app.
-
Probably the easiest is to run the tests in vscode's testing pannel
-
You can also run the tests from bash with
source scripts/test.sh
- Validate dataset file (All columns have column names)
See .github/workflows/build-and-publish.yml for the workflow that publishes this library. New versions are automatically published to test.pypi.org when a pre-release is made, and to pypi.org when a release is published.