This is an astral wrapper, that adds functionality for getting the part of day for a spesific datetime.
Project description
Part of Day
This is an astral package wrapper, that uses it's calculations to give the part of day, instead of giving time intervals for spesific parts.
Installation
To install, run the following command
pip install part-of-day
Usage
from part_of_day import PartOfDayCalculator
from datetime import datetime, timezone
pod = PartOfDayCalculator(latitude=15.33, longitude=-7)
# following methods gives results related to now, if a datetime is not given
pod.is_it_day()
# True
pod.is_it_night()
# False
pod.get_part_of_day()
# <PartOfDay.DAY: 'Day'>
# or they can be used with a datetime
dt = datetime(2025, 3, 12, 6, 13, 25, 0, timezone.utc)
pod.is_it_day(dt)
# False
pod.is_it_night(dt)
# True
pod.get_part_of_day(dt)
# <PartOfDay.NIGHT: 'Night'>
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
part_of_day-0.3.5.tar.gz
(1.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file part_of_day-0.3.5.tar.gz.
File metadata
- Download URL: part_of_day-0.3.5.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.10.12 Linux/6.14.0-24-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ed289abffeac2bc09b1e15e322a43655c1d7c59304416e2a7e166745f7b5140
|
|
| MD5 |
d7013d34158260c8c508f398a514fdc3
|
|
| BLAKE2b-256 |
5bd4c3e1e547af88f9f4891b7e3770400b923db0f4e185083e074065a268e919
|
File details
Details for the file part_of_day-0.3.5-py3-none-any.whl.
File metadata
- Download URL: part_of_day-0.3.5-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.0 CPython/3.10.12 Linux/6.14.0-24-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
678ff766d3b4010ef9dced08a77a6ab28d28a4297cd53585d8107753c2707248
|
|
| MD5 |
8073f2042471d7db30d5ca7bb4db77f5
|
|
| BLAKE2b-256 |
dc12af7fc8fc7f080a0770e30d87807abed0699c964a5cda6f3dcc6db5561b25
|