Metadata-Version: 2.4
Name: iotpack
Version: 0.2.0
Summary: A simple Python generator for MQTT and CoAP IoT projects
Author: Your Name
License-Expression: MIT
Keywords: iot,mqtt,coap,supabase,streamlit
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# iotpack

A simple Python package that generates complete IoT projects using MQTT and CoAP.

## Installation

```
pip install iotpack
```

## Usage

```python
import iotpack

iotpack.mqtt()     # asks for table name and fields
iotpack.coap()
```

You can also pass them directly (no questions asked):

```python
iotpack.mqtt("weather", "temperature,humidity")
iotpack.coap("farm", "soil_moisture,ph,pump:bool")
```

Fields are comma separated. Default type is `float`; add `:int`, `:text` or `:bool`
to change it (e.g. `status:text,count:int`). `id` and `created_at` are added automatically.

Optional arguments: `topic=` (MQTT), `resource=` (CoAP), `folder=`.

Command line:

```
iotpack mqtt --table weather --fields temperature,humidity
```

## Generated Files

Each protocol creates a folder (`mqtt/` or `coap/`) with five files:

- client.py
- server.py
- dashboard.py
- requirements.txt
- schema.sql  (the Supabase table matching your fields)

## Quick start

```
cd mqtt
pip install -r requirements.txt
set SUPABASE_URL=your-url        (Windows)   |   export SUPABASE_URL=your-url   (Mac/Linux)
set SUPABASE_KEY=your-key        (Windows)   |   export SUPABASE_KEY=your-key   (Mac/Linux)
python server.py
python client.py
streamlit run dashboard.py
```

## Supabase table

Run the generated `schema.sql` once in the Supabase SQL editor (it is also printed
when you run `iotpack.mqtt()` / `iotpack.coap()`).

## Features

- MQTT client and server
- CoAP client and server
- Supabase database integration
- Streamlit dashboard
- Custom table name and fields
- Automatic requirements and SQL generation

## License

MIT
