diff --git a/CHANGELOG.md b/CHANGELOG.md index fa7ebd9..73f9523 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 0.8.0 - 2026-07-07 ### Changed diff --git a/README.md b/README.md index a3f4178..1709dda 100644 --- a/README.md +++ b/README.md @@ -9,75 +9,19 @@ [pugixml](http://pugixml.org/) is a light-weight C++ XML processing library. It features: -- DOM-like interface with rich traversal/modification capabilities -- [Extremely fast](https://pugixml.org/benchmark.html) non-validating XML parser which constructs the DOM tree from an XML file/buffer -- XPath 1.0 implementation for complex data-driven tree queries -- Full Unicode support with Unicode interface variants and automatic encoding conversions +> - DOM-like interface with rich traversal/modification capabilities +> - [Extremely fast](https://pugixml.org/benchmark.html) non-validating XML parser which constructs the DOM tree from > an XML file/buffer +> - XPath 1.0 implementation for complex data-driven tree queries +> - Full Unicode support with Unicode interface variants and automatic encoding conversions ## Documentation - pugixml-python - [API Reference](https://miute.github.io/pugixml-python/) - pugixml - - [Quick-start guide](https://pugixml.org/docs/quickstart.html) + - [Quick start guide](https://pugixml.org/docs/quickstart.html) - [Reference manual](https://pugixml.org/docs/manual.html) -## Example - -Loading XML document from file: - -```python -from pugixml import pugi -doc = pugi.XMLDocument() -result = doc.load_file('xgconsole.xml') -if not result: - print('parse error: status=%r description=%r' % (result.status, result.description())) -``` - -Searching for nodes/attributes with predicates: - -```python -tools = doc.child('Profile').child('Tools') - -# Find child via predicate (looks for direct children only) -node = tools.find_child(lambda x: x.attribute('AllowRemote').as_bool()) -print(node.attribute('Filename').value()) - -# Find node via predicate (looks for all descendants in depth-first order) -node = doc.find_node(lambda x: x.attribute('AllowRemote').as_bool()) -print(node.attribute('Filename').value()) - -# Find attribute via predicate -attr = tools.last_child().find_attribute(lambda x: x.name() == 'AllowRemote') -print(attr.value()) -``` - -Selecting nodes via XPath expression: - -```python -tools = doc.select_nodes('/Profile/Tools/Tool[@AllowRemote="true" and @DeriveCaptionFrom="lastparam"]') -for tool in tools: - print(tool.node().attribute('Filename').value()) -``` - -Using query objects and variables: - -```python -varset = pugi.XPathVariableSet() -var = varset.add('remote', pugi.XPATH_TYPE_BOOLEAN) -query_remote_tools = pugi.XPathQuery('/Profile/Tools/Tool[@AllowRemote = string($remote)]', varset) - -var.set(True) -tools_remote = query_remote_tools.evaluate_node_set(doc) -for tool in tools_remote: - tool.node().print(pugi.PrintWriter()) - -var.set(False) -tools_local = query_remote_tools.evaluate_node_set(doc) -for tool in tools_local: - tool.node().print(pugi.PrintWriter()) -``` - ## Installation ### Installing a package from PyPI @@ -89,7 +33,7 @@ pip install pugixml ### Building a package from source - Requirements: - - C++17 compatible compiler (see [supported compilers](https://github.com/pybind/pybind11#supported-compilers)) + - C++17 compatible compiler (see [supported compilers](https://github.com/pybind/pybind11#supported-platforms--compilers)) - [CMake](https://cmake.org/) ≥ 3.15 - Installing a package from PyPI: diff --git a/pyproject.toml b/pyproject.toml index a81652d..8efece3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pugixml" -version = "0.8.0.dev2" +version = "0.8.0" description = "Light-weight, simple and fast XML parser with XPath support" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.10" diff --git a/uv.lock b/uv.lock index 98b3fbb..f0c5dd0 100644 --- a/uv.lock +++ b/uv.lock @@ -424,7 +424,7 @@ wheels = [ [[package]] name = "pugixml" -version = "0.8.0.dev2" +version = "0.8.0" source = { virtual = "." } [package.dev-dependencies] @@ -824,11 +824,11 @@ wheels = [ [[package]] name = "typing-extensions" -version = "4.15.0" +version = "4.16.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } +sdist = { url = "https://files.pythonhosted.org/packages/f6/cc/6253133b5bb138fc3306cebfbda2c520f545d36b5be2c7255cc528bb45d6/typing_extensions-4.16.0.tar.gz", hash = "sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5", size = 113555, upload-time = "2026-07-02T08:40:05.92Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, + { url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" }, ] [[package]]