msgspec-xml 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/PKG-INFO +1 -1
  2. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/msgspec_xml/__init__.py +1 -1
  3. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/msgspec_xml/encoder.py +4 -1
  4. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/tests/resources/test-03.xml +1 -1
  5. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/tests/test_roundtrip.py +1 -0
  6. msgspec_xml-0.2.0/msgspec-xml.zip +0 -0
  7. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/.gitattributes +0 -0
  8. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/.gitignore +0 -0
  9. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/.pre-commit-config.yaml +0 -0
  10. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/LICENSE +0 -0
  11. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/README.md +0 -0
  12. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/msgspec_xml/decoder.py +0 -0
  13. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/msgspec_xml/introspection.py +0 -0
  14. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/msgspec_xml/metadata.py +0 -0
  15. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/pdm.toml +0 -0
  16. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/pylock.toml +0 -0
  17. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/pyproject.toml +0 -0
  18. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/renovate.json +0 -0
  19. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/tests/__init__.py +0 -0
  20. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/tests/resources/test-01.xml +0 -0
  21. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/tests/resources/test-02.xml +0 -0
  22. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/tests/resources/test-04.xml +0 -0
  23. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/tests/test_metadata.py +0 -0
  24. {msgspec_xml-0.2.0 → msgspec_xml-0.2.1}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: msgspec-xml
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: XML Serialization/Deserialization using msgspec
5
5
  Project-URL: Homepage, https://pypi.org/project/msgspec-xml
6
6
  Project-URL: Issues, https://codefloe.com/buriedincode/msgspec-xml/issues
@@ -1,5 +1,5 @@
1
1
  __all__ = ["XML", "Decoder", "Encoder", "decode", "encode"]
2
- __version__ = "0.2.0"
2
+ __version__ = "0.2.1"
3
3
 
4
4
  from msgspec_xml.decoder import Decoder, decode
5
5
  from msgspec_xml.encoder import Encoder, encode
@@ -106,4 +106,7 @@ def _encode_list(
106
106
 
107
107
 
108
108
  def _stringify(value: object) -> str:
109
- return str(to_builtins(value))
109
+ value = to_builtins(value)
110
+ if isinstance(value, bool):
111
+ return "true" if value else "false"
112
+ return str(value)
@@ -1,4 +1,4 @@
1
- <Product>
1
+ <Product has-stock="true">
2
2
  <Name>Book</Name>
3
3
  <Prices>
4
4
  <Price currency="USD">3.99</Price>
@@ -25,6 +25,7 @@ class Price(Struct):
25
25
 
26
26
 
27
27
  class Product(Struct, rename="pascal"):
28
+ has_stock: Annotated[bool, XML(attr=True, tag="has-stock")]
28
29
  name: str
29
30
  prices: Annotated[list[Price], XML(wrapper="Prices", tag="Price")]
30
31
 
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes