Skip to main content

Small utility package for my projects.

Project description

Pedros

PyPI

A small package of reusable Python utilities for Python projects.

Features

  • Dependency Management: Smart detection of optional dependencies
  • Logging: Configure logging with optional Rich support
  • Progress Bars: Multiple backend support (rich, tqdm, auto)
  • Timing: Measure and log function execution time
  • Type Safe: Comprehensive type hints throughout

Installation

pip install pedros

Quickstart

from pedros import has_dep, setup_logging, get_logger, progbar, timed

# Configure logging
setup_logging()
logger = get_logger()

# Check dependencies
if has_dep("rich"):
    logger.info("Rich is available!")

# Use progress bar
for item in progbar(range(10)):
    # Process item
    pass


# Time function execution
@timed
def process_data():
    return "result"

result = process_data()  # Automatically logs execution time

Advanced Progress Bar Usage

from pedros import progbar

# Different backend options
for item in progbar(range(50), backend="rich", description="Rich progress"):
    pass

for item in progbar(range(50), backend="tqdm", desc="TQDM progress"):
    pass

# Disable progress bar
for item in progbar(range(50), backend="none"):
    pass

Logging Configuration

import logging
from pedros import setup_logging, get_logger

# Different logging levels
setup_logging(logging.WARNING)  # Only warnings and errors
logger = get_logger("production")

setup_logging(logging.DEBUG)   # All messages including debug
debug_logger = get_logger("development")

# Logger hierarchy
parent_logger = get_logger("app")
child_logger = get_logger("app.module")

Installation

Basic Installation

pip install pedros

With Optional Dependencies

For enhanced functionality, install with optional dependencies:

pip install pedros[rich]    # For rich logging and progress bars
pip install pedros[tqdm]    # For tqdm progress bars
pip install pedros[all]     # All optional dependencies

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please open issues or pull requests on GitHub.

Support

For questions or support, please open a GitHub issue.

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

pedros-0.0.11.tar.gz (50.3 kB view details)

Uploaded Source

Built Distribution

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

pedros-0.0.11-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file pedros-0.0.11.tar.gz.

File metadata

  • Download URL: pedros-0.0.11.tar.gz
  • Upload date:
  • Size: 50.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pedros-0.0.11.tar.gz
Algorithm Hash digest
SHA256 20b44bb6b531b33a99f150949975481401145c7260f2f6b76adb71aa539155de
MD5 85c1144f2b6b8db856e96760acc0d7c6
BLAKE2b-256 a3c0edb1c9621ba732b9e53066a2f3fd0eed94b9fd55098750595eb11faf994e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pedros-0.0.11.tar.gz:

Publisher: python-publish.yml on PierreLapolla/pedros

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

File details

Details for the file pedros-0.0.11-py3-none-any.whl.

File metadata

  • Download URL: pedros-0.0.11-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pedros-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 f16a18ed9560022993524596e0be1307142860b3fdcfbc27b98adcd9e06bec81
MD5 dcf867b04a4ac541f07fa3b7b7c75354
BLAKE2b-256 bf0264094f224ac01f90c27c666767c4ffb8d7e212da9b6ed8cf70f61f56131d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pedros-0.0.11-py3-none-any.whl:

Publisher: python-publish.yml on PierreLapolla/pedros

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