Name | tracethat JSON |
Version |
1.0.3
JSON |
| download |
home_page | None |
Summary | tracethat.dev reporter for Python |
upload_time | 2024-09-22 11:02:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.6 |
license | The MIT License (MIT) Copyright (c) 2024 Kacper Pietrzak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
tracing
logging
debugging
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
## Installation
```bash
pip install tracethat
```
## Example
```python
from tracethat import tracethat, register_token
register_token('your_token')
@tracethat
async def hello(name: str) -> str:
await asyncio.sleep(1)
return f'Hello, {name}!'
async def main():
await hello(name='John')
if __name__ == '__main__':
asyncio.run(main())
```
## Reference
### tracethat
`tracethat` is a decorator that wraps a function and logs its execution. It takes a function as an argument and returns a wrapped function. It accepts both sync and async functions.
```python
@tracethat
def hello(name: str) -> str:
return f'Hello, {name}!'
```
### tracethat.log
`tracethat.log` is a function that logs a message. It accepts a string as an argument and an optional payload.
```python
tracethat.log('hello', {'name': 'John'})
```
### register_token
You will need to register your token before using the reporter. You can do this by calling the `register_token` function and passing your token as an argument.
```python
from tracethat import register_token
register_token('your_token')
```
or by setting the `TT_TOKEN` environment variable.
```bash
TT_TOKEN=your_token python3 main.py
```
Raw data
{
"_id": null,
"home_page": null,
"name": "tracethat",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": "tracing, logging, debugging",
"author": null,
"author_email": "Kacper Pietrzak <kacpietrzak@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/93/d7/420d2c077bd790c7dcc1c6d1cacb7c4a75bf6aaf8ae5dd134bbeb6938efd/tracethat-1.0.3.tar.gz",
"platform": null,
"description": "## Installation\n\n```bash\npip install tracethat\n```\n\n## Example\n\n```python\nfrom tracethat import tracethat, register_token\n\nregister_token('your_token')\n\n@tracethat\nasync def hello(name: str) -> str:\n await asyncio.sleep(1)\n return f'Hello, {name}!'\n\nasync def main():\n await hello(name='John')\n\nif __name__ == '__main__':\n asyncio.run(main())\n```\n\n## Reference\n\n### tracethat\n\n`tracethat` is a decorator that wraps a function and logs its execution. It takes a function as an argument and returns a wrapped function. It accepts both sync and async functions.\n\n```python\n@tracethat\ndef hello(name: str) -> str:\n return f'Hello, {name}!'\n```\n\n### tracethat.log\n\n`tracethat.log` is a function that logs a message. It accepts a string as an argument and an optional payload.\n\n```python\ntracethat.log('hello', {'name': 'John'})\n```\n\n### register_token\n\nYou will need to register your token before using the reporter. You can do this by calling the `register_token` function and passing your token as an argument.\n\n```python\nfrom tracethat import register_token\n\nregister_token('your_token')\n```\n\nor by setting the `TT_TOKEN` environment variable.\n\n```bash\nTT_TOKEN=your_token python3 main.py\n```\n",
"bugtrack_url": null,
"license": "The MIT License (MIT) Copyright (c) 2024 Kacper Pietrzak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "tracethat.dev reporter for Python",
"version": "1.0.3",
"project_urls": {
"Homepage": "https://tracethat.dev",
"Repository": "https://github.com/yourusername/tracethat"
},
"split_keywords": [
"tracing",
" logging",
" debugging"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "0f2f05acf6a61366e4ba8523a24f553a4e7360cd1e2cbb277bb46429411166f8",
"md5": "fe008f68b763a8b643565ebffb99af57",
"sha256": "745e3af5a11ffb4f0723bab7796848af83b3b645dec715631c9b4a37fdf33126"
},
"downloads": -1,
"filename": "tracethat-1.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fe008f68b763a8b643565ebffb99af57",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 9680,
"upload_time": "2024-09-22T11:02:04",
"upload_time_iso_8601": "2024-09-22T11:02:04.711368Z",
"url": "https://files.pythonhosted.org/packages/0f/2f/05acf6a61366e4ba8523a24f553a4e7360cd1e2cbb277bb46429411166f8/tracethat-1.0.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "93d7420d2c077bd790c7dcc1c6d1cacb7c4a75bf6aaf8ae5dd134bbeb6938efd",
"md5": "60377e6c436c0c66aef8712ff3345227",
"sha256": "c119a0a3fb315d3659f8beba6014bb0e65180b60896cd2af23fa251cd556e287"
},
"downloads": -1,
"filename": "tracethat-1.0.3.tar.gz",
"has_sig": false,
"md5_digest": "60377e6c436c0c66aef8712ff3345227",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 7900,
"upload_time": "2024-09-22T11:02:06",
"upload_time_iso_8601": "2024-09-22T11:02:06.143360Z",
"url": "https://files.pythonhosted.org/packages/93/d7/420d2c077bd790c7dcc1c6d1cacb7c4a75bf6aaf8ae5dd134bbeb6938efd/tracethat-1.0.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-22 11:02:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yourusername",
"github_project": "tracethat",
"github_not_found": true,
"lcname": "tracethat"
}