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.5.1.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.5.1-cp39-cp39-manylinux2010_x86_64.whl (280.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.12+ x86-64

opening_hours_py-0.5.1-cp38-cp38-manylinux2010_x86_64.whl (280.8 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

File details

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

File metadata

  • Download URL: opening_hours_py-0.5.1.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.5.1.tar.gz
Algorithm Hash digest
SHA256 2be8a7442849c85148b504b09d21628f3268952459aea08032ab40bf2434872b
MD5 9b032b28f118b38ff9593ef515b12747
BLAKE2b-256 02be814caea667eb5696807104acb57f0e6a1c87dccc17e83f5a07a24963911c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.5.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 b7144c906d86868709b68f4bff0c4c2ab858a83210abc2cc27cc92f8c3c0b696
MD5 072c875455b0f7c38218f1d494dcb9ab
BLAKE2b-256 1f5b3bd4560c2704c7baf9db78c0298b858b904e669d555b633c2ae663ab2246

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opening_hours_py-0.5.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 9b8754e9060554204c846a5ec718038a2386da2952a2f8361ac0993cd33a28f3
MD5 69c8d18ce1608c80948f844d11b3f021
BLAKE2b-256 2343989ee628a4916d2e89aea255218cb259c0748948450da1fd579b497a95cf

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