day countdown program (python edition)
Project description
Army Days (Python version)
Overview
A command-line program to display the number of days until certain events. This program (hence its name) is also based on the West Point requirement that first year cadets have to be able to recite "the days". Part of that tradition is that if it is past noon at the time, you subtract a day but add "and a butt". As most people aren't concerned about being West Point style, this is an optional feature that can be enabled via a flag. Past events can optionally be displayed via configuration.
Installing as a CLI Tool
For regular usage, it's useful to install the program using either pipx or uv tool or just run directly with uvx.
Usage
Example output
❯ army-days
Days
89 days until Army beats the hell out of Navy.
100 days until Christmas.
Help
Once installed, you can run the command with the --help
option.
❯ army-days --help
Usage: army-days [OPTIONS]
Options:
--version Show the version and exit.
-f, --filename PATH configuration file; by default searches: ./days.yaml
./days.json ~/days.yaml ~/days.json ~/.days.yaml
~/.days.json.
-g, --generate-sample generate sample data in yaml format (sends to
stdout).
--help Show this message and exit.
Configuration / Input file
By default (as the help indicates), army-days looks for a configuration file in this order:
- days.yaml or days.json in the current working directory.
- days.yaml or days.json in the user's home directory.
- .days.yaml or .days.json in the user's home directory.
You can override the name of the configuration file via the -f
/ --filename
option.
Sample Configuration File Generation
To generate a sample configuration file:
army-days -g > days.yaml
The sample file will look similar to this:
config:
show_completed: false
use_army_butt_days: false
entries:
- date: '2025-09-15T00:00:00'
title: your one year anniversary of using army-days
[!NOTE] You do not need a time as part of the date field. So for simplicity, you can just leave off the time portion. In fact, if you use a timezone aware timestamp, you might end up with some unusual behavior as army-days first converts it to a local timestamp.
Development
This project uses uv for dependency management and virtual environment management.
uv python install
uv sync
Running tests
For basic tests with coverage:
uv run pytest --cov
And for tests with coverage and more verbose output also allowing stdout:
uv run pytest --cov -v -s
Running the program
uv run army-days
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 army_days-0.3.0.tar.gz
.
File metadata
- Download URL: army_days-0.3.0.tar.gz
- Upload date:
- Size: 21.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 897eff86d881077e232d23ba97e8e80e2ef6e7d28c392f9f0efc91af03923436 |
|
MD5 | 88bb0430c649e346d40584002d9d0424 |
|
BLAKE2b-256 | 49818010708b81efe889b64a51ffe4885b838a8b4b2aa8d57b9fc5ce773e5586 |
File details
Details for the file army_days-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: army_days-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 394731b5d7ea4393bc9009a34ac0f1877452105f906ddf1f773fe2b9d08710a1 |
|
MD5 | 4daaa5c4388398663d902079fcfab1a1 |
|
BLAKE2b-256 | cb35a31c2e9f46e9b695a4315de908b7bd6a64a374652780f9e95b8f58b9d1a1 |