Jikoku
Flexible and extendable Python utility for generating working timetables from general schedule data.
Basic Usage Example
from jikoku.models import Stop, Service
from jikoku.scheduler import schedule
from datetime import time, timedelta
# Define a simple service and return service
starts = time(hour=8)
ends = time(hour=9, minute=30)
first = Service("a_service", starts, ends, [Stop("Teufort", starts), Stop("Badlands",ends)])
first_return = Service( "a_return_service",starts , ends, [Stop("Badlands", starts), Stop("Teufort", ends)])
# Copy those services throughout the day
all_services = [first + timedelta(hours=i) for i in range(4)] + ([first_return + timedelta(hours=i) for i in range(4)])
# Schedule the services
generated_schedule = schedule(all_services)
print(generated_schedule)
"""prints the following:
train-ZT4bwn
09:00:00 - 10:30:00: Teufort => Badlands
11:00:00 - 12:30:00: Badlands => Teufort
train-eP9nMb
08:00:00 - 09:30:00: Badlands => Teufort
10:00:00 - 11:30:00: Teufort => Badlands
train-hVGMEI
08:00:00 - 09:30:00: Teufort => Badlands
10:00:00 - 11:30:00: Badlands => Teufort
train-jzVbxj
09:00:00 - 10:30:00: Badlands => Teufort
11:00:00 - 12:30:00: Teufort => Badlands
"""
Have a look at the documentation for more examples, including real word schedules from JR & SNCF!
Installation
Jikoku is available on PyPI. Install via using (preferably in a virtual environment) via:
pip install jikoku
Contributing
Pull requests, feature requests or other ideas always welcome. To get a local development environment setup, you will need Poetry installed. Then:
git clone https://github.com/TakeoIschiFan/Jikoku
cd Jikoku
poetry install
Note: use `poetry install --with docs if you want to compile the documentation website
To get logging working, add a .env file in the root directory which contains the following variables
PYTHONPATH="jikoku:tests"
DEBUG="true"
Metadata
Release files for jikoku 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jikoku-0.0.1.tar.gz | 4.6 kB | Without provenance | Details for jikoku-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jikoku-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for jikoku-0.0.1-py3-none-any.whl |
Total release size: 10.7 kB
Release files / jikoku-0.0.1.tar.gz
| Download URL | jikoku-0.0.1.tar.gz |
|---|---|
| Size | 4.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
18b995c63632f8be77814ca546cb93b0977e2991827a0f9229d97a2808795ce8
|
|
BLAKE2b-256 checksum How to use checksums |
8086fef82a37afd5c59a568fae3ebb278e277f16fcd3eb38bdda086a39424438
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Linux/6.1.51-1-MANJARO
|
Release files / jikoku-0.0.1-py3-none-any.whl
| Download URL | jikoku-0.0.1-py3-none-any.whl |
|---|---|
| Size | 6.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
094d71f9ddf54340684ee132d713e389d09f533556f92b2e9b5f0da3ed394ae7
|
|
BLAKE2b-256 checksum How to use checksums |
dd6323a96ef986ca9e2ebf0a0309ed1a0e3ec0786f001d040678788bc163b421
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.6.1 CPython/3.11.5 Linux/6.1.51-1-MANJARO
|
Security for jikoku 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.