Skip to main content

pytoolkit

pytoolkit is a small collection of helper modules that can be used across different Python projects.

The focus is on simple building blocks: configuration handling, logging, timing, HTTP helpers, caching, string helpers, and more.

Current version: 0.4.0

🌐 Website: www.actobotics.net
🐦 X/Twitter: @actoboticsnet

CI codecov Python Version License

Project goals

  • Provide small, composable utilities instead of a heavy framework
  • Keep dependencies minimal and well known
  • Make it easy to reuse the same helpers across many projects
  • Stay readable and beginner friendly while still being robust

Installation

Basic Installation

pip install acto-pytoolkit

From Source

git clone https://github.com/actobotics/pyToolkit.git
cd pyToolkit
pip install -e .

Optional Dependencies

# For async HTTP client support
pip install acto-pytoolkit[async]

# For development (testing, linting, type checking)
pip install acto-pytoolkit[dev]

# For building documentation
pip install acto-pytoolkit[docs]

# Install everything
pip install acto-pytoolkit[all]

Usage overview

The package is split into focused modules:

  • config_loader - Load configuration from JSON, YAML, TOML, and .env files
  • logger - Colored logging with environment-based configuration
  • timer - Function timing and profiling utilities
  • http_client - Sync HTTP client with retry logic
  • async_http_client - Async HTTP client using aiohttp (optional)
  • crypto_utils - Hashing and secure token generation
  • file_utils - Safe file operations with atomic writes
  • cache - In-memory caching with TTL support
  • retry - Retry decorator with exponential backoff
  • validators - Validation for email, URL, UUID, IP addresses
  • math_tools - Moving average, normalization, scaling
  • string_tools - Slugify, case conversion, text processing
  • task_scheduler - Simple in-process task scheduling
  • env - Environment detection utilities
  • cli - Command-line interface framework
  • context_utils - Nested dictionary operations
  • serialization - JSON, YAML, TOML helpers

See the examples directory for small, complete scripts, or check the full documentation.

Quick Example

from pytoolkit import ConfigLoader, get_logger, HttpClient

# Configure logging
logger = get_logger()

# Load configuration
config = ConfigLoader(env_file=".env", json_file="config.json")
api_url = config.get("API_URL", "https://api.example.com")

# Make HTTP request with automatic retries
with HttpClient(base_url=api_url, max_retries=3) as client:
    response = client.get("/users")
    users = client.json(response)
    logger.info("Fetched %d users", len(users))

CLI

After installation a small CLI entry point is available:

pytoolkit info
pytoolkit env

Use pytoolkit --help to see available commands.

Contributing

  • Fork the repository
  • Create a new branch for your change
  • Add or adjust tests where it makes sense
  • Run the test suite:
python -m unittest discover -s tests
  • Open a pull request with a short description of your change

Versioning

The project follows a simple semantic versioning scheme:

  • Breaking changes bump the major version
  • New features bump the minor version
  • Small fixes bump the patch version

Key Features

🚀 Enhanced HTTP Client

  • Support for PATCH method
  • Custom headers and authentication
  • Async HTTP client with aiohttp

🎯 Improved Validators

  • Better email validation (RFC 5322 compliant)
  • URL validation with TLD requirements
  • Strict mode options

🧪 Comprehensive Testing

  • 80%+ code coverage
  • Tests for all modules
  • CI/CD with GitHub Actions

📚 Complete Documentation

  • Sphinx documentation
  • API reference for all modules
  • Quick start guide and examples

🛠️ Developer Tools

  • Pre-commit hooks (Black, Ruff)
  • MyPy strict type checking
  • Automated testing on Python 3.9-3.12

Changelog

See CHANGELOG.md for a detailed history of changes.

Metadata

Release files for acto-pytoolkit 0.4.0

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

Source distribution (sdist)

Source distribution for acto-pytoolkit 0.4.0
File Size Uploaded Provenance
acto_pytoolkit-0.4.0.tar.gz 28.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for acto-pytoolkit 0.4.0
File Interpreter ABI Platform
acto_pytoolkit-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.1 kB

Release files / acto_pytoolkit-0.4.0.tar.gz

Download URL acto_pytoolkit-0.4.0.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
59ff9aeca6022cc7deff0c417c2330a3f8b39fd15b768d668468e70ac1b455af
BLAKE2b-256 checksum
How to use checksums
620df31b668062312652a6631700cac7ff36251b565c086eec73f4c477f5eaf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 23, 2025.

Transparency log

Release files / acto_pytoolkit-0.4.0-py3-none-any.whl

Download URL acto_pytoolkit-0.4.0-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7650825b0ea1c99c204709083eb15fa537e476a2650d35b8407c0c096d466c9b
BLAKE2b-256 checksum
How to use checksums
4b6d444944df782c12e6aa5e37c7db5eb2324655fcb085a48349a7efe36853d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 23, 2025.

Transparency log

Security for acto-pytoolkit 0.4.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for acto_pytoolkit-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 23, 2025.

Transparency log

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

0.4.0 This release

2 release files Full 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