Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

a simple memory profiler for python programs.

Project description

PyProfyler

a simple memory profiler for python programs.

Installation:

sudo pip3 install git+https://github.com/AlyShmahell/PyProfyler

or

sudo pip3 install pyprofyler

Example:

from pyprofyler import PyProfyler

def wrapped_function():
    array = []
    for i in range(1,1000000):
        array.append(i)
    return array

@PyProfyler
def decorated_function():
    a_list = []
    for i in range(1,1000000):
        a_list.append(i)
    return a_list

if __name__ == '__main__':
    ##############################################
    #    Profiling a function by wrapping it     #
    ##############################################
    wrapped_profile = PyProfyler(wrapped_function)
    # "Not Profiled Yet" Message
    print(wrapped_profile)
    result = wrapped_profile()
    # Profile Message, through __str__
    print(wrapped_profile)
    # Function Execution Result
    print(f"execution result: {result[10]}")
    # Profile Message, through __getitem__
    print(wrapped_profile['profile'])
    ##############################################
    #      Profiling a decorated function        #
    ##############################################
    # "Not Profiled Yet" Message
    print(decorated_function)
    result = decorated_function()
    # Profile Message, through __str__
    print(decorated_function)
    # Function Execution Result
    print(f"execution result: {result[10]}")
    # Profile Message, through __getitem__
    print(decorated_function['profile'])

Project details


Release history Release notifications

This version

1.0.4

Download files

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

Files for pyprofyler, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size pyprofyler-1.0.4-py3-none-any.whl (3.9 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pyprofyler-1.0.4.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page