Collects execution data from python script
Project description
# callspectpy
Collects execution data from python script
## CLI
```bash
$ callspectpy -i my-script.py
```
## API
To collect data for specific code, just wrap the code like this:
```python
import callspectpy, os
callspectpy.trace2file_start(
os.path.join(os.path.dirname(os.path.realpath(__file__)), 'callspect.txt')
)
#
# YOUR CODE HERE
#
callspectpy.trace2file_stop()
```
Or better, use context manager:
```python
from callspect.py import trace2file
with trace2file('output.txt'):
# YOUR CODE HERE
```
### TODO:
* exec(code_obj) generates odd "<module>", replace it with name user passes
* when runnnig "from my_package.lib import my_fn", module is equal "lib" :(
Collects execution data from python script
## CLI
```bash
$ callspectpy -i my-script.py
```
## API
To collect data for specific code, just wrap the code like this:
```python
import callspectpy, os
callspectpy.trace2file_start(
os.path.join(os.path.dirname(os.path.realpath(__file__)), 'callspect.txt')
)
#
# YOUR CODE HERE
#
callspectpy.trace2file_stop()
```
Or better, use context manager:
```python
from callspect.py import trace2file
with trace2file('output.txt'):
# YOUR CODE HERE
```
### TODO:
* exec(code_obj) generates odd "<module>", replace it with name user passes
* when runnnig "from my_package.lib import my_fn", module is equal "lib" :(
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
callspectpy-0.1.0.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for callspectpy-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff241e3f2a45749ce8e1976f08cb5bc8630703f0b3737943baae8f97ce539aa |
|
MD5 | 7febe14c99f4d3abb8519df26873b03c |
|
BLAKE2b-256 | d31e04d632e003c6613a62b5fc664cb6a202a5595c6f0c5407afbe44541a306b |