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 | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyprofyler-1.0.4.tar.gz
(3.0 kB
view details)
Built Distribution
File details
Details for the file pyprofyler-1.0.4.tar.gz
.
File metadata
- Download URL: pyprofyler-1.0.4.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2263b3252ce92d48635e3e830388bf041390d9917b7a1ae1647a0a81b00cfce |
|
MD5 | 1eec8ff6ff2a72f009c59020d73c4aab |
|
BLAKE2b-256 | 5ac1c4b192ec198c749bb1c8be00e8407993d19283f73004a80155fc1b483afe |
File details
Details for the file pyprofyler-1.0.4-py3-none-any.whl
.
File metadata
- Download URL: pyprofyler-1.0.4-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | faef36ec0f82b876f18d980395030bd5b21626fb68514848bd33d55c90c62fb8 |
|
MD5 | ea40a352e77f1f30c0c2d1eb153eb2d6 |
|
BLAKE2b-256 | 39007b29268ba1a4d1e491bd10186a87fb0319e1dae528790a8db7a37a454e9d |