VOOZH about

URL: https://www.nuget.org/packages/TqdmSharp/

⇱ NuGet Gallery | TqdmSharp 1.3.4




TqdmSharp 1.3.4

dotnet add package TqdmSharp --version 1.3.4
 
 
NuGet\Install-Package TqdmSharp -Version 1.3.4
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="TqdmSharp" Version="1.3.4" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TqdmSharp" Version="1.3.4" />
 
Directory.Packages.props
<PackageReference Include="TqdmSharp" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add TqdmSharp --version 1.3.4
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: TqdmSharp, 1.3.4"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package TqdmSharp@1.3.4
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=TqdmSharp&version=1.3.4
 
Install as a Cake Addin
#tool nuget:?package=TqdmSharp&version=1.3.4
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

TqdmSharp

👁 NuGet

TqdmSharp is a C# implementation of the tqdm progress bar, providing an easy-to-use and visually appealing way to track progress in console applications. Inspired by the cpptqdm project, we extend our gratitude to its creator for the inspiration and groundwork laid out in the original C++ implementation.

Features

  • Simple API for wrapping collections and enumerables.
  • Customizable progress bar themes.
  • Real-time progress updates.
  • Supports exponential moving average for rate calculation.
  • Adjustable width and update frequency.

Installation

.NET CLI

dotnet add package TqdmSharp

NuGet Package Manager

Install-Package TqdmSharp

Usage Examples

Standard Use

Easily wrap a collection for progress tracking. Ideal for quick integration with existing collections:

var arr = Enumerable.Range(0, 100).ToArray();
foreach (int item in Tqdm.Wrap(arr)) {
 // Perform your operations here
}

Adding a Label to the Progress Bar

Enhance clarity by adding a descriptive label to the progress bar, useful for distinguishing different stages or types of iterations:

var arr = Enumerable.Range(0, 100).ToArray();
foreach (int item in Tqdm.Wrap(arr, out var bar)) {
 bar.SetLabel("Processing stage");
 // Your processing logic here
}

Specifying Enumerable with a Count

When working with enumerables where the total count is known, provide it directly to track progress accurately:

var enumerable = Enumerable.Range(0, 100);
foreach (int item in Tqdm.Wrap(enumerable, 100)) {
 // Iteration tasks here
}

Basic Usage of the ProgressBar Class

Directly use the ProgressBar class for more control and customization over the progress tracking:

int count = 10;
var bar = new Tqdm.ProgressBar(total: count);
for (int i = 0; i < count; i++) {
 bar.Progress(i); // Can be replaced with bar.Step() to increase counter by 1. 

 // Custom operation
}
bar.Finish();

Dynamically Updating the Total Counter

Modify the total counter as your operation progresses, useful for processes with a variable number of iterations:

int count = 10;
var bar = new Tqdm.ProgressBar(total: count);
for (int i = 0; i < count; i++) {
 if (i % 7 == 0) count *= 2;
 bar.Progress(i, count);
 // Adjusted operation based on new count
}
bar.Finish();

Exploring Additional Parameters

TqdmSharp offers additional parameters for fine-tuning the progress bar's behavior, including the ability to use exponential moving average for rate calculation, adjusting the width of the progress bar, and setting the update frequency for real-time progress updates.

Demonstration

To showcase the functionality and visual appeal of TqdmSharp, here's a simple demonstration using the Wrap method with color enhancement. In this example, we iterate over a range of numbers, with each iteration pausing briefly to simulate a longer-running process. The useColor: true parameter adds a vibrant touch to the progress bar, making it more visually engaging. Observe how the progress bar updates in real-time with each iteration:

var arr = Enumerable.Range(0, 100).ToArray();
foreach (int item in Tqdm.Wrap(arr, useColor: true)) {
 // do something to not complete instantly
 Thread.Sleep(50);
}

Acknowledgements

Special thanks to the cpptqdm project for inspiring the design and functionality of TqdmSharp.

Contributions

We warmly welcome contributions to TqdmSharp! Whether you're fixing bugs, improving the documentation, or adding new features, your help makes this project better for everyone.

Product Versions Compatible and additional computed target framework versions.
.NET net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on TqdmSharp:

Package Downloads
TorchSharp.PyBridge

Package Description

MinHashSharp

Package Description

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.4 122 5/14/2026
1.3.3 6,461 12/6/2023
1.3.1 5,746 11/30/2023
1.3.0 317 11/26/2023
1.2.0 276 11/25/2023
1.1.0 278 11/25/2023
1.0.0 288 11/25/2023

1.3.4: Fixed unexpected progress bar display when calling Step() or Progress().
       1.3.0: Added bar.Step() method for simplified progress tracking.