-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
337 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
version: 2 | ||
|
||
build: | ||
image: latest | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.11" | ||
|
||
mkdocs: | ||
configuration: mkdocs.yml | ||
|
||
python: | ||
version: 3.8 | ||
pip_install: true | ||
extra_requirements: | ||
- docs,cli | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs,cli |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## 23.8 (2023-08-12) | ||
|
||
- Removed python 3.6 and 3.7 support | ||
- Added official support for 3.11 and 3.12 | ||
- Set xsdata minimum version v23.5 | ||
|
||
## 21.11 (2021-11-02) | ||
|
||
- Fixed dataclass.unsafe_hash mapping to attrs.hash property | ||
[#7](https://github.com/tefra/xsdata-attrs/issues/7) | ||
|
||
## 21.8 (2021-08-03) | ||
|
||
- | ||
- Initial Release |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
[](https://xsdata-attrs.readthedocs.io/) | ||
|
||
# xsdata powered by attrs! | ||
|
||
[](https://github.com/tefra/xsdata-attrs/actions) | ||
[](https://xsdata-attrs.readthedocs.io/) | ||
[](https://codecov.io/gh/tefra/xsdata-attrs) | ||
[](https://xsdata-attrs.readthedocs.io/) | ||
[](https://www.codefactor.io/repository/github/tefra/xsdata-attrs) | ||
[](https://pypi.org/pypi/xsdata-attrs/) | ||
[](https://pypi.org/pypi/xsdata-attrs/) | ||
|
||
--- | ||
|
||
xsData is a complete data binding library for python allowing developers to access and | ||
use XML and JSON documents as simple objects rather than using DOM. | ||
|
||
Now powered by attrs! | ||
|
||
```console | ||
$ xsdata http://rss.cnn.com/rss/edition.rss --output attrs | ||
Parsing document edition.rss | ||
Analyzer input: 9 main and 0 inner classes | ||
Analyzer output: 9 main and 0 inner classes | ||
Generating package: init | ||
Generating package: generated.rss | ||
``` | ||
|
||
```python | ||
@attr.s | ||
class Rss: | ||
class Meta: | ||
name = "rss" | ||
|
||
version: Optional[float] = attr.ib( | ||
default=None, | ||
metadata={ | ||
"type": "Attribute", | ||
} | ||
) | ||
channel: Optional[Channel] = attr.ib( | ||
default=None, | ||
metadata={ | ||
"type": "Element", | ||
} | ||
) | ||
``` | ||
|
||
```console | ||
|
||
>>> from xsdata_attrs.bindings import XmlParser | ||
>>> from urllib.request import urlopen | ||
>>> from generated.rss import Rss | ||
>>> | ||
>>> parser = XmlParser() | ||
>>> with urlopen("http://rss.cnn.com/rss/edition.rss") as rq: | ||
... result = parser.parse(rq, Rss) | ||
... | ||
>>> result.channel.item[2].title | ||
'Vatican indicts 10 people, including a Cardinal, over an international financial scandal' | ||
>>> result.channel.item[2].pub_date | ||
'Sat, 03 Jul 2021 16:37:14 GMT' | ||
>>> result.channel.item[2].link | ||
'https://www.cnn.com/2021/07/03/europe/vatican-financial-scandal-intl/index.html' | ||
|
||
``` | ||
|
||
## Changelog: 24.3 (2024-03-10) | ||
|
||
--- | ||
|
||
- Updated |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Data Bindings | ||
|
||
All the xsdata | ||
[data bindings](https://xsdata.readthedocs.io/en/latest/data_binding/basics/) are | ||
available. There is an extra requirement to specify the class type of the data models to | ||
the [XmlContext][xsdata.formats.dataclass.context.XmlContext] that among other stuff | ||
also acts as a compatibility layer between dataclasses and attrs models. | ||
|
||
## Specify ClassType | ||
|
||
```python | ||
>>> from xsdata.formats.dataclass.parsers import XmlParser | ||
>>> from xsdata.formats.dataclass.parsers import JsonParser | ||
>>> from xsdata.formats.dataclass.serializers import XmlSerializer | ||
>>> from xsdata.formats.dataclass.serializers import JsonSerializer | ||
>>> from xsdata.formats.dataclass.context import XmlContext | ||
... | ||
>>> context = XmlContext(class_type="attrs") # Specify class type attrs | ||
>>> xml_parser = XmlParser(context=context) | ||
>>> xml_serializer = XmlSerializer(context=context) | ||
>>> json_parser = JsonParser(context=context) | ||
>>> json_serializer = JsonSerializer(context=context) | ||
``` | ||
|
||
## Binding Shortcuts | ||
|
||
For convenience this plugin comes with subclasses for all the xsdata binding modules | ||
with the attrs context auto initialized. | ||
|
||
```python | ||
>>> from xsdata_attrs.bindings import XmlContext | ||
>>> from xsdata_attrs.bindings import XmlParser | ||
>>> from xsdata_attrs.bindings import XmlSerializer | ||
>>> from xsdata_attrs.bindings import JsonParser | ||
>>> from xsdata_attrs.bindings import JsonSerializer | ||
>>> from xsdata_attrs.bindings import UserXmlParser | ||
>>> from xsdata_attrs.bindings import TreeParser | ||
>>> from xsdata_attrs.bindings import PycodeSerializer | ||
>>> from xsdata_attrs.bindings import DictDecoder | ||
>>> from xsdata_attrs.bindings import DictEncoder | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Changelog | ||
|
||
--8<-- "CHANGES.md" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.