# LOGORYTHEM
A lightweight Python library for simulating classic **Operating System (OS)** algorithms — including CPU scheduling and page replacement.
This project is designed as a **clean, importable library for academic and research use**, allowing you to easily run and compare different OS algorithms.
---
## Features
`logorythem` includes two primary modules:
### CPU Scheduling (`scheduling`)
Simulates process scheduling algorithms and calculates:
* Waiting Time
* Turnaround Time
* Completion Time
Available algorithms:
* First-Come, First-Served (FCFS)
* Round Robin (RR)
* Shortest Job First (SJF) – Non-Preemptive
* Shortest Remaining Time First (SRTF) – Preemptive SJF
---
### Page Replacement (`page_replacement`)
Simulates memory management algorithms and computes:
* Total Page Faults
* Page Replacement Sequence
Available algorithms:
* First-In, First-Out (FIFO)
* Least Recently Used (LRU)
* Optimal (OPT)
---
## Installation
`logorythem` is available on PyPI.
Install it using:
```bash
pip install logorythem
```
## Quick Usage
### Example – Round Robin Scheduling
```python
from logorythem import scheduling
processes = [
{"pid": "P1", "arrival": 0, "burst": 5},
{"pid": "P2", "arrival": 1, "burst": 3},
{"pid": "P3", "arrival": 2, "burst": 8},
]
result = scheduling.round_robin(processes, quantum=2)
print(result)
```
### Example – LRU Page Replacement
```python
from logorythem import page_replacement
reference = [7, 0, 1, 2, 0, 3, 0, 4, 2, 3]
faults = page_replacement.lru(reference, frames=3)
print("Total Page Faults:", faults)
```
---
## Why Use LOGORYTHEM?
| Feature | Description |
| ----------- | ------------------------------------------------------------------------ |
| Modular | Each algorithm is a standalone function |
| Educational | Ideal for learning OS concepts like CPU scheduling and memory management |
| Lightweight | Simple design, minimal dependencies |
| Extensible | Easy to add or modify algorithms |
---
## Project Structure
```
logorythem/
├── src/
│ ├── page_replacement/
│ │ ├── __init__.py
│ │ ├── fifo.py
│ │ ├── lru.py
│ │ └── opt.py
│ ├── scheduling/
│ │ ├── __init__.py
│ │ ├── fcfs.py
│ │ ├── round_robin.py
│ │ ├── sjf_non_preemptive.py
│ │ └── sjf_preemptive.py
├── LICENSE
├── pyproject.toml
└── README.md
```
---
## License
Licensed under the **MIT License**.
You are free to use, modify, and distribute this project for learning and research purposes.
---
## Author
**Ammaar Abdul Rehman Bakshi**
Diploma in Computer Engineering
Anjuman-e-Islam Abdul Razzak Kalsekar Polytechnic
LinkedIn: [linkedin.com/in/ammaar-ic](https://linkedin.com/in/ammaar-ic)
---
Raw data
{
"_id": null,
"home_page": null,
"name": "logorythem",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "os, scheduling, page-replacement, cpu-scheduling, simulation, operating-system, education",
"author": null,
"author_email": "Ammaar Bakshi <the.ammaar.ic@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/eb/f8/524ce3b51da150141111b816901c628d7ce84ca2b0ebeb1729052ba720f0/logorythem-0.1.1.tar.gz",
"platform": null,
"description": "# LOGORYTHEM\n\nA lightweight Python library for simulating classic **Operating System (OS)** algorithms \u2014 including CPU scheduling and page replacement.\n\nThis project is designed as a **clean, importable library for academic and research use**, allowing you to easily run and compare different OS algorithms.\n\n---\n\n## Features\n\n`logorythem` includes two primary modules:\n\n### CPU Scheduling (`scheduling`)\n\nSimulates process scheduling algorithms and calculates:\n\n* Waiting Time\n* Turnaround Time\n* Completion Time\n\nAvailable algorithms:\n\n* First-Come, First-Served (FCFS)\n* Round Robin (RR)\n* Shortest Job First (SJF) \u2013 Non-Preemptive\n* Shortest Remaining Time First (SRTF) \u2013 Preemptive SJF\n\n---\n\n### Page Replacement (`page_replacement`)\n\nSimulates memory management algorithms and computes:\n\n* Total Page Faults\n* Page Replacement Sequence\n\nAvailable algorithms:\n\n* First-In, First-Out (FIFO)\n* Least Recently Used (LRU)\n* Optimal (OPT)\n\n---\n\n## Installation\n\n`logorythem` is available on PyPI.\nInstall it using:\n\n```bash\npip install logorythem\n```\n\n## Quick Usage\n\n### Example \u2013 Round Robin Scheduling\n\n```python\nfrom logorythem import scheduling\n\nprocesses = [\n {\"pid\": \"P1\", \"arrival\": 0, \"burst\": 5},\n {\"pid\": \"P2\", \"arrival\": 1, \"burst\": 3},\n {\"pid\": \"P3\", \"arrival\": 2, \"burst\": 8},\n]\n\nresult = scheduling.round_robin(processes, quantum=2)\nprint(result)\n```\n\n### Example \u2013 LRU Page Replacement\n\n```python\nfrom logorythem import page_replacement\n\nreference = [7, 0, 1, 2, 0, 3, 0, 4, 2, 3]\nfaults = page_replacement.lru(reference, frames=3)\nprint(\"Total Page Faults:\", faults)\n```\n\n---\n\n## Why Use LOGORYTHEM?\n\n| Feature | Description |\n| ----------- | ------------------------------------------------------------------------ |\n| Modular | Each algorithm is a standalone function |\n| Educational | Ideal for learning OS concepts like CPU scheduling and memory management |\n| Lightweight | Simple design, minimal dependencies |\n| Extensible | Easy to add or modify algorithms |\n\n---\n\n## Project Structure\n\n```\nlogorythem/\n\u251c\u2500\u2500 src/\n\u2502 \u251c\u2500\u2500 page_replacement/\n\u2502 \u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2502 \u251c\u2500\u2500 fifo.py\n\u2502 \u2502 \u251c\u2500\u2500 lru.py\n\u2502 \u2502 \u2514\u2500\u2500 opt.py\n\u2502 \u251c\u2500\u2500 scheduling/\n\u2502 \u2502 \u251c\u2500\u2500 __init__.py\n\u2502 \u2502 \u251c\u2500\u2500 fcfs.py\n\u2502 \u2502 \u251c\u2500\u2500 round_robin.py\n\u2502 \u2502 \u251c\u2500\u2500 sjf_non_preemptive.py\n\u2502 \u2502 \u2514\u2500\u2500 sjf_preemptive.py\n\u251c\u2500\u2500 LICENSE\n\u251c\u2500\u2500 pyproject.toml\n\u2514\u2500\u2500 README.md\n\n```\n\n---\n\n## License\n\nLicensed under the **MIT License**.\nYou are free to use, modify, and distribute this project for learning and research purposes.\n\n---\n\n## Author\n\n**Ammaar Abdul Rehman Bakshi**\nDiploma in Computer Engineering\nAnjuman-e-Islam Abdul Razzak Kalsekar Polytechnic\nLinkedIn: [linkedin.com/in/ammaar-ic](https://linkedin.com/in/ammaar-ic)\n\n---\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A lightweight Python library for simulating classic Operating System algorithms like CPU scheduling and page replacement.",
"version": "0.1.1",
"project_urls": null,
"split_keywords": [
"os",
" scheduling",
" page-replacement",
" cpu-scheduling",
" simulation",
" operating-system",
" education"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "5cc6b8c916aa5a589a78349b488f82137b97b1570154d40761f6839c08ee518f",
"md5": "e49ca5e538bee138df7410bd87e606a9",
"sha256": "90d064a7ec6ca6341431f7e44a7b29e5a9fbdd795ced10499b98ef7b2f395739"
},
"downloads": -1,
"filename": "logorythem-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e49ca5e538bee138df7410bd87e606a9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11209,
"upload_time": "2025-10-26T23:23:10",
"upload_time_iso_8601": "2025-10-26T23:23:10.629051Z",
"url": "https://files.pythonhosted.org/packages/5c/c6/b8c916aa5a589a78349b488f82137b97b1570154d40761f6839c08ee518f/logorythem-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "ebf8524ce3b51da150141111b816901c628d7ce84ca2b0ebeb1729052ba720f0",
"md5": "c8800c87c8b4cc818db9bc908df2640f",
"sha256": "a4786610e14d0457a11c10edb23c2ce1804e7999e141e6a8867a872c57159304"
},
"downloads": -1,
"filename": "logorythem-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "c8800c87c8b4cc818db9bc908df2640f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 7203,
"upload_time": "2025-10-26T23:23:11",
"upload_time_iso_8601": "2025-10-26T23:23:11.598988Z",
"url": "https://files.pythonhosted.org/packages/eb/f8/524ce3b51da150141111b816901c628d7ce84ca2b0ebeb1729052ba720f0/logorythem-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-26 23:23:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "logorythem"
}