Metadata-Version: 2.1
Name: isoxml
Version: 0.0.2
Summary: Python ISOXML read/write
Author: Josephinum-Research
License: Apache License 2.0
Project-URL: Homepage, https://github.com/Josephinum-Research/isoxml-py
Project-URL: Issues, https://github.com/Josephinum-Research/isoxml-py/issues
Keywords: isoxml,isobus,iso,11783-10,xml,precision farming
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: xsdata>=24.7
Requires-Dist: numpy>=1.26
Requires-Dist: shapely>=2.0
Provides-Extra: dev
Requires-Dist: xsdata[cli]; extra == "dev"
Requires-Dist: geopandas; extra == "dev"
Requires-Dist: xmlschema; extra == "dev"
Requires-Dist: jupyter; extra == "dev"
Requires-Dist: folium; extra == "dev"
Requires-Dist: matplotlib; extra == "dev"
Requires-Dist: mapclassify; extra == "dev"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: xmlschema; extra == "test"

# ISOXML library for python 

a python library that handles import and export of ISOXML TaskData files as specified in ISO11783 part 10.
inspired by [isoxml-js](https://github.com/dev4Agriculture/isoxml-js) and powered by [xsdata](https://github.com/tefra/xsdata) XML bindings.

The main features:
* supports v3 and v4
* read/write directly from zip, TASKDATA-dir or any string
* convertion between shapely and isoxml geometries
* convertion of numpy array to grid data binary files
* [generate code](./examples/pycode_generator.py) from existing TASKDATA.XML (via xsdata)

## Installation
```
pip install isoxml
```

## Usage Examples

### import

```python
from isoxml.util.isoxml_io import isoxml_from_zip

task_data, bin_data = isoxml_from_zip('/path/to/TASKDATA.zip')
```

### export

```python
import isoxml.models.base.v4 as iso
from isoxml.util.isoxml_io import isoxml_to_text

customer = iso.Customer(
    id="CTR0001",
    last_name="demo_customer"
)
farm = iso.Farm(
    id="FRM0001",
    designator="demo farm",
    customer_id_ref=customer.id
)
task_data = iso.Iso11783TaskData(
    management_software_manufacturer="josephinum research",
    management_software_version="0.0.0",
    data_transfer_origin=iso.Iso11783TaskDataDataTransferOrigin.FMIS,
    customers=[customer],
    farms=[farm]
)

xml_content = isoxml_to_text(task_data)

print(xml_content)
```

```xml
<ISO11783_TaskData VersionMajor="4" VersionMinor="3" ManagementSoftwareManufacturer="josephinum research" ManagementSoftwareVersion="0.0.0" DataTransferOrigin="1">
    <CTR A="CTR0001" B="demo_customer"/>
    <FRM A="FRM0001" B="demo farm" I="CTR0001"/>
</ISO11783_TaskData>
```

### more

[see examples](./examples)

## Dependencies

* [xsdata](https://github.com/tefra/xsdata) - Naive XML Bindings for python.
* [shapely](https://github.com/shapely/shapely) - a widely used library for editing and analyzing geometric objects.
* [numpy](https://github.com/numpy/numpy) - you know it, you love it
