{"id":13756926,"url":"https://github.com/paksu/pytelegraf","last_synced_at":"2026-02-11T14:36:27.463Z","repository":{"id":37431831,"uuid":"61475730","full_name":"paksu/pytelegraf","owner":"paksu","description":"Python client for sending metrics to Telegraf","archived":false,"fork":false,"pushed_at":"2020-11-02T06:00:46.000Z","size":33,"stargazers_count":86,"open_issues_count":8,"forks_count":24,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-14T06:13:09.454Z","etag":null,"topics":["influxdb","python","telegraf"],"latest_commit_sha":null,"homepage":null,"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/paksu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-19T10:48:41.000Z","updated_at":"2025-04-30T18:51:15.000Z","dependencies_parsed_at":"2022-08-19T20:50:08.406Z","dependency_job_id":null,"html_url":"https://github.com/paksu/pytelegraf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paksu/pytelegraf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paksu%2Fpytelegraf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paksu%2Fpytelegraf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paksu%2Fpytelegraf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paksu%2Fpytelegraf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paksu","download_url":"https://codeload.github.com/paksu/pytelegraf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paksu%2Fpytelegraf/sbom","scorecard":{"id":718099,"data":{"date":"2025-08-11","repo":{"name":"github.com/paksu/pytelegraf","commit":"a5a326bd99902768be2bf10da7dde2dfa165c013"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":3,"reason":"Found 7/19 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T10:20:35.722Z","repository_id":37431831,"created_at":"2025-08-22T10:20:35.722Z","updated_at":"2025-08-22T10:20:35.722Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29335275,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T14:34:07.188Z","status":"ssl_error","status_checked_at":"2026-02-11T14:34:06.809Z","response_time":97,"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":["influxdb","python","telegraf"],"created_at":"2024-08-03T11:00:57.995Z","updated_at":"2026-02-11T14:36:27.444Z","avatar_url":"https://github.com/paksu.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Pytelegraf\n\u003e Python client for sending metrics to Telegraf inspired by pystatsd\n\n[![Build Status](https://travis-ci.org/paksu/pytelegraf.svg?branch=master)](https://travis-ci.org/paksu/pytelegraf)\n\nDesigned to work with Telegraf UDP listener input plugin.\nhttps://github.com/influxdata/telegraf/tree/master/plugins/inputs/udp_listener\n\nPytelegraf supports and is tested to function with Telegraf version **0.13** and newer. It may work with older versions too but that is untested.\n\nPytelegraf outputs InfluxDB line protocol https://docs.influxdata.com/influxdb/v0.13/write_protocols/line/\n\n---\n### Contacting\nNeed answers? Join pytelegraf on Gitter\n[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/pytelegraf/Lobby?utm_source=share-link\u0026utm_medium=link\u0026utm_campaign=share-link)\n\n\nIf you find this library useful please let me know https://twitter.com/joonapaak\n\nIf you have an idea how this library can be improved then open an issue or even better send a pull request :)\n\n### How to install\n```pip install pytelegraf```\n\n### Usage\n\n```\nfrom telegraf.client import TelegrafClient\nclient = TelegrafClient(host='localhost', port=8092)\n\n# Records a single value with no tags\nclient.metric('some_metric', 123)\n\n# Records a three values with different data types\nclient.metric('some_metric', {'value_a': 100, 'value_b': 100, 'value_c': True})\n\n# Records a single value with one tag\nclient.metric('some_metric', 123, tags={'server_name': 'my-server'})\n```\n\n#### Global tags\nThe client can be initialized with global tags that will be sent with every metric implicitly\n\nThis is useful for adding tagging metrics by host or app\n```\nclient = TelegrafClient(host='localhost', port=8092, tags={'host': 'my-host-001'})\n\n# Records a single value\nclient.metric('some_metric', 123)\n```\n\nBecause client was initialized with tags the metric contains them too so the line that was sent to Telegraf looks like this\n```\nsome_metric,host=my-host-001 value=123i\n```\n\nGlobal tags can be overridden by defining them when sending a metric\n```\n# Records a single value with host tag\nclient.metric('some_metric', 123, tags={'host':'another-host-001', 'some_tag':'some_value'})\n```\n\nWill send the following line\n```\nsome_metric,host=another-host-001,some_tag=some_value value=123i\n```\n\n### HTTP Client\nThe default `TelegrafClient` uses UDP to send metrics to Telegraf. The `HttpClient` works similarly, except that it issues requests via an HTTP POST. HTTP introduces non-trivial overhead, so to avoid blocking the main thread, these POSTs are issued in the background.\n\nTo use the `HttpClient`, `pytelegraf` must be installed like this: `pip install pytelegraf[http]`. Alternatively, add `pytelegraf[http]` to `requirements.txt`.\n\n```\nfrom telegraf import HttpClient\n\nhttp_client = HttpClient(host='localhost', port=8186)\nhttp_client.metric('some_metric', 123, tags={'server_name': 'my-server'})\n```\n\n### Telegraf configuration for versions 1.3 and higher\nJust follow the sample configuration https://github.com/influxdata/telegraf/tree/master/plugins/inputs/socket_listener\n\n```\n[[inputs.socket_listener]]\n  service_address = \"udp://localhost:8092\"\n  data_format = \"influx\"\n```\n\n### Telegraf configuration for versions lower than 1.3\nJust follow the sample configuration https://github.com/influxdata/telegraf/blob/b59266249dbeff43ba21bfd3dcc854b12eefd9ca/plugins/inputs/udp_listener/README.md\n\n```\n[[inputs.udp_listener]]\n  service_address = \"localhost:8092\"\n  allowed_pending_messages = 10000\n  data_format = \"influx\"\n```\n\n\n### Using with Django\n\nDefine configuration in Django settings\n```\nTELEGRAF_HOST = 'localhost'\nTELEGRAF_PORT = 8092\nTELEGRAF_TAGS = {'some-global-tag': 'some-value'}\n```\n\nThen use the client in code\n```\nfrom telegraf.defaults.django import telegraf\n\ntelegraf.metric('some-metric', 1)\n```\n\n### How to develop\n\n- Clone or fork this repo\n- Make changes\n- Run tests with `python setup.py test`\n- Submit a pull request\n\n### Contributors\n- bobo333\n- sbi\n- isvinogradov\n- umax\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaksu%2Fpytelegraf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaksu%2Fpytelegraf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaksu%2Fpytelegraf/lists"}