A parser and toolkit for the opening_hours in OpenStreetMap written in Rust.
Project description
Python bindings for OSM Opening Hours
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file opening_hours_py-0.8.1.tar.gz
.
File metadata
- Download URL: opening_hours_py-0.8.1.tar.gz
- Upload date:
- Size: 929.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78a757f2957cdb2a59e3a372770471dfae3e769e8db639da1d9f6791575b6c04 |
|
MD5 | aeab04a9f369d7de1d73af0c0d46330f |
|
BLAKE2b-256 | 9b2f7ef6b452cc46b90d14e759401613c7f1ca2e399a568130649ac202af1032 |
File details
Details for the file opening_hours_py-0.8.1-cp313-none-win_amd64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp313-none-win_amd64.whl
- Upload date:
- Size: 301.5 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fd7aeaa5b21ed076750f5d7eaee77249ac7098d523c87dff3638f0ce1ea4e72 |
|
MD5 | 2d19b16649b675e516007cddd6e19d6f |
|
BLAKE2b-256 | c2daf55b6384275dac586bb51d8ab81385f505a9286f55cfcd2279d378209a5f |
File details
Details for the file opening_hours_py-0.8.1-cp313-none-win32.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp313-none-win32.whl
- Upload date:
- Size: 275.6 kB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2395ac5f21b7610415be5e3ba83597dea7afa6ada66a51ddb50d3a7ca3ba730b |
|
MD5 | a668449487dedcf0ce50361c4c63de1e |
|
BLAKE2b-256 | 68a3525c00b0462b58be1d358c042aaa73d071eafd5034e009dedd583216750c |
File details
Details for the file opening_hours_py-0.8.1-cp312-none-win_amd64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp312-none-win_amd64.whl
- Upload date:
- Size: 301.3 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4849e2d9747d6a7c67c8d49fe8872c4f043756de6686e809c19b7a96ebbd740 |
|
MD5 | 6db8472affe4d2b047ccf5cf06afd0fe |
|
BLAKE2b-256 | a8fc0162220aa26cf8c31d1df666f7ff87b3e3c3474e8a7ba9a6f9ef9fbf951f |
File details
Details for the file opening_hours_py-0.8.1-cp312-none-win32.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp312-none-win32.whl
- Upload date:
- Size: 275.7 kB
- Tags: CPython 3.12, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db6f171d2e9252425408b7f37d7a17f308b02891e507a1b314b69a1e713d7c31 |
|
MD5 | de35fc5f78963f644b03f950312b0a20 |
|
BLAKE2b-256 | f78e204b9e052fc9a025ecbae7fe0abb58cb7f4c26650f95fdb36c838df98bf6 |
File details
Details for the file opening_hours_py-0.8.1-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 410.2 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9772296deb782491ca1718855a8dc4d4bbc81e29963a1b180f5025dff76c8da |
|
MD5 | 80f87e8e7da2df700305fea65abf4b55 |
|
BLAKE2b-256 | 3694584036372efd7f905aa74072641f7c7cd19f4e4d6798ef976f7ae8ef183d |
File details
Details for the file opening_hours_py-0.8.1-cp312-cp312-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp312-cp312-macosx_10_12_x86_64.whl
- Upload date:
- Size: 418.9 kB
- Tags: CPython 3.12, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42cc052eda086c82bbafd113f355b0f173eaf20433b69b1d38d07ad17a0163d0 |
|
MD5 | de65e141bedc7dfecfb31cdf33d14431 |
|
BLAKE2b-256 | 02a375d684b3244e4a635053eebb8bc0bc5ba6320cc4ec545e1261ea05e69536 |
File details
Details for the file opening_hours_py-0.8.1-cp311-none-win_amd64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp311-none-win_amd64.whl
- Upload date:
- Size: 301.5 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63af6a04184a697c9da6c5245c055b6849f8822d467adab57b2db3c8daff58f8 |
|
MD5 | aa07321099999306b1c5ccb1adb4a748 |
|
BLAKE2b-256 | 8be91f02ccc27971575f546df84cf2f34da18aa0f9fb18119f92db5ef507dd1d |
File details
Details for the file opening_hours_py-0.8.1-cp311-none-win32.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp311-none-win32.whl
- Upload date:
- Size: 274.8 kB
- Tags: CPython 3.11, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62635ecee59c42d7fbd1a68c47497e651e07f6279efbd548007395a92f9ce116 |
|
MD5 | ff0f8a0c2ac9df60a8c5a9e389ab11b8 |
|
BLAKE2b-256 | 0d88f2ec0f21747c2a5a29c02d77cc99df5c62a99e57577d0e8b25940f974f7f |
File details
Details for the file opening_hours_py-0.8.1-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 410.7 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6789bfdc0c517d5fbd88a3aedac0cd68811a1acfff466a17dae263d5e69c7aeb |
|
MD5 | 45692061f685b88e3cd1272101c5e01e |
|
BLAKE2b-256 | 2d995b7658e922316aa199c1c6ae8c0efdb0947aa2616e232690afb438cc4e27 |
File details
Details for the file opening_hours_py-0.8.1-cp311-cp311-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp311-cp311-macosx_10_12_x86_64.whl
- Upload date:
- Size: 419.7 kB
- Tags: CPython 3.11, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f2f8e9a8f96b128319f1b10f030dd215708784bb598695b3841cd57e9e2a233 |
|
MD5 | b722b4f9b679a69141ee2e57478de266 |
|
BLAKE2b-256 | 38d6c194bf67fed7cc6524420e3e377c9e0187233358b562468addd4d5f316cf |
File details
Details for the file opening_hours_py-0.8.1-cp310-none-win_amd64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp310-none-win_amd64.whl
- Upload date:
- Size: 302.0 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae7e89031bf25cb4f40d80f1cd747a46e66c52452f2b341e69a5a5c55f3db73f |
|
MD5 | 8457cb32dcf5c576716195fa79787084 |
|
BLAKE2b-256 | bb3c4f8cfc36b3b9200e94fb1a9f77faec2fa6481d5c793a43fc44b744bbc97e |
File details
Details for the file opening_hours_py-0.8.1-cp310-none-win32.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp310-none-win32.whl
- Upload date:
- Size: 275.2 kB
- Tags: CPython 3.10, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e8044050ecdc398c533795374d58bb510a41b865cdcd8eda9ba807ece684d96 |
|
MD5 | e89df8df135e82ae67363862e9fb2e91 |
|
BLAKE2b-256 | cde1836464337d2710e057a059a653277f3a03c44791e2e087d722b4f05d84aa |
File details
Details for the file opening_hours_py-0.8.1-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 411.5 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4908a0eca315207f6af7760a5337181435110e1a130b1df65f9e25c7339f4da |
|
MD5 | 022de2116042880bb2570b95dc6b6bf1 |
|
BLAKE2b-256 | c95d56d10a7148f31ef95d9c1f1cc8d7804943f08dcf56500579f56d6f293afa |
File details
Details for the file opening_hours_py-0.8.1-cp310-cp310-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp310-cp310-macosx_10_12_x86_64.whl
- Upload date:
- Size: 420.2 kB
- Tags: CPython 3.10, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf0af4ac5768efa0640ae219632f7210897de3ac2d971b83ba9ff7d65ad2c246 |
|
MD5 | 4659031a8d9474b685a6b48548e4c790 |
|
BLAKE2b-256 | 58467842c2466dd44d7df455a098070262f46524351fd207941b6f5faaf4b1ee |
File details
Details for the file opening_hours_py-0.8.1-cp39-none-win_amd64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp39-none-win_amd64.whl
- Upload date:
- Size: 302.4 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9c06cc7b3cd46fca7f72b82da488e2ae95b6233f349b97a691a2c8661cc1c8a |
|
MD5 | 0134d31bbbbc95f1d575c871997f2228 |
|
BLAKE2b-256 | 7e302e8e9a9eb9926812509243393d205b65a85e15da1f7e6237284666517a22 |
File details
Details for the file opening_hours_py-0.8.1-cp39-none-win32.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp39-none-win32.whl
- Upload date:
- Size: 275.2 kB
- Tags: CPython 3.9, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46fafdac35d07e6a6b40ce0aefcf42f581060c44c0cbaaaa10589a017dda8e04 |
|
MD5 | afa9651d6c0666bcce15b9cb7d2acfa0 |
|
BLAKE2b-256 | 2f378b3fb822f23f60fa0ac0d06a165df2e35fbd069be6971ec37a340a1ffea2 |
File details
Details for the file opening_hours_py-0.8.1-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 412.1 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2daff11f5686124ed4d737890b38eb8bb8fa38417c7f132753f9ff97850dc076 |
|
MD5 | b3f2b8881022b87fbdb87aaaf18db4d0 |
|
BLAKE2b-256 | a91c6f9d75e3010718c86c02fa74c4458f67974613058759729db43e9eb6d696 |
File details
Details for the file opening_hours_py-0.8.1-cp39-cp39-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp39-cp39-macosx_10_12_x86_64.whl
- Upload date:
- Size: 420.3 kB
- Tags: CPython 3.9, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca46460cd108a304a443f3e258b591f2901544c09c830563ebd805f4198dd44a |
|
MD5 | da28eca0832b4cade85f09210b88882d |
|
BLAKE2b-256 | a49109c2c05ba6480218b631a3a6179890932cc83336f64ed4c23e8082c85dea |
File details
Details for the file opening_hours_py-0.8.1-cp38-none-win_amd64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp38-none-win_amd64.whl
- Upload date:
- Size: 302.0 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9c496b97b937f29cca2edae680440728b0b02bc5330104d8d7b795477b845a2 |
|
MD5 | 71a75a1492fd4bea790dd5e92c6d6ee4 |
|
BLAKE2b-256 | 5c292f957403b3a9bade0e627be5df0ab7af53afe5e3f9686e453c70e7916064 |
File details
Details for the file opening_hours_py-0.8.1-cp38-none-win32.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp38-none-win32.whl
- Upload date:
- Size: 275.2 kB
- Tags: CPython 3.8, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1f56ead1617d52ab5f3248ebf0394b0a8a67a96fb686ea51dd0080522281111 |
|
MD5 | 2f5ff162f62b1cdb0c3068c154cb44d9 |
|
BLAKE2b-256 | 708948e23cf74e9c01d95026b72b18ca0c5152896354ea32abecabb21c1bab8a |
File details
Details for the file opening_hours_py-0.8.1-cp37-none-win_amd64.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp37-none-win_amd64.whl
- Upload date:
- Size: 302.1 kB
- Tags: CPython 3.7, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a595d56c60bc5b53b409708f99074a11a640f6a388089642d6eeeb165b83720 |
|
MD5 | 3dd7f222db7bc6f0ad3431adb537b291 |
|
BLAKE2b-256 | c4ebb0401118dadac5f62d492551b6e530283a982e5f58ef90c71acf0d8fa996 |
File details
Details for the file opening_hours_py-0.8.1-cp37-none-win32.whl
.
File metadata
- Download URL: opening_hours_py-0.8.1-cp37-none-win32.whl
- Upload date:
- Size: 275.3 kB
- Tags: CPython 3.7, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 134890fd3d5d15ead7596449c7a8279d98e76b04f8f0ad8247258a43aef34c15 |
|
MD5 | 9759298a9bff9498791b9b1fe4dc0bcc |
|
BLAKE2b-256 | 230395a5f373d12aa7b9d73bb51de586f2d4d0f8c88c514423d9dcafb4727bf9 |