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

Uploaded Source

Built Distributions

opening_hours_py-0.7.0-cp313-none-win_amd64.whl (286.2 kB view details)

Uploaded CPython 3.13 Windows x86-64

opening_hours_py-0.7.0-cp313-none-win32.whl (262.8 kB view details)

Uploaded CPython 3.13 Windows x86

opening_hours_py-0.7.0-cp312-none-win_amd64.whl (286.2 kB view details)

Uploaded CPython 3.12 Windows x86-64

opening_hours_py-0.7.0-cp312-none-win32.whl (262.8 kB view details)

Uploaded CPython 3.12 Windows x86

opening_hours_py-0.7.0-cp312-cp312-macosx_11_0_arm64.whl (391.2 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

opening_hours_py-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl (396.7 kB view details)

Uploaded CPython 3.12 macOS 10.12+ x86-64

opening_hours_py-0.7.0-cp311-none-win_amd64.whl (285.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

opening_hours_py-0.7.0-cp311-none-win32.whl (263.2 kB view details)

Uploaded CPython 3.11 Windows x86

opening_hours_py-0.7.0-cp311-cp311-macosx_11_0_arm64.whl (390.8 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

opening_hours_py-0.7.0-cp311-cp311-macosx_10_12_x86_64.whl (397.4 kB view details)

Uploaded CPython 3.11 macOS 10.12+ x86-64

opening_hours_py-0.7.0-cp310-none-win_amd64.whl (285.5 kB view details)

Uploaded CPython 3.10 Windows x86-64

opening_hours_py-0.7.0-cp310-none-win32.whl (263.2 kB view details)

Uploaded CPython 3.10 Windows x86

opening_hours_py-0.7.0-cp310-cp310-macosx_11_0_arm64.whl (390.8 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

opening_hours_py-0.7.0-cp310-cp310-macosx_10_12_x86_64.whl (397.3 kB view details)

Uploaded CPython 3.10 macOS 10.12+ x86-64

opening_hours_py-0.7.0-cp39-none-win_amd64.whl (286.9 kB view details)

Uploaded CPython 3.9 Windows x86-64

opening_hours_py-0.7.0-cp39-none-win32.whl (263.3 kB view details)

Uploaded CPython 3.9 Windows x86

opening_hours_py-0.7.0-cp39-cp39-macosx_11_0_arm64.whl (390.8 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

opening_hours_py-0.7.0-cp39-cp39-macosx_10_12_x86_64.whl (397.5 kB view details)

Uploaded CPython 3.9 macOS 10.12+ x86-64

opening_hours_py-0.7.0-cp38-none-win_amd64.whl (286.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

opening_hours_py-0.7.0-cp38-none-win32.whl (262.8 kB view details)

Uploaded CPython 3.8 Windows x86

opening_hours_py-0.7.0-cp37-none-win_amd64.whl (286.5 kB view details)

Uploaded CPython 3.7 Windows x86-64

opening_hours_py-0.7.0-cp37-none-win32.whl (263.0 kB view details)

Uploaded CPython 3.7 Windows x86

File details

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

File metadata

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

File hashes

Hashes for opening_hours_py-0.7.0.tar.gz
Algorithm Hash digest
SHA256 2069cbfd557a385bcada8b238a24e47d3219c0691c75333b193a4a8814482f17
MD5 2e513da373fd0c2fc0fb7520eee12f7c
BLAKE2b-256 5562a9038b03010cd44e85801404b198515285452ae59a7e4dff4c5fc48d6f0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp313-none-win_amd64.whl
Algorithm Hash digest
SHA256 22c9b5f97b2271bbf75519f71e0ade0501eacf5cc4809381f03290fa88675f97
MD5 c4cbc2e1f0681874c4346e02a0451c0f
BLAKE2b-256 911506a69dbd5b56ec21870bb653d6e698dbf57de1414f3c49bbb3274c193864

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp313-none-win32.whl
Algorithm Hash digest
SHA256 a93ed9637086bb3aedaf74bb168ea13a9f715d5406540e53c1d2d49120336fc8
MD5 c6478e68a01749d4b5f9281becd7fd3a
BLAKE2b-256 cf2c78acba55d38b112bcda56aeb13c37b1f8cedd3e327ab3a210c59299aed79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp312-none-win_amd64.whl
Algorithm Hash digest
SHA256 92daf586fe0b0725f4d763aad7f3c1264f3e426745473d6a9a7686368079a72e
MD5 2ab8928584cde29d2972b0c0c3e126dc
BLAKE2b-256 a8c272f7069d412e074d0d71313242ce8a9698ed9223654469f0e2a36c5289d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp312-none-win32.whl
Algorithm Hash digest
SHA256 5c726f008736f45878c299a0eecae87653bd3b04b71c13d675b1b7af8e77e1b3
MD5 24c79b4502f131a8f4484729edf0cf32
BLAKE2b-256 b66db99bf4770814b0556b92282fd952259aee3fffd016f01c6eb6dc88943156

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f4dfe20c88d8c7f59055794edee4d3e96a0e87dd27c553eff254c95be99a9f4
MD5 a750eef8d254bdfca04d5f21f9741e24
BLAKE2b-256 e5d5a7f1520cb628022e562216dd0d294028326a646cf1d5be3c607e031083f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 92befda405622b999fc19defa27d97f4bc8780a65178d45bc249e83c59c6a6c9
MD5 699311c4da412b8bd81f767bc4da3c38
BLAKE2b-256 3212de7574fd76454f0333d48a866c1d4eaae949730ac34065d0e4df7f6332b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp311-none-win_amd64.whl
Algorithm Hash digest
SHA256 e1c6bdfbe5f30fb1138db3005b358b854c0bea315704d58dcdab65778e03abc4
MD5 77fb292c3b2415d387af2491be6b8b1e
BLAKE2b-256 97bdd4493da038fbec854fc3b64aaadabce02bec392212384995b05afab541e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp311-none-win32.whl
Algorithm Hash digest
SHA256 d546a038392326085e94c16ccbbcfb325a1e53096fa57f1c6b9ad071267e0e81
MD5 63fe8c91a50ead329a85cf7f3315c123
BLAKE2b-256 e5899bb6225edfe1b4503b247d1fb0116f2ea9bd6b5a654777f8c0877df925db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e8b5caae02d9d32879a20191982f9e2463f72e49e0187db40552c4a253c5ce4
MD5 a820ba2838fa1ae4263e9343bb6fc981
BLAKE2b-256 822a8942998d337f83c1ee2571306f9fc9bc2748f84799b7acd579c2f51dd08a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b19b709783548026ddb16bc40325bbc9bbf3fad7243a1f9c0544de5681d10ec3
MD5 ea404e938c2dd832f927ca9255fd8607
BLAKE2b-256 3da54f52e61bb5ba49cc1c59bc0b2a0dc3d103bd2f01cb0f4f98a8d043c282c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp310-none-win_amd64.whl
Algorithm Hash digest
SHA256 5e1b0372bb5dbc6cbef5c97c8f544d18f8e8d2a52999ecff1a365590fcea2c0d
MD5 ec3928bfcab29f9f8cc73e009d07c3db
BLAKE2b-256 9a854706174ff184b56f81163705e1a4eddf6d7b8339f2b6e08f6e7b55bd0754

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp310-none-win32.whl
Algorithm Hash digest
SHA256 59f8d6a9a357b11d7b560744d67e9d850f6c327658730b8441173eba638e37d1
MD5 7f04160fa20746b671d9568ebdfc00a4
BLAKE2b-256 37ac6c2b5d62cb52f3020ae2fb42a0286e6fd84245d3ca5c6aea49b382ed1b54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0bceddfdc54b8f94bb0c4f16c0e10000fda091ff18dca5a869b1b50b5ea82951
MD5 bd09e531c44807735a7e0e31b85ff482
BLAKE2b-256 073507be9cd515b46ba2b55037b99b60763823803b45c5e6c5da3df8dd27ca3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0da6dd7826893cf189b501fa2aef48d261f22b681582e6c65b1a85e87d12a361
MD5 100815122348bb83fc5b3a86173ee78f
BLAKE2b-256 f8b488fa05cb4a7eb95a335fb9c63a8bfadb7b5724a5c22802a403d81ad4e507

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 4a2c5a778eb11540ab323929e8faf838cd1866e09e79c07ff20ff7e9669598f4
MD5 dcfb12df3ce2e5d2abf2e5c0bf423db5
BLAKE2b-256 b54ed802a00015034db0bd329cb7d96a5db46f0a48d13084bc1994362458f8ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp39-none-win32.whl
Algorithm Hash digest
SHA256 2a951b656a5910fcf6d226706743785f9695c3d6f1f8213244388a46bb2b1534
MD5 dc057b122d8a14802c86f30f8175a73c
BLAKE2b-256 db0e1ef1da2cfcf04f10b0870936c5f7261004c02bc903d62671efbc5b2f2ba7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ea30be34ed6e20ed44496479abe1e98771d718dd9cf9556ff379b04db35b7683
MD5 b5872781fd413bcd81534d2fe1ff0e4e
BLAKE2b-256 15980e2cb93fd39062d3fc955faa7ac6066eefdfe64d7bb6941b719e16919817

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8882e250699d3e7980a6342591c1015131d0cb4e1e1b8298d91a2feee96ce1d7
MD5 6f3405a2b78b4668e441077b930b652b
BLAKE2b-256 0037efec447e4c61c8bb17f1a6676945955fcb7bb7da53991e7b3a8cf7bef511

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp38-none-win_amd64.whl
Algorithm Hash digest
SHA256 1c7f28390d77dc10c85b4fb026c64afedd8d756be71da30de25a5b74950fbf4f
MD5 c5c5c13269d5ae8e405a65cd9eed7d41
BLAKE2b-256 5fa29f43ca86a4604c7259315bb8a0962d8528c95838e8da6fb4fb4685077d6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp38-none-win32.whl
Algorithm Hash digest
SHA256 439e52b806c0cbb6b7b0e16d864e959c12eaeb45b1fe25118ae928527575103b
MD5 827e0fe314bbd2cf19ca7b80d99210b5
BLAKE2b-256 f65be3bb8b493d647b607efca3af7b6efc8c371dfd34c376a9e0ae7b7200fe4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp37-none-win_amd64.whl
Algorithm Hash digest
SHA256 70426ecc127bd7285c468073da7b999cdec74797b3738da8c5308d7d0cdb1f0e
MD5 39666a1a77e567dfb470ae590f0d6772
BLAKE2b-256 2e5651fdaef25a7aab0a913c7bad586f252d19065dae1676c6e485e1e3a4cc1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.7.0-cp37-none-win32.whl
Algorithm Hash digest
SHA256 dac7de0e18e630ec2066f5d7688ed118bae3f357f8ff699d1a8c3e385b484bad
MD5 9c379fc2be141f90438be402abda2f16
BLAKE2b-256 af627e20db150a9aee0d8703a41d0b9231f6fd7a88d2ead8c7a5bed53c2fd544

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