Small utility package for my projects.
Project description
Pedros
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
20b44bb6b531b33a99f150949975481401145c7260f2f6b76adb71aa539155de
|
|
| MD5 |
85c1144f2b6b8db856e96760acc0d7c6
|
|
| BLAKE2b-256 |
a3c0edb1c9621ba732b9e53066a2f3fd0eed94b9fd55098750595eb11faf994e
|
Provenance
The following attestation bundles were made for pedros-0.0.11.tar.gz:
Publisher:
python-publish.yml on PierreLapolla/pedros
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pedros-0.0.11.tar.gz -
Subject digest:
20b44bb6b531b33a99f150949975481401145c7260f2f6b76adb71aa539155de - Sigstore transparency entry: 787097561
- Sigstore integration time:
-
Permalink:
PierreLapolla/pedros@444e81a425e42c3ff448a9e2c07811d21cd55da5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/PierreLapolla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@444e81a425e42c3ff448a9e2c07811d21cd55da5 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f16a18ed9560022993524596e0be1307142860b3fdcfbc27b98adcd9e06bec81
|
|
| MD5 |
dcf867b04a4ac541f07fa3b7b7c75354
|
|
| BLAKE2b-256 |
bf0264094f224ac01f90c27c666767c4ffb8d7e212da9b6ed8cf70f61f56131d
|
Provenance
The following attestation bundles were made for pedros-0.0.11-py3-none-any.whl:
Publisher:
python-publish.yml on PierreLapolla/pedros
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pedros-0.0.11-py3-none-any.whl -
Subject digest:
f16a18ed9560022993524596e0be1307142860b3fdcfbc27b98adcd9e06bec81 - Sigstore transparency entry: 787097564
- Sigstore integration time:
-
Permalink:
PierreLapolla/pedros@444e81a425e42c3ff448a9e2c07811d21cd55da5 -
Branch / Tag:
refs/heads/master - Owner: https://github.com/PierreLapolla
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@444e81a425e42c3ff448a9e2c07811d21cd55da5 -
Trigger Event:
push
-
Statement type: