# 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
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/c4/37/168dd90aa15fc1978f3bec7578dcd54434a7356547797117875e2fbf9b41/isoxml-0.0.2.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* convertion between shapely and isoxml geometries\n* convertion 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.2",
"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": "6e078c8c9c6616b3f09a5324e74b9080b7b48576f1a9217f7d29ae653784944f",
"md5": "02ad5dccdcbd59db6fa20b7e0617da71",
"sha256": "ce7b2d1bfa86167b730fd74397fa96937d3bea3d4d02621a92059cc9c180b73d"
},
"downloads": -1,
"filename": "isoxml-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "02ad5dccdcbd59db6fa20b7e0617da71",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 92479,
"upload_time": "2024-10-01T14:59:44",
"upload_time_iso_8601": "2024-10-01T14:59:44.014961Z",
"url": "https://files.pythonhosted.org/packages/6e/07/8c8c9c6616b3f09a5324e74b9080b7b48576f1a9217f7d29ae653784944f/isoxml-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c437168dd90aa15fc1978f3bec7578dcd54434a7356547797117875e2fbf9b41",
"md5": "6890c56df39934eb426876d778b7abc4",
"sha256": "44374d7622c0d2b27f71a2f3ad1668352e6679a4931ed449089f498e85451628"
},
"downloads": -1,
"filename": "isoxml-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "6890c56df39934eb426876d778b7abc4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 48012,
"upload_time": "2024-10-01T14:59:45",
"upload_time_iso_8601": "2024-10-01T14:59:45.831668Z",
"url": "https://files.pythonhosted.org/packages/c4/37/168dd90aa15fc1978f3bec7578dcd54434a7356547797117875e2fbf9b41/isoxml-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-01 14:59:45",
"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"
}