Metadata-Version: 2.4
Name: nmp-notes
Version: 0.2.1
Summary: A CLI tool and Python library for generating prefilled practical lab files from templates.
License-Expression: MIT
Project-URL: Homepage, https://github.com/kc9ru/samajseva
Project-URL: Repository, https://github.com/kc9ru/samajseva
Project-URL: Issues, https://github.com/kc9ru/samajseva/issues
Keywords: education,templates,lab,practicals,cli,notes
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Education
Classifier: Topic :: Education
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# nmp-notes 📝

[![PyPI version](https://img.shields.io/pypi/v/nmp-notes.svg)](https://pypi.org/project/nmp-notes/)
[![Python versions](https://img.shields.io/pypi/pyversions/nmp-notes.svg)](https://pypi.org/project/nmp-notes/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**`nmp-notes`** (imported as **`nmp`**) is a lightweight Python library and CLI tool that drops a college practical's full code into your current folder.

---

## 📦 Installation

```bash
pip install nmp-notes
```

Or from source:
```bash
git clone https://github.com/kc9ru/samajseva.git
cd samajseva
pip install -e .
```

---

## 🚀 CLI Usage

### 1. Interactive menu (default)

```bash
nmp
```

Shows a numbered list grouped by subject; enter a number, a full name (`ai.1a-bfs`), a bare slug (`1a-bfs`), or a partial name (`bfs`) to create that practical's `.py` in the current folder. `q` quits. No raw mode or ANSI, so it works in any terminal (Windows, `dumb`, SSH, piped).

### 2. List practicals

```bash
nmp list
```

### 3. Create directly

```bash
nmp create ai.1a-bfs
nmp create cis.1-ciphers
nmp create 3-decision-tree -o my_tree.py
```

Generated files are named `practical1.py`, `practical2.py`, … in the current folder — the number continues from the highest existing `practicalN.py`, so nothing is ever overwritten. Use `-o` for a custom name.

AI practicals 1a/1b/2a/2b also copy a shared `RMP.py` helper next to the file (never overwritten).

---

## 📚 Subjects

| Subject | Code | Practicals |
|---|---|---|
| Artificial Intelligence | `ai` | 12 (1a–10) |
| Cyber and Information Security | `cis` | 10 |

Templates live in `src/nmp/templates/<subject>/`. CIS practicals 2 and 4 need `pip install rsa`; practical 6 needs `cryptography`; practical 7 needs internet access.

---

## 🐍 Python API Usage

```python
import nmp
from nmp.mk import TemplateNotFoundError, TargetFileExistsError

print(nmp.mk.available_templates())  # ['ai.1a-bfs', ..., 'cis.1-ciphers', ...]

nmp.mk.file("ai.1a-bfs")                          # ./practical1.py (+ ./RMP.py)
nmp.mk.file("cis.1-ciphers")                      # ./practical2.py
nmp.mk.file("3-decision-tree", filename="t.py")   # bare slug + custom name
nmp.mk.file("5-svm", output_dir="./labs")         # ./labs/practical1.py
nmp.mk.file("5-svm", force=True)                  # overwrite
```

---

## ➕ Adding New Practicals

1. Drop the file in the subject folder, e.g. `src/nmp/templates/ai/kmeans.py`.
2. Register it in `src/nmp/mk.py` → `PRACTICALS["ai"]` (`"kmeans": ("P11 - K-Means", "kmeans.py")`).
3. If it needs a shared helper, add it to `EXTRA_FILES` under `("ai", "kmeans")`.
4. Reinstall.

## ➕ Adding A New Subject

1. Create `src/nmp/templates/<code>/` and add your `.py` files.
2. Add the label to `SUBJECTS` and the practicals to `PRACTICALS` in `src/nmp/mk.py`.
3. Reinstall. `nmp list` groups it automatically; `nmp create <code>.<slug>` works immediately.

---

## 📄 License

MIT — see the LICENSE file for details.
