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

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

pip install --user opening-hours-rs

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.2.6.tar.gz (24.9 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.2.6-cp39-cp39-manylinux2010_x86_64.whl (412.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

opening_hours_py-0.2.6-cp38-cp38-manylinux2010_x86_64.whl (412.7 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for opening_hours_py-0.2.6.tar.gz
Algorithm Hash digest
SHA256 3ab72538427eae60daaa9219f3f19e5056f435a765ab12d1c9af271896a36cfc
MD5 0182058a2df02b9b01620b8961351cd9
BLAKE2b-256 8d1c6da277589ab3892133ca9d6280f6b6fc4e38855ec801c08eb68b7c0f3ba7

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.2.6-cp39-cp39-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.2.6-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d57f17309885547a3b968087576e16e08f20fc6a156fd09bd80a610215f06ebb
MD5 db75092e6e8ea7dfaaea877ee43cdaaf
BLAKE2b-256 8beac06a0e82c973e73027cc9aeba6278bb61aef89e225ade51624d11feae180

See more details on using hashes here.

File details

Details for the file opening_hours_py-0.2.6-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for opening_hours_py-0.2.6-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 29c9ac7d755694c758163db63e0d4ecdd4d48b162cd682f7f702f0d33a08ec54
MD5 1164aff71b8e443a7896a17e4f68f860
BLAKE2b-256 d410323aef194c61db92b82eb81be79ab5198279edebb5e586bc42c52dbb7a07

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