Skip to main content

Python Profiler

Project description

CircleCI Coverage


Code Bio

The bio package provides utilities for profiling python code.


Installation

pip install bio

Decorator

import bio

@bio.profile()
def my_functon():
    # Do stuff here

Using the @bio.profile() decorator with no arguments will simply print the output to stdout. Alternatively, you can provide the file location for the profiler output.

@bio.profile("/path/to/file.prof")
def my_functon():
    # Do stuff here

In the example shown above, the output will be written to both stdout and the given file location. If you would prefer not to write to stdout you can use the quiet=True option.

@bio.profile("/path/to/file.prof", quiet=True)
def my_functon():
    # Do stuff here

Context Manager

import bio

with bio.profiler("/path/to/file.prof"):
    # Do stuff here

Developers

Testing

Bio uses tox for testing. To run the tests, simply do:

tox

The configuration for tox can be found in the tox.ini file. Bio uses pytest as the preferred testing framework. Prior to running the tests, tox will execute an auto-formatting tool called black. After the tests have completed, tox will create the coverage badge (shown at the top of this page) using the coverage_badge tool.

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for bio, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size bio-0.1.0-py2.py3-none-any.whl (3.8 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size bio-0.1.0.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page