Skip to main content

Reusable Python Utilities by McCool

Project description

Installation

  • To install from commandline: pip install git+https://github.com/bmccool/pymccool
  • To install via requirements.txt with e.g. specific tag v0.2.0 git+https://github.com/bmccool/pymccool@v0.2.0#egg=pymccool

Usage

  • For basic, no-nonsense console and file logging:

    from pymccool.logging import Logger
    logger = Logger(app_name="<your app name>")
    
  • For more options, use LoggerKwargs

    from pymccool.logging import Logger, LoggerKwargs
    logger = Logger(
            LoggerKwargs(
                app_name="test_logger_loki",
                default_level=Logger.VERBOSE,
                stream_level=Logger.VERBOSE,
                grafana_loki_endpoint="https://loki.end.point.com/loki/api/v1/push")
    )
    
  • To use the Tracer:

    from uuid import uuid1
    from pymccool.tracing import get_tracer, get_decorator
    from pymccool.logging import Logger, LoggerKwargs
    logger = Logger(
            LoggerKwargs(
                app_name="test_logger_loki",
                default_level=Logger.VERBOSE,
                stream_level=Logger.VERBOSE,
                grafana_loki_endpoint="https://loki.end.point.com/loki/api/v1/push")
    )
    tracer = get_tracer(service_name="test_tracer",
                        endpoint="https://otel-rec.end.point.com/v1/traces",
                        uuid=UUID)
    instrument_decorator = get_decorator(e2e_tracer)
    

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

pymccool-0.3.3.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

pymccool-0.3.3-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pymccool-0.3.3.tar.gz.

File metadata

  • Download URL: pymccool-0.3.3.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pymccool-0.3.3.tar.gz
Algorithm Hash digest
SHA256 d36a6f5d12a16a99dee0b240a7879a3f165e34a7d54fa2cc40515049a11c2566
MD5 0afc5523fa2965cd634ab1bb75c2e6b0
BLAKE2b-256 e6fb160a6e2953a6841087e8af385a0834abc5503ba258d9d737af05b634e551

See more details on using hashes here.

File details

Details for the file pymccool-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: pymccool-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pymccool-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cdaaa23fcb371304af29d360b23ecaae5e0e534b0a2ed9bf2b5285c6a3fa36d5
MD5 0f358c8f4c89b18735187d76b416beaf
BLAKE2b-256 9c1307ff89baa508110fc82330092562a2525d11e05c6e6ccf08e4f38871f120

See more details on using hashes here.

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