{"id":18918552,"url":"https://github.com/daxartio/kontext","last_synced_at":"2026-02-02T10:32:09.193Z","repository":{"id":187053088,"uuid":"635761160","full_name":"daxartio/kontext","owner":"daxartio","description":"Easy contextual information logging","archived":false,"fork":false,"pushed_at":"2025-08-27T13:29:06.000Z","size":75,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-31T00:32:50.685Z","etag":null,"topics":["context-logging","contextvars","logging","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daxartio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-03T12:00:59.000Z","updated_at":"2025-08-27T13:29:03.000Z","dependencies_parsed_at":"2024-04-03T09:50:11.931Z","dependency_job_id":"09b221af-d62f-4bf4-89ab-746cee6a9d3b","html_url":"https://github.com/daxartio/kontext","commit_stats":null,"previous_names":["daxartio/ctx","daxartio/kontext"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/daxartio/kontext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daxartio%2Fkontext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daxartio%2Fkontext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daxartio%2Fkontext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daxartio%2Fkontext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daxartio","download_url":"https://codeload.github.com/daxartio/kontext/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daxartio%2Fkontext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29010254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T08:40:12.472Z","status":"ssl_error","status_checked_at":"2026-02-02T08:40:10.926Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["context-logging","contextvars","logging","python"],"created_at":"2024-11-08T10:32:28.731Z","updated_at":"2026-02-02T10:32:09.173Z","avatar_url":"https://github.com/daxartio.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python Context Information\n\n[![PyPI](https://img.shields.io/pypi/v/kontext)](https://pypi.org/project/kontext/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kontext)](https://www.python.org/downloads/)\n[![GitHub last commit](https://img.shields.io/github/last-commit/daxartio/kontext)](https://github.com/daxartio/kontext)\n[![GitHub stars](https://img.shields.io/github/stars/daxartio/kontext?style=social)](https://github.com/daxartio/kontext)\n\nThe plugin allows to transfer a context between functions. Inspired by [context-logging](https://github.com/Afonasev/context_logging).\n\nYou can use it for logging data which does not change and can be correlated, e.g. `trace_id`, `correlation_id` etc.\n\n## Features\n\n- Thread-safe context management\n- Customizable log records\n- Easy-to-use API\n\n## Installation\n\n```\npip install kontext\n```\n\n## Usage\n\n```python\nimport logging\n\nfrom kontext import Context, current_context, setup_log_record\n\nlogging.basicConfig(format=\"%(message)s %(kontext)s\", level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\n\ndef bar():\n    current_context[\"foo\"] = \"bar\"\n    logger.info(\"bar\")\n\n\n@Context()\ndef foo():\n    current_context[\"key\"] = \"value\"\n    logger.info(\"foo\")\n    bar()\n\n\nsetup_log_record()\nfoo()\nlogger.info(\"Finish\")\n# foo {'key': 'value'}\n# bar {'key': 'value', 'foo': 'bar'}\n# Finish {}\n\n```\n\nFor more examples, please refer to the examples directory.\n\n## License\n\n* [MIT LICENSE](LICENSE)\n\n## Contribution\n\n[Contribution guidelines for this project](CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaxartio%2Fkontext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaxartio%2Fkontext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaxartio%2Fkontext/lists"}