{"id":15394891,"url":"https://github.com/cgbur/pc","last_synced_at":"2025-04-15T23:53:46.752Z","repository":{"id":187985196,"uuid":"677919227","full_name":"cgbur/pc","owner":"cgbur","description":"Difference calculations for the terminal","archived":false,"fork":false,"pushed_at":"2023-12-27T05:27:07.000Z","size":201,"stargazers_count":12,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T06:16:20.087Z","etag":null,"topics":["calculator","command-line-tool","percent-change","percentage","productivity-tools","statistics","terminal","tools","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/cgbur.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-08-13T04:41:34.000Z","updated_at":"2024-10-22T21:40:32.000Z","dependencies_parsed_at":"2023-12-27T02:29:28.206Z","dependency_job_id":"83349d00-f08b-4dc6-895a-081ab9a545b9","html_url":"https://github.com/cgbur/pc","commit_stats":{"total_commits":86,"total_committers":2,"mean_commits":43.0,"dds":0.03488372093023251,"last_synced_commit":"9a9098eebe4400c8577c57b84be1ecc5bbbfddcf"},"previous_names":["cgbur/pc"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fpc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fpc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fpc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgbur%2Fpc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgbur","download_url":"https://codeload.github.com/cgbur/pc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249173061,"owners_count":21224481,"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":["calculator","command-line-tool","percent-change","percentage","productivity-tools","statistics","terminal","tools","zig"],"created_at":"2024-10-01T15:24:49.492Z","updated_at":"2025-04-15T23:53:46.730Z","avatar_url":"https://github.com/cgbur.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"assets/usage.png\" alt=\"Usage Example\" width=\"600\"\u003e\n\u003c/p\u003e\n\n# `pc` - Change Calculator for the Terminal\n\n`pc` is a lightweight, blazing-fast tool that simplifies both the calculation\nand the understanding of differences between numbers. It allows you to quickly\nevaluate performance changes and offers meaningful human-formatted output, all\nwithin the convenience of your terminal.\n\n## ✨ Features\n\n- 🔥 **Fashionable Output:** Human readable, colorful, and easy to understand\n- 🎯 **Always Accurate:** Calculates percent change correctly every time\n- 🚀 **Blazing Fast:** Don't wait, get your results instantly\n- ❤️ **Zig-Powered:** Crafted with love using Zig\n\n## 🛠️ Usage\n\n### 💻 Basic Calculation\n\nCompute percentage changes and differences effortlessly:\n\n```sh\n❯ pc 18024 19503 11124 12321 340200 424212 1000000000\n↑    8.21%  1.08x  [ 17.60KiB → 19.05KiB ]\n↓   -43.0%  0.57x  [  19.0KiB → 10.9KiB  ]\n↑    10.8%  1.11x  [  10.9KiB → 12.0KiB  ]\n↑    2661%  27.6x  [    12KiB → 332KiB   ]\n↑    24.7%  1.25x  [ 332.2KiB → 414.3KiB ]\n↑  235631%  2357x  [   414KiB → 954MiB   ]\n```\n\n### 🎓 Friendly Sizes by Default\n\nLarge numbers are automatically translated into familiar sizes like GiB, MiB, KiB:\n\n```sh\n❯ pc 1124122523 2421252122\n↑  115.4%  2.15x  [ 1.0GiB → 2.3GiB ]\n```\n\nNeed raw numbers? Use the `-r` option:\n\n```sh\n❯ pc 1124122523 2421252122 -r\n↑  115.4%  2.15x  [ 1124122496 → 2421252096 ]\n```\n\n### 🔀 Flexibility with Delimiters\n\nBy default, `pc` tokenizes the input with the default delimiters (` \\n\\t\\r,;:|`). Use\nthe `--delimiters` or `-d` option to specify additional delimiters:\n\n```sh\n❯ echo \"15@20@3 6\" | pc -d \"@\"\n↑  33.3%  1.33x  [ 15 → 20 ]\n↓   -85%  0.15x  [ 20 → 3  ]\n↑   100%     2x  [  3 → 6  ]\n```\n\n### 📐 Fixed Calculation\n\nUse the `--fixed` or `-f` flags to evaluate changes relative to a specific\nreference point in your series. You can specify positive or negative indices to\nchoose the reference number.\n\nEvaluate changes relative to the first number (default):\n\n```sh\n❯ pc 1 2 3 4 -f\n↑  100%  2x  [ 1 → 2 ]\n↑  200%  3x  [ 1 → 3 ]\n↑  300%  4x  [ 1 → 4 ]\n```\n\nOr choose a different reference point (one-based):\n\n```sh\n❯ pc 1 2 3 4 -f 2\n↓  -50%  0.50x  [ 2 → 1 ]\n↑   50%  1.50x  [ 2 → 3 ]\n↑  100%     2x  [ 2 → 4 ]\n```\n\nOr index from the end of the series with negative numbers:\n\n```sh\n❯ pc 1 2 3 4 -f -1\n↓  -75%  0.25x  [ 4 → 1 ]\n↓  -50%  0.50x  [ 4 → 2 ]\n↓  -25%  0.75x  [ 4 → 3 ]\n```\n\n### 📄 Output Formats\n\nSpecify the output format with the `--format` option. Currently, `pc` supports\nthe following formats:\n\n- Human-readable (default)\n- JSON\n- CSV\n\n#### JSON Output\n\n```sh\n❯ pc 18024 19503 --format json | jq\n[\n  {\n    \"percent\": 8.20572566986084,\n    \"times\": 1.082057237625122,\n    \"prev\": 18024,\n    \"cur\": 19503\n  }\n]\n```\n\n#### CSV Output\n\n```sh\n❯ pc 18024 19503 --format csv\npercent,times,prev,cur\n8.20572566986084,1.082057237625122,18024,19503\n```\n\nFor the full command list, simply run:\n\n```sh\npc --help\n```\n\n## 📥 Installation\n\n### Prebuilt Binaries Available\n\nFind them on the [releases](https://github.com/cgbur/pc/releases) page.\n\n#### Supported Releases\n\n- Linux: `aarch64-linux-pc`, `riscv64-linux-pc`, `x86_64-linux-pc`\n- macOS: `aarch64-macos-pc`\n- Windows: `x86_64-windows-pc.exe`\n\n#### Installation Example for Linux (x86_64)\n\n```bash\nwget -O pc https://github.com/cgbur/pc/releases/latest/download/x86_64-linux-pc\nchmod +x pc\nmv pc ~/.local/bin/pc\n```\n\nReplace the file name in the URL with the corresponding one for other Linux architectures.\n\n### Build from Source\n\nTo build from source, you'll need [Zig](https://ziglang.org):\n\n```sh\ngit clone https://github.com/cgbur/pc.git\ncd pc\nzig build -Doptimize=ReleaseSafe\ncp zig-out/bin/pc ~/.local/bin/pc\n```\n\n## 📝 Future Plans\n\n- \\[ \\] Think of more features to add\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgbur%2Fpc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgbur%2Fpc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgbur%2Fpc/lists"}