{"id":23764456,"url":"https://github.com/chaqchase/pgbar","last_synced_at":"2026-03-22T22:30:16.673Z","repository":{"id":143722950,"uuid":"616716240","full_name":"chaqchase/pgbar","owner":"chaqchase","description":"A minimal progress bar written in rust","archived":false,"fork":false,"pushed_at":"2023-11-23T00:54:43.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-29T00:24:37.956Z","etag":null,"topics":["progress-bar","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/pgbar","language":"Rust","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/chaqchase.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}},"created_at":"2023-03-20T23:52:32.000Z","updated_at":"2023-11-23T00:53:58.000Z","dependencies_parsed_at":"2023-11-23T01:45:18.588Z","dependency_job_id":"adbd2ba8-70ae-4481-a685-13877ef81b41","html_url":"https://github.com/chaqchase/pgbar","commit_stats":null,"previous_names":["chaqchase/pgbar"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fpgbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fpgbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fpgbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaqchase%2Fpgbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaqchase","download_url":"https://codeload.github.com/chaqchase/pgbar/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239938059,"owners_count":19721560,"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":["progress-bar","rust"],"created_at":"2024-12-31T22:18:14.185Z","updated_at":"2026-03-22T22:30:16.624Z","avatar_url":"https://github.com/chaqchase.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pgbar - A minimal progress bar written in rust\n\n[![Crates.io](https://img.shields.io/crates/v/pgbar.svg)](https://crates.io/crates/pgbar)\n![Rust CI](https://github.com/triyanox/pgbar/workflows/Rust%20CI/badge.svg)\n\nThis is a Rust library to create progress bars on terminal. It provides an easy way to track the progress of some task, allowing the user to customize its appearance and behavior.\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\npgbar = \"*\"\n```\n\n## Usage\n\nTo use the library, first import it on your Rust project:\n\n```rust\nuse pgbar::{ProgressBar, Style};\n```\n\nThen, create a new progress bar object with the desired configuration using the `new()` method:\n\n```rust\nlet mut pb = ProgressBar::new(100, 10, Style::default());\n```\n\nThe first parameter represents the maximum value of the progress bar, the second one is the estimated time to complete the task, and the third defines the style of the bar. You can customize it by creating a new `Style` struct with your preferred options.\n\nAfter that, you can start tracking the progress of your task by calling the `track()` method:\n\n```rust\npb.track();\n```\n\nThis will update the progress bar until it reaches the maximum value defined.\n\nYou can also update, reset or recover the progress bar using the methods `update()`, `reset()` and `recover()`, respectively.\n\n```rust\npb.update(50);\npb.reset();\npb.recover();\n```\n\nFinally, to finish the progress bar, call the `finish()` method:\n\n```rust\npb.finish();\n```\n\n## Customization\n\nThe progress bar can be customized with the following options:\n\n- `symbol`: the character used to represent the progress of the task (default: `\"*\"`).\n- `width`: the width of the progress bar in characters (default: `50`).\n- `wrapper`: the characters used to wrap the progress bar (default: `\"[]\"`).\n- `color`: the color of the progress bar (default: `Cyan`).\n- `time_to_finish`: whether or not to show the estimated time to finish the task (default: `true`).\n\nTo customize these options, create a new `Style` struct with your preferred configuration and pass it as a parameter to the `new()` method:\n\n```rust\nuse termion::color;\n\nlet style = Style {\n    symbol: \"#\".to_string(),\n    width: 30,\n    wrapper: \"()\".to_string(),\n    color: Some(\u0026color::Red),\n    time_to_finish: false,\n};\nlet mut pb = ProgressBar::new(100, 10, style);\n```\n\n## Example\n\nHere is a simple example showing how to use the progress bar library:\n\n```rust\nuse pgbar::{ProgressBar, Style};\nuse std::thread;\nuse std::time::Duration;\nuse termion::color;\n\n\nfn main() {\n    let style = Style {\n        symbol: \"=\".to_string(),\n        width: 50,\n        wrapper: \"||\".to_string(),\n        color: Some(\u0026color::Green),\n        time_to_finish: true,\n    };\n    let mut pb = ProgressBar::new(100, 5, style);\n\n    for i in 0..=100 {\n        pb.update(i);\n        thread::sleep(Duration::from_millis(50));\n    }\n\n    pb.finish();\n}\n```\n\nThis will create a progress bar with green color, the symbol \"=\" and the wrapper \"||\", updating its progress every 50 milliseconds until it reaches the maximum value of 100.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Fpgbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaqchase%2Fpgbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaqchase%2Fpgbar/lists"}