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.

Developpement

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/python

# 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.6.13.tar.gz (934.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

opening_hours_py-0.6.13-cp311-cp311-manylinux_2_34_x86_64.whl (367.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

opening_hours_py-0.6.13-cp310-cp310-manylinux_2_34_x86_64.whl (367.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

opening_hours_py-0.6.13-cp39-cp39-manylinux_2_34_x86_64.whl (367.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

opening_hours_py-0.6.13-cp38-cp38-manylinux_2_34_x86_64.whl (367.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.34+ x86-64

opening_hours_py-0.6.13-cp37-cp37m-manylinux_2_34_x86_64.whl (367.2 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.34+ x86-64

File details

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

File metadata

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

File hashes

Hashes for opening_hours_py-0.6.13.tar.gz
Algorithm Hash digest
SHA256 9e0321587ebe5bb60a72ec5b91808f571cb296aa90e0930c5662986de8c857e4
MD5 a6c8aa82ea90ef31ee05c223a6ed444e
BLAKE2b-256 564581c6356ecedb3d1585c85727dd4a614f41dacc81672c0f76400efaf036e0

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.6.13-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.6.13-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 38c9689f198b0fd71287223dad6d4e4f2837be43ede7ca59e4ff2a48250ccf28
MD5 5469707898921a0768882bfe190ad795
BLAKE2b-256 823edd623e94ff8e47639a395ae01ec325aecd06a04387eda8a4f986ca5be4ac

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.6.13-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.6.13-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3f86678a2580983502fce857189230fe73fed4b4105845dd2acc0e0e5c9ccbcc
MD5 797d1ffade50f54a95920954ad738d7a
BLAKE2b-256 aba5700b53f86e8caadd989170362d461f7d1aaa4c40ee6740f1ecc75235e589

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.6.13-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.6.13-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f5837f5a32ffb5fd66cc1a446331f0a109d1ecd21ffabb8e17ce8cf7004ee0ee
MD5 fcf7715a92e24611ac5fe4cf00f2dbab
BLAKE2b-256 b95362ac3e4a2f3617c9927906b1ca0f34f0590f345d032a4bde5d1df23bb5f3

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.6.13-cp38-cp38-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.6.13-cp38-cp38-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 09a76624af08ffe7a48f10abe87163d4b2b5ca00699e3d21731ff841a51f6da3
MD5 1781e8fc8a3e28a93f7a7bc0efc770b3
BLAKE2b-256 fc1279cbd1ae8456615380a7108688ef45c284844418b285b5b18a369764be84

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.6.13-cp37-cp37m-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.6.13-cp37-cp37m-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ff18527baffed7f5796558456f61a2173d525a946e5c2ee21217565bd1595db5
MD5 b602ceaee2d65bd61068d2d536bf7856
BLAKE2b-256 af7a9144eb1ab829868f6966c1e4310dbb0ae4599d740898573a855da333cfb6

See more details on using hashes here.

Supported by

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