Skip to main content

whattime

Checking of what kind a datetime object is.

whattime let’s you explore of what kind a certain datetime object is, if it e.g. is on a weekend, or in the evening.

Getting started

Install it with:

pip install whattime

or

pipenv install whattime

For quickly getting started, just import the whattime function and explore a date’s properties (also see the Get started example):

from datetime import datetime
from whattime import whattime

now = datetime.now()
info = whattime(now)

info.is_weekday
info.is_monday
# ...

Besides checking all the time types you can also only check a certain category of types, e.g. info about the current day, or the time within a day seperately (also see the Single info type example).

from datetime import datetime
from whattime import week_info, day_time_info

now = datetime.now()

# There will only be properties available concerning the week time info when using week_info():
info = week_info(now)
info.is_weekday
info.is_monday
# ...

# There will only be properties available concerning the day time info  when using day_time_info():
info = day_time_info(now)
info.is_afternoon
info.is_evening
# ...

Development

  • Check out the repo with git clone git@github.com:grammofy/whattime.git.

  • To set up the project for development you need to install Pipenv and run:

    pipenv install --dev
    

    in order to install the needed development requirements.

  • Tests can be run with:

    python setup.py test
    

Contributing

Bug reports, feature discussions and pull requests are welcome on GitHub at https://github.com/grammofy/whattime. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant Code of Conduct.

Here’s how to contribute:

  • Fork it (https://github.com/grammofy/whattime/fork)
  • Create your feature branch (git checkout -b feature/my-new-feature master)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin feature/my-new-feature)
  • Create a new Pull Request

Please try to add Pytest tests along with your new feature. This will ensure that your code does not break existing functionality and that your feature is working as expected.

License

The software is available as open source under the terms of the MIT License.

Metadata

Release files for whattime 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for whattime 0.1.1
File Size Uploaded Provenance Actions
whattime-0.1.1.tar.gz 25.6 kB Without provenance Details for whattime-0.1.1.tar.gz

Release files / whattime-0.1.1.tar.gz

Download URL whattime-0.1.1.tar.gz
Size 25.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9baf896a022ed8397b58f44fb0fdee04a560f39028e59528ab0b03d5f6cd0d14
BLAKE2b-256 checksum
How to use checksums
169af5d0c12013584e0aa3514f1650063bca7d7614b4561c536ab1806a2b9f68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4

Security for whattime 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page