# 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
* conversion between shapely and isoxml geometries
* conversion 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
Raw data
{
"_id": null,
"home_page": null,
"name": "isoxml",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "isoxml, isobus, iso, 11783-10, xml, precision farming",
"author": "Josephinum-Research",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/ee/9f/3fdb24c47efa4d9e608c96cda2cbd34adb111808a9e3546e585622e31acc/isoxml-0.0.4.tar.gz",
"platform": null,
"description": "# ISOXML library for python \n\na python library that handles import and export of ISOXML TaskData files as specified in ISO11783 part 10.\ninspired by [isoxml-js](https://github.com/dev4Agriculture/isoxml-js) and powered by [xsdata](https://github.com/tefra/xsdata) XML bindings.\n\nThe main features:\n* supports v3 and v4\n* read/write directly from zip, TASKDATA-dir or any string\n* conversion between shapely and isoxml geometries\n* conversion of numpy array to grid data binary files\n* [generate code](./examples/pycode_generator.py) from existing TASKDATA.XML (via xsdata)\n\n## Installation\n```\npip install isoxml\n```\n\n## Usage Examples\n\n### import\n\n```python\nfrom isoxml.util.isoxml_io import isoxml_from_zip\n\ntask_data, bin_data = isoxml_from_zip('/path/to/TASKDATA.zip')\n```\n\n### export\n\n```python\nimport isoxml.models.base.v4 as iso\nfrom isoxml.util.isoxml_io import isoxml_to_text\n\ncustomer = iso.Customer(\n id=\"CTR0001\",\n last_name=\"demo_customer\"\n)\nfarm = iso.Farm(\n id=\"FRM0001\",\n designator=\"demo farm\",\n customer_id_ref=customer.id\n)\ntask_data = iso.Iso11783TaskData(\n management_software_manufacturer=\"josephinum research\",\n management_software_version=\"0.0.0\",\n data_transfer_origin=iso.Iso11783TaskDataDataTransferOrigin.FMIS,\n customers=[customer],\n farms=[farm]\n)\n\nxml_content = isoxml_to_text(task_data)\n\nprint(xml_content)\n```\n\n```xml\n<ISO11783_TaskData VersionMajor=\"4\" VersionMinor=\"3\" ManagementSoftwareManufacturer=\"josephinum research\" ManagementSoftwareVersion=\"0.0.0\" DataTransferOrigin=\"1\">\n <CTR A=\"CTR0001\" B=\"demo_customer\"/>\n <FRM A=\"FRM0001\" B=\"demo farm\" I=\"CTR0001\"/>\n</ISO11783_TaskData>\n```\n\n### more\n\n[see examples](./examples)\n\n## Dependencies\n\n* [xsdata](https://github.com/tefra/xsdata) - Naive XML Bindings for python.\n* [shapely](https://github.com/shapely/shapely) - a widely used library for editing and analyzing geometric objects.\n* [numpy](https://github.com/numpy/numpy) - you know it, you love it\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Python ISOXML read/write",
"version": "0.0.4",
"project_urls": {
"Homepage": "https://github.com/Josephinum-Research/isoxml-py",
"Issues": "https://github.com/Josephinum-Research/isoxml-py/issues"
},
"split_keywords": [
"isoxml",
" isobus",
" iso",
" 11783-10",
" xml",
" precision farming"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8ba26809000c8c7d3665dd273ed169429cfa8158a631e405c614c405f3f780d7",
"md5": "09cb51af358f3d9de26e5b3fe962dc03",
"sha256": "0ca87ffecab64f559367c6535fc25a69541fdabb89e3dc7bf620474f49c34307"
},
"downloads": -1,
"filename": "isoxml-0.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "09cb51af358f3d9de26e5b3fe962dc03",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 96036,
"upload_time": "2024-10-25T12:36:33",
"upload_time_iso_8601": "2024-10-25T12:36:33.458127Z",
"url": "https://files.pythonhosted.org/packages/8b/a2/6809000c8c7d3665dd273ed169429cfa8158a631e405c614c405f3f780d7/isoxml-0.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ee9f3fdb24c47efa4d9e608c96cda2cbd34adb111808a9e3546e585622e31acc",
"md5": "f4cf33f08afdc5683069ca5586d11346",
"sha256": "eb218293a621a5ad1ee9c72fd428d4d965b9a6f69f6bbfe2044811fa6b6e0d9b"
},
"downloads": -1,
"filename": "isoxml-0.0.4.tar.gz",
"has_sig": false,
"md5_digest": "f4cf33f08afdc5683069ca5586d11346",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 51041,
"upload_time": "2024-10-25T12:36:34",
"upload_time_iso_8601": "2024-10-25T12:36:34.818744Z",
"url": "https://files.pythonhosted.org/packages/ee/9f/3fdb24c47efa4d9e608c96cda2cbd34adb111808a9e3546e585622e31acc/isoxml-0.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-25 12:36:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Josephinum-Research",
"github_project": "isoxml-py",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "isoxml"
}