Metadata-Version: 2.4
Name: mustatilcore
Version: 0.1.0
Summary: Universal object detection core backend extracted from Mustatil.
Author: Tarek Wasfy
License: MIT License
        
        Copyright (c) 2026 Tarek Wasfy
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/tarekwasfy01/Mustatil-YOLO-AI-Model-Trainer-
Project-URL: Repository, https://github.com/tarekwasfy01/Mustatil-YOLO-AI-Model-Trainer-
Project-URL: Issues, https://github.com/tarekwasfy01/Mustatil-YOLO-AI-Model-Trainer-/issues
Keywords: object-detection,computer-vision,geospatial-ai,gis,geotiff,satellite-imagery,remote-sensing,archaeology,cultural-heritage,yolo,rfdetr,dino
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Image Recognition
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Requires-Python: <3.13,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=5.0; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Provides-Extra: yolo
Requires-Dist: ultralytics>=8.0; extra == "yolo"
Provides-Extra: gis
Requires-Dist: shapely>=2.0; extra == "gis"
Requires-Dist: pyproj>=3.6; extra == "gis"
Requires-Dist: geopandas>=0.14; extra == "gis"
Requires-Dist: rasterio>=1.3; extra == "gis"
Provides-Extra: vision
Requires-Dist: numpy>=1.24; extra == "vision"
Requires-Dist: pillow>=10.0; extra == "vision"
Requires-Dist: opencv-python>=4.8; extra == "vision"
Dynamic: license-file

# mustatilcore

`mustatilcore` is a small PyPI-ready wrapper for a GUI-free `mustatil_core.py` backend.

Use this template when you want to publish the functional Mustatil backend as a Python package with a CLI command:

```powershell
pip install mustatilcore
mustatilcore info
```

## 1. Put your backend file here

Copy your real backend into:

```text
src/mustatilcore/mustatil_core.py
```

Replace the placeholder file already included in this template.

Your file should be GUI-free. Remove or guard anything that opens Tkinter, PySide, Qt, file dialogs, message boxes, or windows on import.

Good:

```python
def detect_image(input_path, model=None, output_path=None, device="cpu", confidence=0.25):
    ...
```

Bad on import:

```python
root = Tk()
root.mainloop()
```

## 2. Install locally for testing

From the project root:

```powershell
py -m pip install -U pip
py -m pip install -e ".[dev]"
mustatilcore info
mustatilcore functions
```

## 3. Generic CLI usage

List exported functions from `mustatil_core.py`:

```powershell
mustatilcore functions
```

Call any function by name:

```powershell
mustatilcore call my_function --args-json "[1, 2]" --kwargs-json "{\"option\": true}"
```

Run an existing `main()` or `cli_main()` inside your backend:

```powershell
mustatilcore run -- --your-backend-arg value
```

Detection convenience wrappers are included. They automatically look for likely function names in your backend.

```powershell
mustatilcore detect-image image.jpg --model best.pt --out detections.json --device cpu --conf 0.5
mustatilcore detect-raster area.tif --model best.pt --out detections.gpkg --tile 1024 --overlap 160
mustatilcore train-yolo --data dataset.yaml --epochs 100 --device cuda
```

## 4. Build package

```powershell
.\scripts\build_package.ps1
```

This creates:

```text
dist/*.whl
dist/*.tar.gz
```

## 5. Upload to TestPyPI first

```powershell
.\scripts\upload_testpypi.ps1
```

Install from TestPyPI:

```powershell
py -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple mustatilcore
```

## 6. Upload to real PyPI

Only after TestPyPI works:

```powershell
.\scripts\upload_pypi.ps1
```

For token login with Twine:

```text
username: __token__
password: pypi-...
```

## Notes for Torch/CUDA

Do not add `torch` as a normal dependency unless you are sure. For CUDA builds, install the correct Torch build manually first. This prevents pip from replacing a working CUDA Torch installation with a CPU-only build.

## Minimal Python API

```python
from mustatilcore import load_core

core = load_core()
print(core)
```

You can also import your backend directly:

```python
from mustatilcore import mustatil_core
```
