pyopening_hours
Python module providing access to the opening_hours.js library which is written in JavaScript.
This python library only implements the simple API from opening_hours.js at the moment (without optional parameters).
Installation
Install pyopening_hours simply by using pip:
pip install pyopening_hours
Usage
import pyopening_hours
try:
oh = pyopening_hours.OpeningHours(u'Lun-')
except pyopening_hours.ParseException as error:
print(error.message)
value = u'Mon,Tu,Th,Fr 12:00-18:00; Samstag 12:00-17:00 "I ❤ unicode"; Th[3] OFF; Th[-1] off'
oh = pyopening_hours.OpeningHours(value)
print(u"Parsing complex value: {}".format(value))
print(u"Is{} week stable".format('' if oh.isWeekStable() else ' not'))
print(u"Facility is {}".format(oh.getStateString()))
print(u"Next change in UTC: {}".format(oh.getNextChange().strftime('%Y-%m-%d %H:%M:%S')))
print(u"Warnings:")
for line in oh.getWarnings():
print(' ' + line)
Development
Just clone the repository with
git clone https://github.com/ypid/pyopening_hours
and install it’s dependencies (execute inside the repository):
make dependencies-get
Used by other projects
This library is used in the following projects:
Other modules
osm-opening-hours (pure python implementation)
Metadata
Release files for pyopening_hours 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyopening_hours-0.3.0.tar.gz | 926.3 kB | Without provenance | Details for pyopening_hours-0.3.0.tar.gz |
Release files / pyopening_hours-0.3.0.tar.gz
| Download URL | pyopening_hours-0.3.0.tar.gz |
|---|---|
| Size | 926.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
01c397a447ba97ccaf4eb10a2ba5acd268f348beee76a7a019108118063e7f1b
|
|
BLAKE2b-256 checksum How to use checksums |
91ff6fcfc1120b0192c57d3d9267b208bea7d0d403e4b45da30116fa81e5f786
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for pyopening_hours 0.3.0
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.