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

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

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.1.tar.gz (6.5 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.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

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

Hashes for mooch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 9549aae0e20c13a07551364ea3230948fe07f4ddc7879aa744dd68bd43b44cbc
MD5 bfde0464414fc4ad70261fb339d7305f
BLAKE2b-256 1badf2717c2a95deae1eb0407cff04ae3a0bfffaa3bacdf048b180fac03e3b94

See more details on using hashes here.

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

Hashes for mooch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f6b3bccfee37b0aae210b3a0fa90884c7a112ee0c69dc8cecc0ed3109c7e430f
MD5 416bf0824704dcb5fee2add92033a5bf
BLAKE2b-256 2c469634410ede67ada2c20b1957f5e0fb4d0055e3570513751c4754ca3f1157

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