Name | spoor JSON |
Version |
0.6.0
JSON |
| download |
home_page | |
Summary | Track functions invocations |
upload_time | 2023-01-08 18:29:57 |
maintainer | |
docs_url | None |
author | Misha Behersky |
requires_python | >=3.7,<4.0 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
## spoor

[](https://pypi.org/project/spoor/)

[](https://github.com/pre-commit/pre-commit)
[](https://github.com/psf/black)
[](https://editorconfig.org/)
[](https://github.com/semantic-release/semantic-release)
Track invocation of your functions and methods; display collected statistics for the invocations; export data gathered to external services.
```bash
$ pip install spoor
```
### Usage
```python
from spoor import Spoor
s = Spoor()
@s.track
def func(a: int, b: int) -> int:
return a + b
func(5, 10)
func(23, 42)
assert s.called(func)
assert s.call_count(func) == 2
```
### Configuration
| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `attach` | `bool` | `False` | Expose `called`/`call_count` attributes directly on a function/method object. |
|`distinct_instances` | `bool` | `False` | Separate metrics collection for each instance of a class. Has no effect if tracking only functions. |
|`skip_dunder` | `bool` | `True` | Do not track double underscore method calls (like `__str__`) for class instances. Has no effect if tracking only functions. |
| `disabled` | `bool` | `False` | Initialize as inactive and ignore metrics collection until enabled explicitly. Can be controlled via `enable()`/`disable()` methods later. |
### Exporters
* [statsd](#)
* [DataDog](#)
### See also
* π [podmena](https://github.com/bmwant/podmena) for nice commits emoji
* π [rich](https://github.com/Textualize/rich) for beautiful terminal output
* πΊπ¦ [United 24](https://u24.gov.ua/) to support Ukraine in the war
Raw data
{
"_id": null,
"home_page": "",
"name": "spoor",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Misha Behersky",
"author_email": "bmwant@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/73/09/1106a274ef9b74f296e18df1dd1eae0e4ec1d0620b5ed583b10d0995fb62/spoor-0.6.0.tar.gz",
"platform": null,
"description": "## spoor\n\n\n[](https://pypi.org/project/spoor/)\n\n\n\n[](https://github.com/pre-commit/pre-commit)\n[](https://github.com/psf/black)\n[](https://editorconfig.org/)\n[](https://github.com/semantic-release/semantic-release)\n\n\nTrack invocation of your functions and methods; display collected statistics for the invocations; export data gathered to external services.\n\n```bash\n$ pip install spoor\n```\n\n### Usage\n\n```python\nfrom spoor import Spoor\n\ns = Spoor()\n\n@s.track\ndef func(a: int, b: int) -> int:\n return a + b\n\nfunc(5, 10)\nfunc(23, 42)\n\nassert s.called(func)\nassert s.call_count(func) == 2\n```\n\n### Configuration\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `attach` | `bool` | `False` | Expose `called`/`call_count` attributes directly on a function/method object. |\n|`distinct_instances` | `bool` | `False` | Separate metrics collection for each instance of a class. Has no effect if tracking only functions. |\n|`skip_dunder` | `bool` | `True` | Do not track double underscore method calls (like `__str__`) for class instances. Has no effect if tracking only functions. |\n| `disabled` | `bool` | `False` | Initialize as inactive and ignore metrics collection until enabled explicitly. Can be controlled via `enable()`/`disable()` methods later. |\n\n\n### Exporters\n\n* [statsd](#)\n* [DataDog](#)\n\n### See also\n\n* \ud83c\udf52 [podmena](https://github.com/bmwant/podmena) for nice commits emoji\n* \ud83c\udf08 [rich](https://github.com/Textualize/rich) for beautiful terminal output\n* \ud83c\uddfa\ud83c\udde6 [United 24](https://u24.gov.ua/) to support Ukraine in the war\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Track functions invocations",
"version": "0.6.0",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e6757231818c5d744ce1b0ea4fd15c6a4c297f1f8cc7d49076cae1e40978a6cd",
"md5": "3fd93b514518c5099927398c663da322",
"sha256": "c89f279748bbf5d8d01b71b676ad88c364bfbfcab0d3bf845b14816da3355bb4"
},
"downloads": -1,
"filename": "spoor-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3fd93b514518c5099927398c663da322",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 7499,
"upload_time": "2023-01-08T18:29:56",
"upload_time_iso_8601": "2023-01-08T18:29:56.827985Z",
"url": "https://files.pythonhosted.org/packages/e6/75/7231818c5d744ce1b0ea4fd15c6a4c297f1f8cc7d49076cae1e40978a6cd/spoor-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "73091106a274ef9b74f296e18df1dd1eae0e4ec1d0620b5ed583b10d0995fb62",
"md5": "711928183217a6faa0d41c6a0bc8cbd4",
"sha256": "acafc417cae0b7fb21a9b6e272fe367dce1296d450ed222009a1630d47f08459"
},
"downloads": -1,
"filename": "spoor-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "711928183217a6faa0d41c6a0bc8cbd4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 7343,
"upload_time": "2023-01-08T18:29:57",
"upload_time_iso_8601": "2023-01-08T18:29:57.854748Z",
"url": "https://files.pythonhosted.org/packages/73/09/1106a274ef9b74f296e18df1dd1eae0e4ec1d0620b5ed583b10d0995fb62/spoor-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-08 18:29:57",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "spoor"
}