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.0.tar.gz
.
File metadata
- Download URL: caffeinated-0.1.0.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 | 56c28f0cc8de43ec1e47541a5f1f758ec84f985dca6ae8641a0882d370533726 |
|
MD5 | d364fd9d03cee3e9f1c9615e50f5c1a8 |
|
BLAKE2b-256 | 917343ca6c49102449d2b7db65c35d216a9d0c788c7893c3650241dba73c78ab |
File details
Details for the file caffeinated-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: caffeinated-0.1.0-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 | bfff84780da9f596c912cdcb05dcd578a315802b3acb4ef041bd208bf4cecfec |
|
MD5 | ed3efd65e7ae2eef4e1694c4df6b0f62 |
|
BLAKE2b-256 | 8ef390ff720f6cac2dc62b56853b442737b37e55dedbd8c9f577289755a99fb0 |