Skip to main content

Boxine - bx_py_utils

Various Python utility functions

Quickstart

pip install bx_py_utils

Existing stuff

Here only a simple list about existing utilities. Please take a look into the sources and tests for deeper informations.

bx_py_utils.anonymize

  • anonymize() - Anonymize the given string with special handling for eMail addresses.

bx_py_utils.auto_doc

bx_py_utils.aws.client_side_cert_manager

bx_py_utils.aws.secret_manager

bx_py_utils.compat

bx_py_utils.dict_utils

  • dict_get() - nested dict get()
  • pluck() - Extract values from a dict, if they are present

bx_py_utils.environ

bx_py_utils.error_handling

  • print_exc_plus() - Print traceback information with a listing of all the local variables in each frame.

bx_py_utils.graphql_introspection

bx_py_utils.hash_utils

bx_py_utils.humanize.pformat

  • pformat() - Format given object: Try JSON fist and fallback to pformat()

bx_py_utils.humanize.time

bx_py_utils.iteration

  • chunk_iterable() - Returns a generator that yields slices of iterable of the given chunk_size.

bx_py_utils.path

bx_py_utils.processify

bx_py_utils.stack_info

bx_py_utils.test_utils.assertion

bx_py_utils.test_utils.datetime

  • parse_dt() - Helper for easy generate a datetime instance via string.

bx_py_utils.test_utils.filesystem_utils

  • FileWatcher() - Helper to record which new files have been created.

bx_py_utils.test_utils.mock_aws_secret_manager

bx_py_utils.test_utils.mock_boto3session

bx_py_utils.test_utils.requests_mock_assertion

bx_py_utils.test_utils.snapshot

Assert complex output via auto updated snapshot files with nice diff error messages.

bx_py_utils.test_utils.time

Backwards-incompatible changes

v36 -> v37 - Outsourcing Django stuff

We split bx_py_utils and moved all Django related utilities into the separated project:

So, bx_py_utils is better usable in non-Django projects, because Django will not installed as decency of "bx_py_utils"

developing

To start developing e.g.:

~$ git clone https://github.com/boxine/bx_py_utils.git
~$ cd bx_py_utils
~/bx_py_utils$ make
help                 List all commands
install-poetry       install or update poetry
install              install via poetry
update               Update the dependencies as according to the pyproject.toml file
lint                 Run code formatters and linter
fix-code-style       Fix code formatting
tox-listenvs         List all tox test environments
tox                  Run pytest via tox with all environments
tox-py36             Run pytest via tox with *python v3.6*
tox-py37             Run pytest via tox with *python v3.7*
tox-py38             Run pytest via tox with *python v3.8*
tox-py39             Run pytest via tox with *python v3.9*
pytest               Run pytest
pytest-ci            Run pytest with CI settings
publish              Release new version to PyPi
clean                Remove created files from the test project

License

MIT. Patches welcome!

Metadata

Release files for bx-py-utils 43

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bx-py-utils 43
File Size Uploaded Provenance Actions
bx_py_utils-43.tar.gz 20.8 kB Without provenance Details for bx_py_utils-43.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bx-py-utils 43
File Interpreter ABI Platform Actions
bx_py_utils-43-py3-none-any.whl Python 3 none any Details for bx_py_utils-43-py3-none-any.whl

Total release size: 44.5 kB

Release files / bx_py_utils-43.tar.gz

Download URL bx_py_utils-43.tar.gz
Size 20.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f1fdca8cc70d4a3606d9591eb1d5d2f6b88e2a72a72c9b60acc0705573ef17dd
BLAKE2b-256 checksum
How to use checksums
123bc91d270d0e946553a4aee3b2542688e52a38f234e507b419e0fd62ec620b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.7 Linux/5.10.0-8-amd64

Release files / bx_py_utils-43-py3-none-any.whl

Download URL bx_py_utils-43-py3-none-any.whl
Size 23.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
151fba3f490a04cbb3795149986caf59cb07a245454571a528d05a8e844c9f29
BLAKE2b-256 checksum
How to use checksums
98ada9e7f38b373d5a0bceeac3feff254d80d17b76c3bbc1d1ee4a509f226062
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.9.7 Linux/5.10.0-8-amd64

Security for bx-py-utils 43

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

43 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page