{"id":22352710,"url":"https://github.com/koushiro/pbar","last_synced_at":"2026-05-14T13:42:00.169Z","repository":{"id":104318656,"uuid":"132329212","full_name":"koushiro/pbar","owner":"koushiro","description":"A terminal progress bar written in Rust.","archived":false,"fork":false,"pushed_at":"2020-10-22T06:26:04.000Z","size":572,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T18:29:04.806Z","etag":null,"topics":["cli","console","progress-bar","rust","terminal"],"latest_commit_sha":null,"homepage":"","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/koushiro.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,"zenodo":null}},"created_at":"2018-05-06T10:43:03.000Z","updated_at":"2021-12-11T12:31:06.000Z","dependencies_parsed_at":"2023-03-10T22:30:17.454Z","dependency_job_id":null,"html_url":"https://github.com/koushiro/pbar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/koushiro/pbar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koushiro%2Fpbar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koushiro%2Fpbar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koushiro%2Fpbar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koushiro%2Fpbar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/koushiro","download_url":"https://codeload.github.com/koushiro/pbar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/koushiro%2Fpbar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279182269,"owners_count":26121146,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","console","progress-bar","rust","terminal"],"created_at":"2024-12-04T12:27:00.167Z","updated_at":"2025-10-16T11:11:28.210Z","avatar_url":"https://github.com/koushiro.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pbar\n\n[![Actions Status][ga-svg]][ga-url]\n[![GitHub License][license-svg]][license-url]\n\n[ga-svg]: https://github.com/koushiro/pbar/workflows/build/badge.svg\n[ga-url]: https://github.com/koushiro/pbar/actions\n[license-svg]: https://img.shields.io/github/license/koushiro/pbar?style=flat-square\n[license-url]: https://github.com/koushiro/pbar/blob/master/LICENSE\n\nThis is a terminal progress bar library written in Rust.\n\n## Usage\n\nNot publish to [crates.io](https://crates.io) yet, please add github repo into dependency.\n\n```toml\n[dependencies]\npbar = { git = \"https://github.com/koushiro/pbar\" }\n```\n\n### examples\n\n1. Simple Progress Bar:\n\n```bash\ncargo run --example simple\n```\n\n```rust\nuse std::thread;\nuse std::time::Duration;\n\nuse pbar::ProgressBar;\n\nfn main() {\n    let count = 1000;\n    let mut pbar = ProgressBar::stdout(count);\n    pbar.set_title(\"Simple:\");\n    for _ in 0..count {\n        pbar.increase();\n        thread::sleep(Duration::from_millis(10));\n    }\n    pbar.finish_with_msg(\"Done...\");\n}\n```\n\n![](screenshots/simple.gif)\n\n2. Multiple Progress Bar:\n\n```bash\ncargo run --example multiple\n```\n\n```rust\nuse std::thread;\nuse std::time::Duration;\n\nuse pbar::{MultiProgressBar, ProgressBarStyle};\n\nfn main() {\n    let mut multibars = MultiProgressBar::stdout();\n    let style = ProgressBarStyle::default();\n\n    let count: u64 = 1000;\n    let mut bar1 = multibars.attach(count);\n    bar1.set_title(\"item #1:\")\n        .set_style(style.clone());\n    let _ = thread::spawn(move || {\n        for _ in 0..count {\n            bar1.increase();\n            thread::sleep(Duration::from_millis(10));\n        }\n        bar1.finish_and_clear(\"item #1: done\");\n    });\n\n    let mut bar2 = multibars.attach(count);\n    bar2.set_title(\"item #2:\")\n        .set_style(style.clone());\n    let _ = thread::spawn(move || {\n        for _ in 0..count {\n            bar2.increase();\n            thread::sleep(Duration::from_millis(20));\n        }\n        bar2.finish_and_clear(\"item #2: done\");\n    });\n\n    let mut bar3 = multibars.attach(count);\n    bar3.set_title(\"item #3:\")\n        .set_style(style.clone());\n    let _ = thread::spawn(move || {\n        for _ in 0..count {\n            bar3.increase();\n            thread::sleep(Duration::from_millis(30));\n        }\n        bar3.finish_and_clear(\"item #3: done\");\n    });\n\n    multibars.join_with_msg(\"All done...\").unwrap();\n}\n```\n\n![](screenshots/multiple.gif)\n\n3. Customizable Progress Bar:\n\n```bash\ncargo run --example year_progress\n```\n\n```rust\nuse pbar::{ProgressBar, ProgressBarStyle};\nuse chrono::prelude::*;\n\nfn leap_or_normal(year: u32) -\u003e u16 {\n    if (year%4 == 0 \u0026\u0026 year%100 != 0) || year%400 == 0 {\n        366\n    } else {\n        365\n    }\n}\n\nfn main() {\n    let dt = Local::now();\n    let days = leap_or_normal(dt.year() as u32);\n    let mut pbar = ProgressBar::stdout(days as u64);\n\n    let mut style = ProgressBarStyle::customizable();\n    style.counter(None, None)\n         .percent()\n         .bar(\" ██░ \", Some(40));\n\n    pbar.set_title(\u0026format!(\"{} year progress:\", dt.year())[..])\n        .set_style(style);\n    pbar.set(dt.ordinal() as u64, true);\n}\n```\n\n![](screenshots/year_progress.gif)\n\n### Customization\n\n1. customizable progress bar\n\n    ```rust\n    let style = ...\n    ...\n    let mut pbar = ProgressBar::stdout();\n    pbar.set_title(\"Title:\")\n        .set_width(80)\n        .set_refresh_rate(Duration::from_millis(300));\n    ```\n\n2. customizable style\n\n    ```rust\n    let mut style = ProgressBarStyle::customizable();\n    style.counter(None, None)       /// progress like 1234 / 10000\n         .speed(None)               /// speed with format\n         .percent()                 /// progress percent\n         .bar(\" ██░ \", Some(40))    /// bar symbols(begin/fill/current/empty/end), bar width(default 30)\n         .time_left(None)           /// left time with format\n         .str(\"/\")                  /// just string, like delimiter string\n         .time_elapsed(None)        /// elapsed time with format\n         .str(\"/\")\n         .time_total(None);         /// left+elapsed time with format\n\n    pbar.set_style(style);\n    ```\n\n## TODO\n\n- [ ] add customizable spinner component\n- [ ] add terminal color and attribute or use other crate instead of my term implement.\n- [ ] more practical examples\n\n## Alternatives\n\n- [indicatif](https://github.com/mitsuhiko/indicatif)\n- [pb](https://github.com/a8m/pb)\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoushiro%2Fpbar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoushiro%2Fpbar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoushiro%2Fpbar/lists"}