{"id":25623980,"url":"https://github.com/metricq/metricq-python","last_synced_at":"2025-04-14T07:35:13.786Z","repository":{"id":39627911,"uuid":"256498929","full_name":"metricq/metricq-python","owner":"metricq","description":"🐍 The MetricQ Python interface","archived":false,"fork":false,"pushed_at":"2025-02-12T21:55:20.000Z","size":28976,"stargazers_count":18,"open_issues_count":15,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T21:11:10.447Z","etag":null,"topics":["library","metricq","python"],"latest_commit_sha":null,"homepage":"https://metricq.github.io/metricq-python/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/metricq.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-17T12:37:55.000Z","updated_at":"2024-12-19T10:08:26.000Z","dependencies_parsed_at":"2024-12-03T15:21:31.469Z","dependency_job_id":"82b7a5e5-75ff-4140-9cd2-bfee192f69bb","html_url":"https://github.com/metricq/metricq-python","commit_stats":{"total_commits":807,"total_committers":15,"mean_commits":53.8,"dds":0.6629491945477075,"last_synced_commit":"c91a07639952ef770209f11799283d84d5938356"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metricq%2Fmetricq-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metricq%2Fmetricq-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metricq%2Fmetricq-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/metricq%2Fmetricq-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/metricq","download_url":"https://codeload.github.com/metricq/metricq-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248839898,"owners_count":21169891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["library","metricq","python"],"created_at":"2025-02-22T12:17:17.886Z","updated_at":"2025-04-14T07:35:13.652Z","avatar_url":"https://github.com/metricq.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![BSD 3-clause](https://img.shields.io/badge/license-BSD%203--clause-blue.svg)\n![Python package](https://github.com/metricq/metricq-python/workflows/Python%20package/badge.svg)\n![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)\n[![PyPI](https://img.shields.io/pypi/v/metricq)](https://pypi.org/project/metricq/)\n![PyPI - Wheel](https://img.shields.io/pypi/wheel/metricq)\n[![Docker pulls](https://img.shields.io/docker/pulls/metricq/metricq-python.svg)](https://hub.docker.com/r/metricq/metricq-python)\n[![Documentation](https://img.shields.io/badge/docs-here-informational.svg)](https://metricq.github.io/metricq-python/)\n\n# metricq - python libraries\n\nThis is a python implementation of the MetricQ protocol.\nIt allows you to write Sources and Sinks to easily send and receive data over\nthe MetricQ infrastructure.\n\n## Installation\n\nInstall the package from PyPI:\n\n```sh\n$ pip install metricq\n```\n\n## Examples\n\nThe [`examples`](/tree/master/examples/) directory contains some basic\nexamples.\nTo play around with them, check out a copy of this repository and (in your\nfavourite venv) install their dependencies:\n\n```sh\n$ pip install -e '.[examples]'\n```\n\nA simple Source is implemented in `metricq_source.py`, as is a Sink in `metricq_sink.py`.\nWe will use the former to produce data for a metric called `test.py.dummy`, which we\nwill then receive and print with the latter.\n\nAssuming a MetricQ instance is reachable at `localhost`, configure a\nclient\u003csup\u003e(consult the documentation of your favourite config provider on how\nto do that)\u003c/sup\u003e named `source-py-dummy` to produce values with a frequency of\n0.5Hz (i.e. every 2 seconds) :\n\n```json\n{\n    \"rate\": 0.5\n}\n```\n\nTo start the Source, run:\n\n```sh\n$ ./examples/metricq_source.py --server 'amqp://localhost/' --token 'source-py-dummy'\n```\n\nThis should now send values for the metric `test.py.dummy` in 2-second intervals.\nTo see (in detail) what's going on, add `-v DEBUG` to the arguments above.\n\nOn the other side, run\n\n```sh\n$ ./examples/metricq_sink.py --server 'amqp://localhost/' --metrics 'test.py.dummy'\n```\n\nand you should see new values for the metric `test.py.dummy` appear every 2 seconds.\n\n## Tools and utility scripts\n\nThe repository [metricq/metricq-tools](https://github.com/metricq/metricq-tools)\ncontains a collection of tools and utility scripts to monitor and administrate\na MetricQ network.\nInstall them from [PyPI](https://pypi.org/project/metricq-tools/):\n\n```\n$ pip install metricq-tools\n```\n\n## Development setup\n\nClone the repository, and in a virtual environment run\n\n```sh\n$ pip install -e '.[dev]'\n```\n\nThis will install all tools necessary for testing and linting.\nTo test code manually, run `pytest`.\nFormat code using `black` and `isort`, or lint with `flake8`.\nTo make sure a source distribution (`sdist`) contains the correct files, run `check-manifest`.\nTools are configured in `setup.cfg` respectively `pyproject.toml`.\n\nTo test code in a fresh environment, run the `tox` test harness:\n\n```sh\n$ tox\n```\n\nThis runs the same step as our CI does.\nIf `tox` passes locally there's high chances that CI steps will pass too.\n\nWe recommend to install our [pre-commit](https://pre-commit.com) hooks:\n\n```sh\n$ pre-commit install\n```\n\nThis way commits that fail tests or do not comply with our code style are rejected right away.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetricq%2Fmetricq-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmetricq%2Fmetricq-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmetricq%2Fmetricq-python/lists"}