Metadata-Version: 2.1
Name: sol-orm-lib
Version: 0.4.6
Summary: 
Home-page: https://github.com/idener/SOL-Python-ORM-Library
Author: Antonio Gomez
Author-email: antonio.gomez@idener.es
Requires-Python: >=3.8,<4.0
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
Requires-Dist: loguru (>=0.7.0,<0.8.0)
Requires-Dist: mysql-connector-python (>=8.2.0,<9.0.0)
Requires-Dist: pydantic (>=1.10.9,<2)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Project-URL: Repository, https://github.com/idener/SOL-Python-ORM-Library
Description-Content-Type: text/markdown

# SOL Python ORM Library

## Installation
```
pip install sol-orm-lib
```

## Example usage
```python
from sol_orm_lib.models import *
from sol_orm_lib.sol_orm import SolORM

# Instantiate SolORM object
db = SolORM("https://db-api.sol.idener.es")

# Create an object 
mw = MeasuredWeather(
    rad_ar=27.2,
    temp_ar=39,
    wind_ar=12,
    timestamp=current_milli_time(),
)

# Add it to the DB
response = db.add_entity(mw)
print(response)
```

### Local ORM
```python
from sol_orm_lib.models import *
from sol_orm_lib.sol_local_orm import SolLocalORM

db = SolLocalORM(host="100.91.35.146", port=3306, db="bcm", user="bcm", password="bcm", debug=True)

ent = StorageStatusTAC(
    k=1,
    n=2,
    storageActual=3,
    storageActualKwh=4,
    storageInverterRealised=5,
    storageMax=6
)

db.add_entity(ent)
result = db.get_last_entity(StorageStatusTAC)
print(result)
```

## Release process
To release a new version of the package, update the version number in the `pyproject.toml` file and publish a release with the same tag. The CI will build and publish the package to PyPI.

