A CLI tool to get prayer times
Project description
MyPrayer
MyPrayer is a command line application for getting Islamic prayer times for a given location and date.
Features
- Get prayer times for a specific date and location
- Show next upcoming prayer time
- Support from multiple calculation methods
- Output prayer times in different formats
- Save default location and settings
Dependencies
- Python 3.8+
- Typer - CLI app framework
- Inquirer.py - user prompts
- Rich - output formatting
- Requests - HTTP client
Install
pip install myprayer
Usage
myprayer
Usage: myprayer [OPTIONS] COMMAND [ARGS]...
MyPrayer CLI.
Options
--install-completion [bash|zsh|fish|powershell|pwsh] Install completion for the specified shell.
[default: None]
--show-completion [bash|zsh|fish|powershell|pwsh] Show completion for the specified shell, to copy it or customize the installation.
[default: None]
--help Show this message and exit.
Commands
config Configure myprayer.
list List prayer times.
next Show next prayer.
myparyer list
Usage: myprayer list [OPTIONS]
List prayer times.
Options
--city -c TEXT City name.
--country -C TEXT Country name.
--address -a TEXT Address.
--latitude -lat FLOAT Latitude.
--longitude -lon FLOAT Longitude.
--day -d INTEGER RANGE [1<=x<=31] Day (1-31) [default: (Current day)]
--month -m INTEGER RANGE [1<=x<=12] Month [default: (Current month)]
--year -y INTEGER Year [default: (Current year)]
--method -M INTEGER Calculation method. [default: (Egyptian General Authority of Survey)]
--time-format -t [12|24] Time format. [default: 12]
--output -o [pretty|machine|table|json] Output type. [default: table]
--next -n Show next prayer, has no effect if day, month, or year are given. [default: True]
--force -f Force update cache.
--help Show this message and exit.
myparyer next
Usage: myprayer next [OPTIONS]
Show next prayer.
Options
--city -c TEXT City name.
--country -C TEXT Country name.
--address -a TEXT Address.
--latitude -lat FLOAT Latitude.
--longitude -lon FLOAT Longitude.
--day -d INTEGER RANGE [1<=x<=31] Day (1-31) [default: (Current day)]
--method -M INTEGER Calculation method. [default: (Egyptian General Authority of Survey)]
--time-format -t [12|24] Time format. [default: 12]
--output -o [pretty|machine|table|json] Output type. [default: table]
--force -f Force update cache.
--help Configure default settings
Configuration
Default settings like location, calculation method, and output format can be configured in $XDG_CONFIG_HOME/myprayer/config.json
or $HOME/.config/myprayer/config.json
using myprayer config
.
Example configuration
{
"time_format": "12", // 12 or 24
"print_type": "table", // pretty, machine, table, json
"method": 5, // Calculation method
"show_next": true, // Highlight next prayer in list
"prayers": [ // Prayer to show
"Fajr",
"Dhuhr",
"Asr",
"Maghrib",
"Isha"
],
"location": { // Default location used if no location is provided in command
"type": "city",
"city": "Cairo",
"country": "Egypt",
"state": null
}
}
Credits
- Aladhan API - for prayer time data
- aladhan-api - i drew inspiration from this project
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
myprayer-2.0.6.tar.gz
(14.9 kB
view details)
Built Distribution
myprayer-2.0.6-py3-none-any.whl
(17.9 kB
view details)
File details
Details for the file myprayer-2.0.6.tar.gz
.
File metadata
- Download URL: myprayer-2.0.6.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.0-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f604c2b5b458e2a89da5f891bc107881d39b760c03185ab9e359a575b7576baf |
|
MD5 | 1df6a5f24cbe9cfac4fe82d42c288d09 |
|
BLAKE2b-256 | 915a5d37608e44ea69ff67feff9e5e76e2476cf68272baf99aefe49eb7d5b5fd |
File details
Details for the file myprayer-2.0.6-py3-none-any.whl
.
File metadata
- Download URL: myprayer-2.0.6-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.8 Linux/6.8.0-arch1-1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a6cb1bfd7a73471c6bf13513dc600aa1e07160ab9decb4e69a24229b2bc1e37 |
|
MD5 | 374f90d9f362e14fda59f4c88cff029a |
|
BLAKE2b-256 | b2a00c807a460a4bce71e9acbb6541a9267ec03282b2fcaaccb59b7bbd02bc05 |