spoor


Namespoor JSON
Version 0.6.0 PyPI version JSON
download
home_page
SummaryTrack functions invocations
upload_time2023-01-08 18:29:57
maintainer
docs_urlNone
authorMisha Behersky
requires_python>=3.7,<4.0
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## spoor

![Tests](https://github.com/bmwant/spoor/actions/workflows/tests.yml/badge.svg)
[![PyPI](https://img.shields.io/pypi/v/spoor)](https://pypi.org/project/spoor/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/spoor)


[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![EditorConfig](https://img.shields.io/badge/-EditorConfig-grey?logo=editorconfig)](https://editorconfig.org/)
[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](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![Tests](https://github.com/bmwant/spoor/actions/workflows/tests.yml/badge.svg)\n[![PyPI](https://img.shields.io/pypi/v/spoor)](https://pypi.org/project/spoor/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/spoor)\n\n\n[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![EditorConfig](https://img.shields.io/badge/-EditorConfig-grey?logo=editorconfig)](https://editorconfig.org/)\n[![semantic-release: angular](https://img.shields.io/badge/semantic--release-angular-e10079?logo=semantic-release)](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"
}
        
Elapsed time: 0.05355s