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.2.tar.gz
(3.7 kB
view hashes)
Built Distribution
Close
Hashes for callspectpy-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a41823e572d2cb728b10c8f517b699fb77221e9bed19493997d55e2528ffc02 |
|
MD5 | 85b832c19ba0c9656ddca7dbc2e7ea9a |
|
BLAKE2b-256 | 94acd87892376f8f94096c6fef1173811720da5ffdc76d9dbd705c2c5283c308 |