Skip to main content

A collection of common python utilities.

Project description

Python Mooch

PyPI PyPI - Downloads GitHub Issues or Pull Requests

standard-readme compliant license

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

MIT © Nick Stuer

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

mooch-0.0.3.tar.gz (29.3 kB view details)

Uploaded Source

Built Distribution

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

mooch-0.0.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for mooch-0.0.3.tar.gz
Algorithm Hash digest
SHA256 33cb3a11986cca4ef9280cfc1c90f77b0dafb686670abe38cf444c07c830870f
MD5 f0a6e16a17b1830001dfefde5bbda037
BLAKE2b-256 4786843d00e1ceebb6b162bb97655d6260d5607fcc3d8c2bd258e4fcae14181f

See more details on using hashes here.

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

Hashes for mooch-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f203b0f85cffce77d09fe9842d1a35eec312cb8cf951ab874863e2f436d84710
MD5 1f3c159301a6d9a694519a5bbe73b25a
BLAKE2b-256 a32f93afb7539c76ca2e2e9adeac5c58be689227f4afaebf0af0a43c31b62d1c

See more details on using hashes here.

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