Skip to main content

A parser and toolkit for the opening_hours in OpenStreetMap written in Rust.

Project description

Python bindings for OSM Opening Hours

PyPI Doc

Usage

The package is published for Python 3.7 and above, but you might be able to install it with older version of Python if you install the Rust toolchain.

Install opening-hours-py from PyPI, for example using pip:

pip install --user opening-hours-py

Then, the main object that you will interact with will be OpeningHours:

from opening_hours import OpeningHours

oh = OpeningHours("Mo-Fr 10:00-18:00; Sa-Su 10:00-12:00")
print("Current status is", oh.state())
print("This will change at", oh.next_change())

The API is very similar to Rust API but you can find a Python specific documentation here.

Developement

To build the library by yourself you will require a recent version of Rust, rustup is usually the recommanded tool to manage the installation.

Then you can use poetry to install Python dependancies and run maturin (the building tool used to create the binding) from a virtualenv.

git clone https://github.com/remi-dupre/opening-hours-rs.git
cd opening-hours-rs

# Install Python dependancies
poetry install

# Enter the virtualenv
poetry shell

# Build developpement bindings, add `--release` for an optimized version
maturin develop

# Now the library is available as long as you don't leave the virtualenv
python
>>> from opening_hours import OpeningHours
>>> oh = OpeningHours("24/7")
>>> oh.state()
"open"

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

opening_hours_py-0.8.0.tar.gz (930.1 kB view details)

Uploaded Source

Built Distributions

opening_hours_py-0.8.0-cp313-none-win_amd64.whl (300.2 kB view details)

Uploaded CPython 3.13 Windows x86-64

opening_hours_py-0.8.0-cp313-none-win32.whl (275.8 kB view details)

Uploaded CPython 3.13 Windows x86

opening_hours_py-0.8.0-cp312-none-win_amd64.whl (300.0 kB view details)

Uploaded CPython 3.12 Windows x86-64

opening_hours_py-0.8.0-cp312-none-win32.whl (275.8 kB view details)

Uploaded CPython 3.12 Windows x86

opening_hours_py-0.8.0-cp312-cp312-macosx_11_0_arm64.whl (410.9 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

opening_hours_py-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl (418.7 kB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

opening_hours_py-0.8.0-cp311-none-win_amd64.whl (300.3 kB view details)

Uploaded CPython 3.11 Windows x86-64

opening_hours_py-0.8.0-cp311-none-win32.whl (274.9 kB view details)

Uploaded CPython 3.11 Windows x86

opening_hours_py-0.8.0-cp311-cp311-macosx_11_0_arm64.whl (411.4 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

opening_hours_py-0.8.0-cp311-cp311-macosx_10_12_x86_64.whl (419.4 kB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

opening_hours_py-0.8.0-cp310-none-win_amd64.whl (300.8 kB view details)

Uploaded CPython 3.10 Windows x86-64

opening_hours_py-0.8.0-cp310-none-win32.whl (275.2 kB view details)

Uploaded CPython 3.10 Windows x86

opening_hours_py-0.8.0-cp310-cp310-macosx_11_0_arm64.whl (412.1 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

opening_hours_py-0.8.0-cp310-cp310-macosx_10_12_x86_64.whl (420.0 kB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

opening_hours_py-0.8.0-cp39-none-win_amd64.whl (301.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

opening_hours_py-0.8.0-cp39-none-win32.whl (275.3 kB view details)

Uploaded CPython 3.9 Windows x86

opening_hours_py-0.8.0-cp39-cp39-macosx_11_0_arm64.whl (412.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

opening_hours_py-0.8.0-cp39-cp39-macosx_10_12_x86_64.whl (420.0 kB view details)

Uploaded CPython 3.9 macOS 10.12+ x86-64

opening_hours_py-0.8.0-cp38-none-win_amd64.whl (300.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

opening_hours_py-0.8.0-cp38-none-win32.whl (275.2 kB view details)

Uploaded CPython 3.8 Windows x86

opening_hours_py-0.8.0-cp37-none-win_amd64.whl (300.9 kB view details)

Uploaded CPython 3.7 Windows x86-64

opening_hours_py-0.8.0-cp37-none-win32.whl (275.3 kB view details)

Uploaded CPython 3.7 Windows x86

File details

Details for the file opening_hours_py-0.8.0.tar.gz.

File metadata

  • Download URL: opening_hours_py-0.8.0.tar.gz
  • Upload date:
  • Size: 930.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for opening_hours_py-0.8.0.tar.gz
Algorithm Hash digest
SHA256 6279157ee0d8378c782e292f098b34e385571aab650aff13fc33812eaef99532
MD5 b4e735ce83655711e9fc1dfc85e90817
BLAKE2b-256 7df3ee4a8b6cdcc7c6b435cbde2b1828482057a48b381bb528b363e6a4030def

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp313-none-win_amd64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp313-none-win_amd64.whl
Algorithm Hash digest
SHA256 be2ddaaefdddae5063d9cb01e2b7ba277b2204f134cf4e97cb7343449bd42bae
MD5 e11ed0ed98a448ec1eec9bb5fd907608
BLAKE2b-256 ad047992f6546a55676a5d23423779b0d3b93dace446449256063b50b80cf5f4

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp313-none-win32.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp313-none-win32.whl
Algorithm Hash digest
SHA256 abb58aab97ca9a0f0d1c020a272a0dd64f842157145000825b6528d6aab453d6
MD5 e3f128f513112d5a4579235e604694e4
BLAKE2b-256 656d6e862b074941b8371c494c48417b571be6e0fedb2f32edfad56d48cb8d19

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp312-none-win_amd64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 2de05e2a726642f2d89127c9fa5052a39d19867dd1f7b69b8bbea15b808dbfc4
MD5 403462147724a1ea27513430631ad22a
BLAKE2b-256 b4277739f28176a3b5d3d2c14cf1e0d43ed6509ed7dd1bfe6448909061c3a647

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp312-none-win32.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp312-none-win32.whl
Algorithm Hash digest
SHA256 e1bc4a1e7b9c47b839a46b1d9c854b853db8943c7aab65d6a964ab5c0eee6e02
MD5 3471b3a2ee907866f860f4559068253c
BLAKE2b-256 56bccff015c63a23d27ddeed37795034ed601fea7c75b30d96c6c29f8800a19c

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8a7492a371ce90f8ddd926451c585bac893ae0aabcfbe3c1b06f3d3beec0c27
MD5 946616e0bae61377e6428151eb0d1017
BLAKE2b-256 d83f014560232f04b59e1ef653547ba03d75f19ee4e12c26f429c3eb2dc4117e

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 dfa6a840510179486e3660ce256dba423cbf66ca58a6ad1f7361f69cd3659fef
MD5 4910df1433e30b80056a913276ed40aa
BLAKE2b-256 0b376d2ec5b9f13ba7cff50d4213f3fbb19864a9ce2f101305e55dcd9cd9bdcd

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp311-none-win_amd64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 5de593b1d9e68010bdc37e4fc6ec5e5742e5000b0cc2eedc8e1833ba82c94612
MD5 cb16d88abd31dddedb9c140dc29a59e3
BLAKE2b-256 1b090ecaee84c1322c1f3755fd548d1bb1982995ed227259f8e7bb2ffbfbebf4

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp311-none-win32.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp311-none-win32.whl
Algorithm Hash digest
SHA256 acecac7f4dae2d9288f272501e0ddb98b5f1ebbc701c302565cad5db40518e49
MD5 22ed9fdc76015defb65b21e667833fc0
BLAKE2b-256 347391f4d5b10053149eed0214f0ef9a2559add004d0813714e8ba2b7073ed4c

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5da26204f9d1b4fbe6e546fc0496397f5c8a580e6cbf330f79cbf3d9b92fa9bd
MD5 7f85d99ca0c4c4b1e4b4451e3dc8b307
BLAKE2b-256 e311ba14dbaadaf0be30a2f1faa3241e630311442b3d1aa3f5b38c297899df33

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d6da1e30a1f80193c7d1ea5e820eeac76aae9f21d3ac154e3a5fac408938ffee
MD5 814c0efb931b10aa03fd74e2fe83c3f2
BLAKE2b-256 b459254ad5e765f76875040a68b81fc3a43349cda6a5ff89a320f7a57c5fefa4

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp310-none-win_amd64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 bec2fed4de317e2ec4693623a9c64d60ad1e2b67ba029f07af598fbf45ecb802
MD5 3ec3f34e3dd76a2f7bf345ce4e848d06
BLAKE2b-256 820f5090d9b3932dc8dd9dbf30624472eb988aa2ee3f4d16adbcf0437b6f7f9e

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp310-none-win32.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp310-none-win32.whl
Algorithm Hash digest
SHA256 502e7c508f82a1b33790d54d8f32ab73b0a3ebf359285a057fdfaed5b9895f1f
MD5 4e83eeb4d4393c2d4113c35197d75155
BLAKE2b-256 7eb1363daf3d2627bcf8e7cd40f5e0ac8ffb00e2ed561e9013d203372ad0089d

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 38aee85d59bf70a9db2324c02ebe142251d60eaf5f5fef35caa13941370359bf
MD5 0bd216a2627e0a02e107e97609ae9d48
BLAKE2b-256 29cb01b16449033f2db88bc397ae8b836867008e9bcbac882ab2dd07994320ab

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 edfe178cef50378b47f6bb175019079533463d9431e0c950e46bcb77278576ac
MD5 b13acbd73f9f886a9b35a20737a04560
BLAKE2b-256 5b8284442fd680a6fdb7595586135aad448e2f0cabe0fc6b4962aafd6aa69828

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 95ebdd69ca86386d35fbd9e7bfbdcb2a3751496333b7dfefd33bea495b76bb7c
MD5 aea94c708618d216694ac679e3c08b44
BLAKE2b-256 fbeafb51be1bc136ee90f7f50dba10139cfb3a676a927517150cbe803c52a561

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp39-none-win32.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp39-none-win32.whl
Algorithm Hash digest
SHA256 36419ee95e9f6475c3ba0a7d0329c97f4db00bc495992d4a67bb3c06f4df5583
MD5 86a369939ad8b3ab56175466e68f5f04
BLAKE2b-256 a417767686415ebeaf52d50fc6872f2595488527c07c03b5b94e52c38a6a3882

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b0b81993232755da8e97b539341dd2dd24706ed17c5dfc358861425ebf9f766c
MD5 f60c41a55809b357317f1074c5603369
BLAKE2b-256 4b07937c89da0facb4194a2d824e642f5cfccf45ae61f176a7651135303259b0

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 acf48156a6257f03b3c56d8d2014ba00601283f75d4f5207e787b2688114ac34
MD5 66cd7b38302172c95c2888f9bebe713f
BLAKE2b-256 f97ab0e23ec438809bbf92a8316cd83794f253b840158f4cad36b9660af2d6d3

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp38-none-win_amd64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 b5fa27fd6ba9485c73a518c99def8d821cf833fed0526f6de83b40686a01ef61
MD5 8aea8f48cdb9780cadb60a7c8922fd6d
BLAKE2b-256 e0d538aab9d8990c9d9eb92edd023fb37c1c4e8d2c630a4bfad4871e2640c9a8

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp38-none-win32.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp38-none-win32.whl
Algorithm Hash digest
SHA256 08fcf6a637e47aa74f78897f41b3098d725dbf18f155905220000081205edb6b
MD5 5696efd0966b6f145d556d3e7215988c
BLAKE2b-256 59786f877559b319a79e4e2999e00fcc5b7e6263eaa7f210e724b2d3e16e760c

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp37-none-win_amd64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 825ae400903be9fcc7e993d16a33e8de19bd9033673736632fceda93a32c9f94
MD5 9a487401e4251364619487eba762e661
BLAKE2b-256 b94216aa1915618bffd9391bc53204b3f9dd5766c1c7c80858bc15001cf305c6

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.8.0-cp37-none-win32.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.8.0-cp37-none-win32.whl
Algorithm Hash digest
SHA256 fd693f577bb0c9db37febd21b172bf26334979b4ae83e1ad0c223ae54a61a8c6
MD5 7e51926055a7c79fb41ed8c8d3f3c132
BLAKE2b-256 59f21ed3e93186f47841e4d3a5b1bf22f9c2df944df43c148778625ba46115b4

See more details on using hashes here.

Supported by

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