A tracer for compiled objects
Project description
Outliner (Alpha)
Have you ever found an python complex object that you get lost trying to undestand the invoking sequence?! Now it is a solved problem.
Outliner is a Python utility that simplifies the process of tracing the calling flow of callable objects within a complex object. It helps you understand the order in which these callable objects are invoked, making it easier to navigate and comprehend complex code structures.
Table of Contents
Example
We have the given complex object:
class test:
def __init__(self) -> None:
self.func1()
def func1(self):
self.func2()
return
def func2(self):
return
def test2():
a = test()
return
With the outliner you can visualyze the invoking flow in order with the default tree display:
outliner --file_path=path-to-module --object_name=test
test2
│
│──1. __init__
│
│──2. func1
│
│──3. func2
Or get more detailed data about invoked objects (-d="detailed_data"):
outliner --file_path=path-to-module --object_name=test --d="detailed_data"
output:
('test2', {'call': 1, 'return': 1, 'line': 2})
('__init__', {'call': 1, 'return': 1, 'line': 1})
('func1', {'call': 1, 'return': 1, 'line': 2})
('func2', {'call': 1, 'return': 1, 'line': 1})
Features
- Function Tracing: Trace function calls, returns, and line execution within a Python module.
- Data Collection: Collect detailed data on function executions and execution flow.
- Method Tree: Display a tree of methods used by the object for object behavior exploration.
- Easy Integration: Simple and straightforward integration into your Python projects.
- Customizable: Fine-tune tracing parameters to suit your debugging and exploration
Installation
As the library hasn't been released yet, to use it on your machine, you will need to do following steps:
- Use pip install:
Make sure that path contains the setup.py file
pip install -i https://test.pypi.org/simple/ outliner
Usage
The Outliner library can be used via the command line interface (CLI) to trace Python code. Follow the steps below to use it:
-
Open your terminal.
-
Run the following command to trace a Python object's execution:
outliner --file_path=<path-to-object> --object_name=<object-name> --object_args=<arguments-passed-to-object>
Contributing
Contributions to the Outliner library are welcome. If you have ideas for improvements, find any issues, or want to contribute to its development, please open an issue or submit a pull request on GitHub.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file outliner-tracer-1.3.0a1.tar.gz.
File metadata
- Download URL: outliner-tracer-1.3.0a1.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
addb21858593a4391763c80a2eaeae7fa35725e2e6dbee6a13acc6db60eeec76
|
|
| MD5 |
870f07da32a30da9641b800704423b79
|
|
| BLAKE2b-256 |
d1a40eb2947928e54ae33ad804f419e1cbef72a98b767587d6ab05494a75e9fa
|
File details
Details for the file outliner_tracer-1.3.0a1-py3-none-any.whl.
File metadata
- Download URL: outliner_tracer-1.3.0a1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ef33c7ad3dd0e50e0e68cf14676d6ed52994e7e975d5b187385037d5ad68d42
|
|
| MD5 |
7c2b5a2349d054da007c6c9be7912aac
|
|
| BLAKE2b-256 |
8893b157c9822d63d2543b17080e2fdbdf474223dc816b168712dadbcd26e346
|