Skip to main content

No project description provided

Project description

prettimer

Is a package that gives a timer utility, with prettifiers that prompt a prettified runtime to the standard output.

The prettifiers are decorator functions built upon the Elapsed object, that allow either to assess the runtime of a function without having to explicitly call any magic, or to log a step of a process where the logging.logger is pointing to.

Examples

Can use the the main time handler this way:

>>> from prettimer import Elapsed

>>> et = Elapsed()
>>> # do some process in between
>>> et.stampFromStart() # this returns a string
'Elapsed Time: 1 [mins] 3.785 [secs]'

Otherwise, can use decorator functions:

>>> from prettimer import timeit

>>> @timeit
... def prova():
...     return np.random.randn(100000)
>>> prova()
prova: Elapsed Time: 0.002 [secs]

Full documentation can be found here

Installing prettimer

To install prettimer package, just:

pip install prettimer

Developing prettimer

To install prettimer along with the tools you need to develop and run tests, run the following in your virtual env:

pip install -e .[dev]

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

prettimer-0.0.1.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

prettimer-0.0.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file prettimer-0.0.1.tar.gz.

File metadata

  • Download URL: prettimer-0.0.1.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for prettimer-0.0.1.tar.gz
Algorithm Hash digest
SHA256 2817d6271a4b1627a55bef70a8816afdbf7862c8d3ef93808d059f3db02718b0
MD5 65a043bef38be1fa71c523d5e4015b1e
BLAKE2b-256 a0e944ba6c23fa4f8e604acda2625f432751f0df4506b715cd2adbd2874db8f4

See more details on using hashes here.

File details

Details for the file prettimer-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: prettimer-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2

File hashes

Hashes for prettimer-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 50b3cd614c6b9f31ec8569e4501c5f4ac96046efe20cafd078546a327a832c4e
MD5 33c4261da857301f4c59cf0fd211f861
BLAKE2b-256 c1a76be95eb64acfc82702174c11c84d5df988f6f6c5e54217037dbcfd4abc4d

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