Provide statistics about your caffeine level specifically when you'd be going to bed.
Project description
caffeinated
Provide statistics about your caffeine level specifically when you'd be going to bed. This package was inspired by coffee-o-clock.
The formula used for calculating the amount of caffeine remaining in your system is:
$$ N(t) = N_0 \left( \frac{1}{2} \right)^{\frac{t}{t_6}} $$
Where:
- $N(t)$ = Quantity of caffeine remaining
- $N_0$ = Original amount of caffeine
- $t$ = Time
- $t_6$ = Coffee's half-life (6 hours)
Installation
Install this tool using pip
:
pip install caffeinated
Usage
For help, run:
caffeinated --help
Example usage:
caffeinated --caffeine 200 --bedtime 9pm
You would have 50.0mg of caffeine in your system if you went to bed at 9:00pm (in 12.0 hours).
That's like having 56% of a cup of coffee before bed.
You can also specify the time you're starting to consume caffeine. Both bedtime and start time can be specified in 12-hour or 24-hour format.
caffeinated --caffeine 200 --bedtime 2100 --start-time 0600
You would have 35.4mg of caffeine in your system if you went to bed at 9:00pm (in 15.0 hours).
That's like having 39% of a cup of coffee before bed.
Development
To contribute to this tool, first checkout the code. Then create a new virtual environment:
cd caffeinated
python -m venv venv
source venv/bin/activate
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
python -m pytest
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file caffeinated-0.1.1.tar.gz
.
File metadata
- Download URL: caffeinated-0.1.1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c91a67908a4e5f41c18598faee9450fe3bec65389b093260bafb1829ae45a02 |
|
MD5 | bf96df00c072ef2b7ab2ce5751815e25 |
|
BLAKE2b-256 | 7933357a97ca7ac640c254a219f3bca646359fb4e6e2f2006004fa7b565eaeba |
File details
Details for the file caffeinated-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: caffeinated-0.1.1-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03f95733b1ca3bed5e985ed3f7e24587a9616501ece623a730546cf4e11929f9 |
|
MD5 | ca9d45ad256c53dc02fbea7c38039ac1 |
|
BLAKE2b-256 | 810ab1d55b7d5f212a187b75c0918346263bda140f33727ff00418a485d9a5b4 |