Skip to main content

Reusable essentials to be used across Python projects.

Project description

Python Essentials

This project has reusable essentials for python projects, such as:

  • Logger (enhanced with rich logging)
  • Non-blocking hotkey monitoring via pynput (e.g. enable debug logging on the fly)

Example Usage

from essentialsx import Essentials


def foo():
    print('bar')


if __name__ == '__main__':
    essentials = Essentials()

    # Create a logger easily
    log = essentials.get_logger()

    # Or create a logger with a logfile
    log = essentials.get_logger(logfile='/tmp/mylogfile.log')

    # Register custom hotkeys
    essentials.register_hotkeys({'<ctrl>+<alt>+c': foo})

    # Get all registered hotkeys
    print(essentials.get_hotkeys())

    # Enable hotkey monitoring
    essentials.enable_hotkeys()

    # Disable hotkey monitoring
    essentials.disable_hotkeys()

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

essentialsx-0.0.1.tar.gz (3.0 kB view hashes)

Uploaded Source

Built Distribution

essentialsx-0.0.1-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page