Outliner
Have you ever got confused trying to undestand python complex object invoking sequence?! Now it is a solved problem.
Outliner is a Python utility designed to simplify the process of tracing the calling flow of callable objects within a complex Python object. It aims to help developers understand the order in which callable objects are invoked within complex code structures, making it easier to navigate and comprehend such 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 visualize the invoking flow in order with the default tree display:
outliner --file_path=path-to-module --object_name=test
output:
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 functions 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 these steps to use it:
-
Open your terminal.
-
Run the following command to trace a Python object's execution:
bashCopy code
outliner --file_path=<path-to-object> --object_name=<object-name> --object_args=<arguments-passed-to-object>
Command Line Options
-
--file_path: Specifies the path to the Python module containing the object to be traced. -
--object_name: Specifies the name of the object to be traced. -
--object_args: Optionally, you can specify arguments to pass to the object. -
--display: Optionally, you can choose the output type(tree or detaield_data)
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.
Metadata
Release files for outliner-tracer 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| outliner-tracer-1.0.0.tar.gz | 6.8 kB | Without provenance | Details for outliner-tracer-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| outliner_tracer-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for outliner_tracer-1.0.0-py3-none-any.whl |
Total release size: 13.3 kB
Release files / outliner-tracer-1.0.0.tar.gz
| Download URL | outliner-tracer-1.0.0.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
edc4665ea15e4c12c2d6805422223b3fbb39993ed310df72c7e6209d456832cd
|
|
BLAKE2b-256 checksum How to use checksums |
8db892fb4ac5923d93d4da03cc05a2e10376e783b91682a7e2ab17152c7e2675
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / outliner_tracer-1.0.0-py3-none-any.whl
| Download URL | outliner_tracer-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ac00dbe1418e961bdd06bd497c58b9c779c3b6d730b2bbcd9749a1e4744a93b
|
|
BLAKE2b-256 checksum How to use checksums |
7164d1c6c251c0b3833f20cf24e895a6e915c8c16003f67a5bede2446695983a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for outliner-tracer 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.