Common utils for Digital Marketplace apps.
Project description
Digital Marketplace utils
What's in here?
- Digital Marketplace API clients
- Formatting utilities for Digital Marketplace
- Digital Marketplace logging for Flask using JSON Logging
- Utility functions/libraries for Amazon S3, Mailchimp, Notify, Cloudwatch
- Helper code for Flask configuration
- A formed version of Flask Feature Flags
Logging from applications
When logging from applications you should write your message as a format
string and pass any required
arguments to the log method in the extra
named argument. This allows our logging to use them as
separate fields in our JSON logs making it much easier to search and aggregate on them.
logger.info("the user {user_id} did the thing '{thing}'", extra={
'user_id': user_id, 'thing': thing
})
Note that apart from not getting the benefit, passing the formatted message can be dangerous. User
generated content may be passed, unescaped to the .format
method.
Versioning
Releases of this project follow semantic versioning, ie
Given a version number MAJOR.MINOR.PATCH, increment the:
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards-compatible manner, and
- PATCH version when you make backwards-compatible bug fixes.
To make a new version:
- update the version in the
dmutils/__init__.py
file - if you are making a major change, also update the change log;
When the pull request is merged a GitHub Action will tag the new version.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ccs_digitalmarketplace_utils-68.1.0.tar.gz
.
File metadata
- Download URL: ccs_digitalmarketplace_utils-68.1.0.tar.gz
- Upload date:
- Size: 68.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 01b42c918133304b71bd2f40e6b3d9f97c91892dfce8afc467ec6545772e5670 |
|
MD5 | ea2d200c454cda42940f8099aab0aace |
|
BLAKE2b-256 | f57fa1b775a63a50180814af218c83531295eec2e5d36f2fd5344b261aa67b56 |
File details
Details for the file ccs_digitalmarketplace_utils-68.1.0-py3-none-any.whl
.
File metadata
- Download URL: ccs_digitalmarketplace_utils-68.1.0-py3-none-any.whl
- Upload date:
- Size: 86.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b9d1d9bba78e580f305a72109dda78941d69dc482b2ebc2ab1f35c627eb19a7 |
|
MD5 | e9c5b4dd8ed2dad75a056b8d229f5b5d |
|
BLAKE2b-256 | abe805119337ac0c199921c0628200b4304eaf1eeb71b28423962138916664a6 |