A collection of common python utilities.
Project description
Python Mooch
This Python package is a collection of useful Python code that is commonly used on all types of Python projects.
Table of Contents
📖 Features
Config File
Uses a TOML config file. Easily get/set configuration values. Automatically sets values to defaults if they're not currently saved in the configuration file.
Requires
Throw an exception if the installed python version isn't new enough. Throw an exception if the desired operating system is incorrect.
Logging
Add automatic logging to methods that are run by using a decorator. Useful for logging function arguments, start of function and end of function.
🛠 Install
# PyPI
pip install mooch
or
uv add mooch
📌 Dependencies
Python 3.9 or greater
🎮 Usage
Config File
from mooch import Config
default_settings = {
"settings": {
"name": "MyName,
"mood": "happy",
},
}
config = Config("settings.toml", default_settings)
print(config["settings.mood"])
config["settings.mood"] = "angry"
print(config["settings.mood"])
Requires
Throws an Exception if the requirement isn't satisified.
from mooch.require.require import python_version, operating_system
python_version("3.13")
operating_system("Windows")
Logging Decorator
For adding 'BEGIN' and 'END' to log files whenever the decorated function runs. Also logs the values of the args passed in.
from mooch.logging.decorators import log_begin_and_end
@log_begin_and_end
def random_function(arg1, arg2){
print(arg1)
print(arg2)
}
🏆 Contributing
PRs accepted.
If editing the Readme, please conform to the standard-readme specification.
Bug Reports and Feature Requests
Please use the issue tracker to report any bugs or request new features.
Contributors
📃 License
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 mooch-0.0.1.tar.gz.
File metadata
- Download URL: mooch-0.0.1.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9549aae0e20c13a07551364ea3230948fe07f4ddc7879aa744dd68bd43b44cbc
|
|
| MD5 |
bfde0464414fc4ad70261fb339d7305f
|
|
| BLAKE2b-256 |
1badf2717c2a95deae1eb0407cff04ae3a0bfffaa3bacdf048b180fac03e3b94
|
File details
Details for the file mooch-0.0.1-py3-none-any.whl.
File metadata
- Download URL: mooch-0.0.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f6b3bccfee37b0aae210b3a0fa90884c7a112ee0c69dc8cecc0ed3109c7e430f
|
|
| MD5 |
416bf0824704dcb5fee2add92033a5bf
|
|
| BLAKE2b-256 |
2c469634410ede67ada2c20b1957f5e0fb4d0055e3570513751c4754ca3f1157
|