Skip to main content

pycommontools

A collection of common Python utilities and tools for your personal projects.

Installation

pip install pycommontools
# or
uv add pycommontools

Features

Resources

Singleton Metaclass - Implement the singleton pattern easily:

from pycommontools.resources.singleton import Singleton

class DatabaseConnection(metaclass=Singleton):
    def __init__(self, host: str):
        self.host = host

# Both instances will be the same object
db1 = DatabaseConnection("localhost")
db2 = DatabaseConnection("localhost")
assert db1 is db2  # True

Configs

Logger Setup - Configure loggers with custom levels:

from pycommontools.configs.logging import setup_logger
import logging

# Create a logger with DEBUG level
logger = setup_logger("myapp", level=logging.DEBUG)
logger.debug("Debug message")
logger.info("Info message")

# Create a logger with WARNING level
warn_logger = setup_logger("myapp.warnings", level="WARNING")

Development

This project uses uv for dependency management.

# Install dependencies
uv sync

# Run tests (when available)
uv run pytest

Requirements

  • Python 3.13+

License

MIT

Release files for pycommontools 0.0.4

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

Source distribution (sdist)

Source distribution for pycommontools 0.0.4
File Size Uploaded
pycommontools-0.0.4.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycommontools 0.0.4
File Interpreter ABI Platform
pycommontools-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / pycommontools-0.0.4.tar.gz

Download URL pycommontools-0.0.4.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a2834a694739fe7b0dace0b894359664d94a6a3868513c76d85a427befa2744b
BLAKE2b-256 checksum
How to use checksums
a6809b02d6786a32a61d329cdc9ec18320387b3c6820953dfa16f58e90afe9e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pycommontools-0.0.4-py3-none-any.whl

Download URL pycommontools-0.0.4-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
89435ff0c8c8fd6b06efdfcb79a2c06a9ae532bbda814fba96a07c78f922de3c
BLAKE2b-256 checksum
How to use checksums
c486a4b577f34d824d2f07f7794648a4760c9870d4425d1cc2b6303464ae7e47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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