A Python library for job shop scheduling compatible with LEKIN and JSON formats.
Project description
lekinpy
A Python library for job shop scheduling, compatible with LEKIN file formats and JSON. Easily extensible for new algorithms and open source contributions.
Installation
pip install lekinpy
Or for local development:
pip install .
Features
- Parse and write
.job,.mch,.seq, and.jsonfiles - Add jobs and machines programmatically or via files
- Run scheduling algorithms (FCFS, SPT, EDD, WSPT)
- Output schedules in LEKIN-compatible or JSON format
- Plot Gantt charts (requires
matplotlib)
Example Usage
from lekinpy.system import System
from lekinpy.job import Job, Operation
from lekinpy.machine import Machine, Workcenter
from lekinpy.algorithms.fcfs import FCFSAlgorithm
# Create a new scheduling system
system = System()
# Define a machine and assign it to a workcenter
machine = Machine("M1", release=0, status="A")
workcenter = Workcenter("WC1", release=0, status="A", machines=[machine])
system.add_workcenter(workcenter)
# Define a job with one operation assigned to WC1
job = Job("J1", release=0, due=10, weight=1, operations=[Operation("WC1", 5, "A")])
system.add_job(job)
# Choose the scheduling algorithm (First-Come First-Served)
algo = FCFSAlgorithm()
# Generate the schedule for the system
schedule = algo.schedule(system)
# Attach the computed schedule to the system
system.set_schedule(schedule)
# Print schedule details as a dictionary
print(system.schedule.to_dict())
# Plot a Gantt chart of the schedule (requires matplotlib)
schedule.plot_gantt_chart(system)
API Reference
📚 Full API Reference: docs/API_REFERENCE.md
System,Job,Operation,Machine,Workcenter- Algorithms:
FCFSAlgorithm,SPTAlgorithm,EDDAlgorithm,WSPTAlgorithm - IO:
export_jobs_to_jobfile,export_workcenters_to_mchfile, etc.
Contributing
- Fork, branch, and submit pull requests for new algorithms or features.
- See
tests/for unit test examples.
License
MIT
Contact
Author: Ruturaj Vasant
Email: rvt2018@nyu.edu
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 Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lekinpy-0.1.0.tar.gz.
File metadata
- Download URL: lekinpy-0.1.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d64ba354a0bcc3c6381ea66a34fed2616948e76a9f41c8ebe6baf5fdf1a54b0
|
|
| MD5 |
1b2c1c3269a378a44a2d2e251da0f7f5
|
|
| BLAKE2b-256 |
0c2f4ce536e9c3bba6b4babf96c24432bf3915b4bc7767f590cbe7290a2e72dd
|
File details
Details for the file lekinpy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lekinpy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
805f1f78b48e7453971f4d4164b7443c4a9057386398ed4f55304d9c0261b92b
|
|
| MD5 |
5e5045ff91046946b6807bc07482a9f7
|
|
| BLAKE2b-256 |
5bc05b65135a8bc081fd836da5ff88362fa48247c997c3aeb0e07353833f4cb3
|