{"id":13599244,"url":"https://github.com/SOF3/lpl","last_synced_at":"2025-04-10T12:31:51.030Z","repository":{"id":204162851,"uuid":"711241747","full_name":"SOF3/lpl","owner":"SOF3","description":"Command-line plotting from streaming input sources","archived":false,"fork":false,"pushed_at":"2024-10-02T18:49:46.000Z","size":492,"stargazers_count":39,"open_issues_count":5,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-03T12:35:25.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SOF3.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2023-10-28T16:29:52.000Z","updated_at":"2024-09-30T11:56:00.000Z","dependencies_parsed_at":"2023-11-01T06:22:47.158Z","dependency_job_id":"c29e8f72-be52-4685-90ad-47b07bd3217e","html_url":"https://github.com/SOF3/lpl","commit_stats":null,"previous_names":["sof3/lpl"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOF3%2Flpl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOF3%2Flpl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOF3%2Flpl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SOF3%2Flpl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SOF3","download_url":"https://codeload.github.com/SOF3/lpl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248217131,"owners_count":21066633,"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":"2024-08-01T17:01:01.305Z","updated_at":"2025-04-10T12:31:50.996Z","avatar_url":"https://github.com/SOF3.png","language":"Rust","funding_links":[],"categories":["💻 Apps"],"sub_categories":["🌌 Other"],"readme":"# lpl\n\nA command-line utility to plot charts from line-based inputs.\n\n[![Sinusoidal plot example](https://sof3.github.io/lpl/sinusoidal.gif)](examples/sinusoidal.tape)\n\n## Features\n\n- Multiple data sources in different formats as polling or streaming inputs:\n  - [x] JSON (inotify + periodic reload)\n  - [x] JSONLines (streaming input)\n  - [x] CSV (inotify + periodic reload)\n  - [x] CSV (streaming input)\n- Interactive scrolling\n- Series hiding/color selection\n\n## Example usage\n\nA few simple use cases using Bash:\n\n### Device thermometers\n\nLinux exposes the device thermometers under /sys/class/thermal.\n\nFor example, on my laptop:\n\n```console\n$ cat /sys/class/thermal/*/temp\n47000\n20000\n39050\n45000\n47050\n40000\n47000\n```\n\nTherefore, we can pass each file as a separate `--csv-poll` argument to `lpl`:\n\n```sh\n$ lpl $(\n\u003e     for file in /sys/class/thermal/*/temp; do\n\u003e          echo \"--csv-poll $(basename $(dirname $file))=$file\"\n\u003e     done\n\u003e )\n```\n\n### Rolling deployment\n\nWhen performing a [rolling update][rolling update]\nwith a Kubernetes Deployment,\nit scales down the old ReplicaSet and scales up the new ReplicaSet gradually.\nWe can monitor this progress by watching the ReplicaSet replica count\nusing `\u003c()` process substitution with `kubectl get --watch`\nand some transformation with `jq`:\n\n```sh\nlpl --json \u003c(kubectl get replicaset --watch -ojson | \\\n        jq --unbuffered -c '{\n            (.metadata.name + \" total\"): .status.replicas,\n            (.metadata.name + \" ready\"): .status.readyReplicas,\n        }')\n```\n\nCurrently `lpl` only supports JSONLines,\nso make sure to pass `-c` to print one JSON object per line.\nAlso use `--unbuffered` to ensure `jq` can emit new events immediately.\n\n## Reference\n\n### Input sources\n\n#### JSON\n\nJSON comes in two modes \u0026mdash; streaming and polling.\n\nStreaming JSON is specified by `--json PATH`,\nwhere `PATH` is a special file (typically from `\u003c()` process substitution)\nthat reads one JSON object per line.\nA JSON object may contain arbitrary fields,\nbut **only top-level fields with a single numeric value are processed**,\nwhere the numeric value is added to the time series\nnamed with the corresponding key,\nat the time the line is read.\nPipe your input to `| jq -c --unbuffered .` if it was not already one line per object.\n\nPolling JSON, on the other hand, is a (usually regular) file\nthat contains a single JSON object (either compact or formatted),\nspecified by `--json-poll PATH`.\nSimilar to streaming JSON,\nonly top-level fields with a single numeric value are processed.\nThe file is reloaded when it is changed (where supported by inotify),\nor every `--poll-period` seconds.\n\n#### CSV\n\nSimilar to JSON, CSV also supports streaming and polling modes\nthrough `--csv PATH` and `--csv-poll [HEADER=]PATH`.\n\nCSV files are separated with `,` by default,\nbut this may be customized with `--csv-poll-delimiter`.\n\nIf the argument contains `=`,\nthe part before `=` is treated as the CSV header.\nOtherwise, the first line read from `PATH`\n(initial first line for streaming, first line from every reload for polling)\nis treated as the CSV header.\n\nOnly numeric values that can be [parsed as `f64`][f64 as FromStr] are processed;\nother values are silently ignored.\nFor polling mode, if there are multiple files in a single poll,\nonly the first numeric value is processed.\n\n### Interactive CLI\n\n`lpl` provides an interactive TUI to browse the data plot.\n\nType `?` for help.\nType `q` to quit.\n\n## Installation\n\n### Compile from source\n\nUse `cargo install`:\n\n```sh\ncargo install lpl\n```\n\n### AUR\n\nYou can install `lpl` from the [AUR](https://aur.archlinux.org/packages/lpl) with using an [AUR helper](https://wiki.archlinux.org/title/AUR_helpers).\n\n```bash\nparu -S lpl\n```\n\n### Development builds\n\nDownload development builds built on GitHub CI:\n\n- Windows:\n  [x86\\_64 (64-bit)](https://sof3.github.io/lpl/bin-x86_64-pc-windows-msvc/lpl.exe),\n  [aarch64 (ARM 64-bit)](https://sof3.github.io/lpl/bin-aarch64-pc-windows-msvc/lpl.exe),\n  [i686 (Intel/AMD 32-bit)](https://sof3.github.io/lpl/bin-i686-pc-windows-msvc/lpl.exe)\n- MacOS:\n  [x86\\_64 (Intel/AMD 64-bit)](https://sof3.github.io/lpl/bin-x86_64-apple-darwin/lpl)\n  [aarch64 (Silicon 64-bit)](https://sof3.github.io/lpl/bin-aarch64-apple-darwin/lpl)\n- Linux:\n  - x86\\_64 (Intel/AMD 64-bit) [GNU](https://sof3.github.io/lpl/bin-x86_64-unknown-linux-gnu/lpl),\n    [musl](https://sof3.github.io/lpl/bin-x86_64-unknown-linux-musl/lpl)\n  - aarch64 (ARM 64-bit) [GNU](https://sof3.github.io/lpl/bin-aarch64-unknown-linux-gnu/lpl),\n    [musl](https://sof3.github.io/lpl/bin-aarch64-unknown-linux-musl/lpl)\n  - i686 (Intel/AMD 32-bit) [GNU](https://sof3.github.io/lpl/bin-aarch64-unknown-linux-gnu/lpl),\n    [musl](https://sof3.github.io/lpl/bin-aarch64-unknown-linux-musl/lpl)\n\n  [rolling update]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment\n  [f64 as FromStr]: https://doc.rust-lang.org/std/primitive.f64.html#impl-FromStr-for-f64\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSOF3%2Flpl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSOF3%2Flpl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSOF3%2Flpl/lists"}