{"id":26447510,"url":"https://github.com/z0u/sparcli","last_synced_at":"2025-03-18T13:57:25.118Z","repository":{"id":57469563,"uuid":"237546536","full_name":"z0u/sparcli","owner":"z0u","description":"Display dynamic metrics as text (sparklines)","archived":false,"fork":false,"pushed_at":"2020-05-17T13:06:37.000Z","size":168,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T09:38:58.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/z0u.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-01T01:49:41.000Z","updated_at":"2020-05-17T13:06:39.000Z","dependencies_parsed_at":"2022-09-19T14:10:20.726Z","dependency_job_id":null,"html_url":"https://github.com/z0u/sparcli","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fsparcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fsparcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fsparcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/z0u%2Fsparcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/z0u","download_url":"https://codeload.github.com/z0u/sparcli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244236086,"owners_count":20420752,"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":[],"created_at":"2025-03-18T13:57:24.438Z","updated_at":"2025-03-18T13:57:25.112Z","avatar_url":"https://github.com/z0u.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sparcli\n\nSparcli is a library for visualising metrics on the command line.\n\nUse this library to see the shape of data during execution of data pipelines, simulators and other long-running programs. Each metric is displayed as a sparkline that updates as the data changes. Sparcli is thread-safe and non-blocking.\n\n[![Build](https://github.com/z0u/sparcli/workflows/Build/badge.svg)](https://github.com/z0u/sparcli/actions?query=workflow%3ABuild)\n[![Publish](https://github.com/z0u/sparcli/workflows/Publish/badge.svg)](https://github.com/z0u/sparcli/actions?query=workflow%3APublish)\n[![Canary build](https://github.com/z0u/sparcli/workflows/Canary%20build/badge.svg)](https://github.com/z0u/sparcli/actions?query=workflow%3A%22Canary+build%22)\n\n\n## Usage\n\nSparcli is [available on PyPI](https://pypi.org/project/sparcli/):\n\n```sh\npip install sparcli\n```\n\nYou can wrap an iterable that produces scalars:\n\n```python\nimport sparcli\n\nfor y in sparcli.gen(ys, name=\"y\"):\n    do_something(y)\n```\n\nYou can publish metrics using a context manager:\n\n```python\nwith sparcli.ctx() as ctx:\n    for a, b in do_something_else():\n        ctx.record(a=a, b=b)\n```\n\nYou can also manage the context manually. Just don't forget to close it:\n\n```python\nclass MyMetricsPlugin:\n    def start(self):\n        self.ctx = sparcli.context()\n\n    def step(self, metrics: Dict[str, Real]):\n        self.ctx.record(**metrics)\n\n    def stop(self):\n        self.ctx.close()\n\nsome_library.register_plugin(MyMetricsPlugin())\n```\n\n\n## Development\n\nFirst install [Python] 3.6+, [Poetry] and Make. Optionally, use [py-make] if you don't have GNU Make. If you have Python and [pipx] installed, you can get started by running:\n\n```sh\npipx install poetry\npipx install py-make\nalias make='pymake'\nmake init\n```\n\nThen run the tests and demo:\n\n```sh\nmake\npoetry run python demo.py\n```\n\n[Python]: https://www.python.org/\n[Poetry]: https://python-poetry.org/\n[py-make]: https://github.com/tqdm/py-make#py-make\n[pipx]: https://github.com/pipxproject/pipx#pipx--install-and-run-python-applications-in-isolated-environments\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz0u%2Fsparcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fz0u%2Fsparcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fz0u%2Fsparcli/lists"}