Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Chronologger

Time utilities for Python1

Build Status Coverage Status

Requirements

Requirements: Python >= 3.6

Use the Makefile targets to access most of the functionality: make install-dev, make dbuild, make drun, make dstart...

Otherwise...

Install

pip install git+https://git@github.com/francisco-perez-sorrosal/chronologger.git

Run the Simple Example

Docker

Clone the project...

git clone git@github.com:francisco-perez-sorrosal/chronologger.git

and then...

cd chronologger
docker build -f Dockerfile.example -t chronologger-example .
docker run -itd --name chronologger-example chronologger-example:latest
docker exec -it chronologger-example python simple_example.py 

Local

After installing the package, just clone the project and execute example with:

git clone git@github.com:francisco-perez-sorrosal/chronologger.git ; cd chronologger
python examples/simple_example.py

or open your python environment/IDE and execute:

import time

from chronologger import Timer, TimeUnit, root_timer


# Example of decorator: This should report ~100ms each time that is called
@Timer(name="Foo method!", unit=TimeUnit.ms, simple_log=True)
def foo():
    time.sleep(0.1)


def main():
    # Example of explicit timer: This should report ~100ms
    timer = Timer("Individual Timer", unit=TimeUnit.ms).start()
    time.sleep(0.1)
    timer.stop()

    # Example of explicit context timer: This should report ~1s
    with Timer(name="Test Loop!", unit=TimeUnit.s, simple_log=True) as timer:
        for i in range(5):
            time.sleep(0.1)  # e.g. simulate IO
            foo()
            timer.mark("i_{}".format(i))


if __name__ == "__main__":
    root_timer.label("   STARTING!!!")
    main()
    root_timer.label("   PRINTING TIME")
    root_timer.print()

Development

Install:

make install-dev

Use other commands in the Makefile for extra functionality.

Docker

make dbuild
make drun
make dtests

Use other commands in the Makefile for extra functionality.

IDE (PyCharm) Docker Interpreter

Once you create the Docker image with make dbuild you can specify the chronologger-dev:latest image as a Ptyhon Docker interpreter in IntelliJ/PyCharm for example.


1: Inspired by the blog post Python Timer Functions: Three Ways to Monitor Your Code by Geir Arne Hjelle

Metadata

Release files for chronologger 0.0.0.dev23

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chronologger 0.0.0.dev23
File Size Uploaded Provenance Actions
chronologger-0.0.0.dev23.tar.gz 12.0 kB Without provenance Details for chronologger-0.0.0.dev23.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chronologger 0.0.0.dev23
File Interpreter ABI Platform Actions
chronologger-0.0.0.dev23-py3-none-any.whl Python 3 none any Details for chronologger-0.0.0.dev23-py3-none-any.whl

Total release size: 25.5 kB

Release files / chronologger-0.0.0.dev23.tar.gz

Download URL chronologger-0.0.0.dev23.tar.gz
Size 12.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6b026a193089521e68b057f04cde71597d3cfcf83142d1a7d7dabb5d9d3ba196
BLAKE2b-256 checksum
How to use checksums
2d36c463baca5f63e559bf2622f3e8bbcbef53767913327c2ccbf6e7e9f3b2bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0

Release files / chronologger-0.0.0.dev23-py3-none-any.whl

Download URL chronologger-0.0.0.dev23-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
886d8c44aaf710cd9c718772a7cce780bb3d93f5528df4607df9a61e4e559b37
BLAKE2b-256 checksum
How to use checksums
f7b875273115327dc03bc492fd1e96ee357e04bd6a1d9dd68f715bb57da67565
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.0

Security for chronologger 0.0.0.dev23

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page