Crates.io | usage-tracker |
lib.rs | usage-tracker |
version | 0.3.2 |
source | src |
created_at | 2020-03-26 18:53:01.938563 |
updated_at | 2022-06-08 00:48:38.454348 |
description | A simple usage tracker in rust. |
homepage | https://github.com/TeFiLeDo/usage-tracker |
repository | https://github.com/TeFiLeDo/usage-tracker |
max_upload_size | |
id | 223206 |
size | 47,296 |
A simple usage tracker CLI written in rust. Also provides JSON output and a rust library to easily access the data.
usage-tracker
is a simple program that allows you to keep track of your usage
of objects.
For example, if you want to keep track of how much milk you drink, you'd tell the program to keep track of a new object that you call "milk". After that, whenever you've emptied a can of milk, you tell the program to record a new usage. Later you can access a list of all times when you emptied a can of milk.
usage-tracker
also provides the functionality to calculate an estimate of how
much cans of milk you'll need in a certain amount of time. Please note that
these estimates are estimates. In most cases the accuracy will increase with
the amount of data and the time since the usage first record.
In this section you'll learn how to enact the example from the previous section.
First of all, we need to tell usage-tracker
to keep track of cans of milk:
$ usage-tracker add milk
Now we want to tell the program that we've emptied a can of milk:
$ usage-tracker use milk
After that, we want to see a list of all times we've emptied a can of milk:
$ usage-tracker show milk
Finally, we want to stop keeping track of milk:
$ usage-tracker remove milk
For further information, you can use the integrated help of the CLI:
$ usage-tracker help
$ usage-tracker -h
# These commands will provide you with a brief help message.
$ usage-tracker --help
# This command will provide you with a longer, more detailed help message.
If you have cargo installed (which probably means your a rust developer), just type this:
$ cargo install usage-tracker
Otherwise you can go to the releases page and grab the application for your platform from the latest release. Make sure to grab the version for the correct platform.
In the prediction functionality, the existence of leap years is ignored. Also all months are treated as 30 days long. This is necessary to keep the interface for users simple. Otherwise they would be required to specify when the usage starts, which would be a worse user experience.
You will need to set up a rust development environment. After that, clone or download the repository. Go into its root folder and run this command:
$ cargo build