Skip to main content

A collection of common python utilities.

Project description

Python Mooch

PyPI PyPI - Downloads GitHub Issues or Pull Requests

Python Versions Codecov GitHub Actions Workflow Status

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.4.tar.gz (30.9 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.4-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file mooch-0.0.4.tar.gz.

File metadata

  • Download URL: mooch-0.0.4.tar.gz
  • Upload date:
  • Size: 30.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for mooch-0.0.4.tar.gz
Algorithm Hash digest
SHA256 2689e57d079fbbc9f1e843c295e3e875400234cf1055be635a7520fac945b522
MD5 b640694b7e230c90fee536a93559496a
BLAKE2b-256 0abb79a1c9e219aa0edbc8b9a1095afd3c727840cbb94223fdc9b6a1c8cd71a1

See more details on using hashes here.

File details

Details for the file mooch-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: mooch-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for mooch-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4059b44623beea33d3c6a53174fa8dd834e95c1733f5ed5526d774482b612f07
MD5 4fbcf04aae5a5b78a7a4780ec3999f35
BLAKE2b-256 8672e4b828a35cfdfd296f83ef6b41ea4aaef007386bf06fc70ac350846e40aa

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