All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
For the purpose of determining breaking changes:
- Only direct imports from top-level module
bigxml
are considered public API - A change that only impacts type hints validation is not considered a breaking change
- Removing support for a version of Python that is not officially supported anymore is not considered a breaking change
1.1.0 - 2024-10-10
This release adds support for the buffer protocol. It was working already in previous versions, but now it's official.
- Add support for buffer protocol (PEP 688)
- End of Python 3.8 support
- Add tests for CPython 3.13
- Use CPython 3.13 for misc. tests
- Upgrade dev dependencies
1.0.1 - 2024-04-27
This is a maintenance release. Internal tooling is being upgraded, featuring support for pytest version 8 and formatting of the codebase with ruff.
- Change code formatter from black to ruff
- Fix doctests not being run with other tests
- Fix coverage report under some versions of PyPy
- Upgrade dev dependencies
- Remove pylint, assuming its benefits are provided by the ruff+mypy combo
- Use trusted publishing for PyPi releases
1.0.0 - 2023-10-21
Let's celebrate version 1! π We know that bigxml
has already been used in
production for years, but now it's official.
- Improve documentation about usage with
requests
- Export
Streamable
andXMLElementAttributes
to ease type hints - Be explicit about what is part of the public API
- End of Python 3.7 support
- Necessary code changes following dev dependency update: mypy, ruff
- Use
pyproject.toml
and modern build system - Improve tox & CI pipelines
- Add tests for PyPy 3.10
- Add tests for CPython 3.12
- Use CPython 3.12 for misc. tests
- Freeze dev dependencies
0.10.0 - 2023-04-22
- Renamed the base class for exceptions to
BigXmlError
in conformance with PEP8
- Add documentation to explain how to import the library
- Warnings due to wrong usage are now using
UserWarning
instead ofRuntimeWarning
- Undocumented parameter
insecurely_allow_entities
toParser
- Necessary code changes following dev dependency update: mypy
- Use ruff for linting (and remove isort)
0.9.0 - 2022-11-06
v0.9.0 introduces custom exceptions.
- All exceptions raised due to invalid stream content are now instances of
BigXmlException
instead ofxml.etree.ElementTree.ParseError
ordefusedxml.DefusedXmlException
.
- Add a workaround against pylint
not-an-iterable
false-positive oniter_from
- Necessary code changes following dev dependency update: mypy, pylint, pytest
- Add tests for CPython 3.11
- Use CPython 3.11 for misc. tests
- Update Github actions dependencies
0.8.0 - 2022-08-28
v0.8.0 brings type hints!
- Fix an edge case when a class decorated with
xml_handle_text
has an attribute decorated withxml_handle_element
- Type hints
- New export:
HandlerTypeHelper
that can help with type hints in some cases - Sanity check on
xml_handler
method of class handlers for returned values (None
or an iterable)
- End of Python 3.6 support
- Add tests for PyPy 3.9
- Refactor handler creator code
- Type validation with mypy
- Distribute
py.typed
file in conformance with PEP 561 - Update
typing-extensions
dependency
0.7.0 - 2022-01-15
v0.7.0 improves dependencies requirements.
- Don't use upper bound constraints on dependencies
- Specify the Python versions required in package metadata
- Improving memory consumption tests by using
tracemalloc
instead ofresource
0.6.1 - 2022-01-01
v0.6.1 is a minor release.
- Don't deploy src dir for docs
- Fix minor issues found by automated tools
- Add tests for CPython 3.10 and PyPy 3.8
- Use CPython 3.10 for misc. tests
- Clarify which Python versions are supported in docs
- Update
dataclasses
dependency (Python 3.6 only)
0.6.0 - 2021-03-21
v0.6.0 adds documentation!
- Classes as handlers without a
xml_handler
method now yield the instance instead of items yielded by sub-handlers
- An exception was raised when using a class handlers without any sub-handler attributes
- Fix an error in some Python version for class handlers extending some builtins without
redefining
__init__
- Add detailed documentation, available online at https://bigxml.rogdham.net/
- Test against some XML attacks
- Tests are now run in Python Development Mode
- Update
defusedxml
dependency
0.5.0 - 2021-03-01
v0.5.0 allows more stream types to be parsed.
Parser
can not longer be instantiated with a file-like object opened in text mode, nor with a filename- Removed
stream
attribute fromParser
instances
Parser
can now be instantiated with several streams as arguments: in that case the streams are concatenated: after the end of a stream, data is taken from the next one- More variety in stream types passed as argument of
Parser
:- File-like objects opened in binary mode (was already supported before)
- Bytes-like objects (e.g.
bytes
orbytearray
instances) - Iterable of previous types (recursively)
0.4.0 - 2021-02-14
v0.4.0 is a major refactor in handler types.
XMLHandler
has been removed: class handlers don't need to inherit from it anymorereturn_from
now returns the last yielded item instead of the handlerHandleMgr
no longer has the confusingset_handle
method
- Several handlers can now be passed to
return_from
/iter_from
- More handler variety:
- Regular functions
str
/tuple
/list
are syntactic sugar for a handler marked with that value, which simply yields the node- Classes are instantiated on the fly (if
__init__
has one mandatory parameter, the node is passed during instantiation); in that case, axml_handler
method can be defined to customize the way yielded items are handled
- It is now possible to use directly
@xml_handle_text
in place of@xml_handle_text()
- Python 3.9 support
0.3.0 - 2020-09-27
v0.3.0 improves namespace support.
XMLElement
'snamespace
attribute is now an empty string instead ofNone
when the node has no namespace
- Better namespace support in
XMLElement
's attributes - Namespace support in
xml_handle_*
- More readable
__str__
values forXMLElement
andXMLText
- Fix
xml_handle_*
when wrappingstaticmethod
(other way around was already working properly)
0.2.0 - 2020-09-06
v0.2.0 changes the API to makes iter_from
and return_from
methods available on both
Parser
and XMLElement
instances.
XMLElement
'shandle
method is renamed toiter_from
- The
parse
function has been removed in favour of the newParser
class; useParser(stream).iter_from(handler)
instead ofparse(stream, handler)
XMLElement
now has atext
property to walk through all children and gather texts regardless of the tagsXMLElement
newreturn_from
method can be used when there are no items yielded by the handler- PyPy support
- An exception is now raised when a node is accessed out of order; this avoids
inconsistent behaviors in some cases, and replaces the obscure
No handle to use
exception in other cases
- Add changelog file
0.1.0 - 2020-08-23
- Initial public release π