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
Location
Provide a zip code to get city, state and lat, lon.
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
Location
from mooch import Location
location = Location(62704).load()
assert location.city == "Springfield"
assert location.state == "Illinois"
assert location.state_abbreviation == "IL"
assert location.latitude == "39.7725"
assert location.longitude == "-89.6889"
Requires
Throws an Exception if the requirement isn't satisified.
from mooch import Require
Require.python_version("3.13")
Require.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_entry_exit
@log_entry_exit
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.3.tar.gz.
File metadata
- Download URL: mooch-0.0.3.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33cb3a11986cca4ef9280cfc1c90f77b0dafb686670abe38cf444c07c830870f
|
|
| MD5 |
f0a6e16a17b1830001dfefde5bbda037
|
|
| BLAKE2b-256 |
4786843d00e1ceebb6b162bb97655d6260d5607fcc3d8c2bd258e4fcae14181f
|
File details
Details for the file mooch-0.0.3-py3-none-any.whl.
File metadata
- Download URL: mooch-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.17
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f203b0f85cffce77d09fe9842d1a35eec312cb8cf951ab874863e2f436d84710
|
|
| MD5 |
1f3c159301a6d9a694519a5bbe73b25a
|
|
| BLAKE2b-256 |
a32f93afb7539c76ca2e2e9adeac5c58be689227f4afaebf0af0a43c31b62d1c
|