Skip to main content

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.

Usage example:

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.4.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

part_of_day-0.3.4-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file part_of_day-0.3.4.tar.gz.

File metadata

  • Download URL: part_of_day-0.3.4.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

Hashes for part_of_day-0.3.4.tar.gz
Algorithm Hash digest
SHA256 ba563f21356e7e62ae680a9bd8cd79836da339aa00db23bc80e98f9d2cd3253b
MD5 69a62b6270f1089dd72001b7772484ae
BLAKE2b-256 d18c893bf2258e01ab793688810ded2ddc9f1e72ecdf8a3c505684f356d59351

See more details on using hashes here.

File details

Details for the file part_of_day-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: part_of_day-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 2.2 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

Hashes for part_of_day-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d1ffe4707b3d9fe4a342a799423ee807cd83ff14d507f69c035b81b38041c1e9
MD5 6228fe2f93ffa1bc500936da672015f8
BLAKE2b-256 ec8b00a32f894bb1c1fc195101121a14828c420871ebf862ff82636ae9ca7ccd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page