Skip to main content

Personally common and useful Python features

Project description

kaparoo-python

PyPI version Downloads Python License: MIT uv Ruff ty Copier

Personally common and useful Python features.

📦 Installation

Requires Python 3.14+.

# With uv (recommended)
uv add kaparoo-python

# With pip
pip install kaparoo-python

🧩 Modules

kaparoo.filesystem

pathlib-based filesystem helpers.

  • existence — existence checks (*_exists) and ensure_* validators.
  • directorymake_dir(s), dir_empty(s) (with _unsafe variants).
  • utilsstringify_path(s), wrap_path(s).
  • exceptionsDirectoryNotFoundError, NotAFileError.
  • typesStrPath, StrPaths.

kaparoo.filesystem.search

Filesystem traversal with composable filters.

  • Entry pointssearch_paths, search_files, search_dirs.
  • Pattern filtersEquals, StartsWith, EndsWith, Contains, Regex, Glob.
  • Multi-pattern filtersEqualsAny, StartsWithAny, EndsWithAny, ContainsAny.
  • Logical filtersAnd, Or, Not.
  • SerializationFilter.to_dict() / Filter.from_dict() round-trip via a "kind" discriminator; Filter.parse() accepts a Filter or a FilterDict; register_filter(kind) extends the dispatcher with custom subclasses. FilterDict family lives at kaparoo.filesystem.search.filters.types.
  • Deprecatedget_paths, get_files, get_dirs (use search_*).

kaparoo.utils

  • timerTimer and LapTimer context-manager / decorator timers.
  • optionalreplace_if_none, factory_if_none, unwrap_or_*.

📋 TODO

See TODO.md for tracked open items.

📜 Changelog

See CHANGELOG.md for the version history.

⚖️ License

This project is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kaparoo_python-0.2.1.tar.gz (22.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kaparoo_python-0.2.1-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file kaparoo_python-0.2.1.tar.gz.

File metadata

  • Download URL: kaparoo_python-0.2.1.tar.gz
  • Upload date:
  • Size: 22.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kaparoo_python-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9463d675a1b026c8d8b235923e3ab8eab7b8e8ad482d26e83e6b47bce7bf6ee5
MD5 4919eb37a5e22e7e877f23db6d6c708e
BLAKE2b-256 9d87de65d9c742aae4187a9134036c212b85c2389efbaeeedca3f24ff08e5fff

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaparoo_python-0.2.1.tar.gz:

Publisher: publish.yml on kaparoo/kaparoo-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kaparoo_python-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: kaparoo_python-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for kaparoo_python-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 53f0b020c624e7fe861f6f7e9ea04ae2a0591728733deec90b0e0cd48e0130e3
MD5 0f22a61c025d18e4e80e9986eb3f5b25
BLAKE2b-256 b4737248a40370835f9968c33705c25b456d617ae5856060f7c936771e3e0da0

See more details on using hashes here.

Provenance

The following attestation bundles were made for kaparoo_python-0.2.1-py3-none-any.whl:

Publisher: publish.yml on kaparoo/kaparoo-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page