Skip to main content

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 .json files
  • 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lekinpy-0.1.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

lekinpy-0.1.0-py3-none-any.whl (16.1 kB view details)

Uploaded Python 3

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

Hashes for lekinpy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4d64ba354a0bcc3c6381ea66a34fed2616948e76a9f41c8ebe6baf5fdf1a54b0
MD5 1b2c1c3269a378a44a2d2e251da0f7f5
BLAKE2b-256 0c2f4ce536e9c3bba6b4babf96c24432bf3915b4bc7767f590cbe7290a2e72dd

See more details on using hashes here.

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

Hashes for lekinpy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 805f1f78b48e7453971f4d4164b7443c4a9057386398ed4f55304d9c0261b92b
MD5 5e5045ff91046946b6807bc07482a9f7
BLAKE2b-256 5bc05b65135a8bc081fd836da5ff88362fa48247c997c3aeb0e07353833f4cb3

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