Skip to main content

Easy and simple profiller for Python

Project description

Peasy Profiller

This is a simple and easy-to-use profiller for Python applications that will generate CSV files that indicate the amount of time your application spent in different contexts

Quickstart

To install, run

pip install --upgrade pip
pip install peasyprofiller

To use it in a program, import it, call the start function at the start of the section you want to profile and stop at the end of that section. Time of sections with the same context will be added.

To save the data collected, call the save_csv function with the desired save path. You can also call the plot function to create a graph of the relative time spent in each section

from peasyprofiller.profiller import profiller as pprof

pprof.start("Name of my activity")

# Some processing happens here

pprof.stop("Name of my activity")
pprof.save_csv("path/to/save")
pprof.plot("path/to/save")

Example

You can run the example at peasyprofiller/tests/fibonacci.py with the following command:

python -m peasyprofiller.tests.fibonacci <N> <SAVE_PATH>

The generated CSV should look like this:

Profiller,Fibonacci
6.87e-05,6.7745289

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

peasyprofiller-0.2.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

peasyprofiller-0.2.0-py2.py3-none-any.whl (4.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file peasyprofiller-0.2.0.tar.gz.

File metadata

  • Download URL: peasyprofiller-0.2.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for peasyprofiller-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3ce657fb0de40527408b0634665e2b70c0b8f63010d015cfb4e708fab58f5688
MD5 302be7e4235a8050dc43f9b374fc4713
BLAKE2b-256 e5a625d8c6f21f3a778dd43dede4765ca57445eed0ecec1244fe8a302a6446fb

See more details on using hashes here.

Provenance

File details

Details for the file peasyprofiller-0.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for peasyprofiller-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8369cdd33dc0707864bb50ca3f86154d32cf290546f032834593d0aaed8c851c
MD5 fb07ae58a7f5498a5ba2e8f017a51f33
BLAKE2b-256 0948e58bc3b8b77a79b874256d0a282b7865d2435001ba1d5959acf5cd1047bd

See more details on using hashes here.

Provenance

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