Skip to content

Crown-Commercial-Service/ccs-digitalmarketplace-apiclient

Repository files navigation

Digital Marketplace API client

Python 3.11 Python 3.12 Python 3.13 PyPI version

What's in here?

API clients for Digital Marketplace Data API and Search API.

Originally was part of Digital Marketplace Utils.

Running the tests

Install Python dependencies:

make bootstrap
invoke requirements-dev

Run the tests:

invoke test

Usage examples

data_client = apiclient.DataAPIClient(api_url, api_access_token)
services = data_client.find_services_iter(framework=frameworks)

Releasing a new version

To update the package version, edit the __version__ = ... string in dmapiclient/__init__.py, commit and push the change and wait for CI to create a new version tag.

Once the tag is available on GitHub, the new version can be used by the apps by adding the following line to the app requirements.txt (replacing X.Y.Z with the current version number):

git+https://github.com/Crown-Commercial-Service/ccs-digitalmarketplace-apiclient.git@X.Y.Z#egg=ccs-digitalmarketplace-apiclient==X.Y.Z

When changing a major version number consider adding a record to the CHANGELOG.md with a description of the change and an example of the upgrade process for the client apps.

Pre-commit hooks

This project has a pre-commit hook to do some general file checks and check the pyproject.toml. Follow the Quick start to see how to set this up in your local checkout of this project.

Licence

Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.

The documentation is © Crown copyright and available under the terms of the Open Government 3.0 licence.