From 14fa5424a30fe8a65ecfa0d777739e4d8492e29f Mon Sep 17 00:00:00 2001 From: Davide Brunato Date: Wed, 28 Aug 2019 09:13:26 +0200 Subject: [PATCH 1/3] Update publiccode.yml --- publiccode.yml | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/publiccode.yml b/publiccode.yml index 6690201..888e6bd 100644 --- a/publiccode.yml +++ b/publiccode.yml @@ -34,10 +34,9 @@ localisation: availableLanguages: - en it: + countryExtensionVersion: '0.2' riuso: codiceIPA: sissa - piattaforme: - spid: true description: en: genericName: elementpath @@ -46,24 +45,29 @@ description: shortDescription: >- Python library that provides XPath 1.0/2.0 parsers and selectors for ElementTree and lxml - longDescription: >+ + longDescription: > This is a library for Python 2.7/3.5+ that provides XPath 1.0 and 2.0 selectors for Python's ElementTree XML data structures, both for the - standard ElementTree library and for the lxml.etree library. - - - For [lxml.etree](http://lxml.de/) this package can be useful for providing - XPath 2.0 selectors, because [lxml.etree](http://lxml.de/) already has - it's own implementation of XPath 1.0. + standard **ElementTree** library and for the **lxml** library. For lxml + this package can be useful for providing XPath 2.0 selectors, because lxml + already has it's own implementation of XPath 1.0. ## Installation and usage - You can install the package with _pip_ in a Python 2.7 or Python 3.5+ environment: pip install elementpath + For using it import the package and apply the selectors on ElementTree + nodes: + + >>> import elementpath + >>> from xml.etree import ElementTree + >>> root = ElementTree.XML('') + >>> elementpath.select(root, '/A/B2/\*') [, , ] + + features: - XPath 1.0 and XPath 2.0 implementations From 1f3bd8265a166c1dc77a880d9fd3b1540a1ac6ae Mon Sep 17 00:00:00 2001 From: Davide Brunato Date: Wed, 28 Aug 2019 11:18:03 +0200 Subject: [PATCH 2/3] Update README.rst --- README.rst | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index e3259c0..853d123 100644 --- a/README.rst +++ b/README.rst @@ -21,11 +21,11 @@ You can install the package with *pip* in a Python 2.7 or Python 3.4+ environmen For using it import the package and apply the selectors on ElementTree nodes: - >>> import elementpath - >>> from xml.etree import ElementTree - >>> root = ElementTree.XML('') - >>> elementpath.select(root, '/A/B2/*') - [, , ] +>>> import elementpath +>>> from xml.etree import ElementTree +>>> root = ElementTree.XML('') +>>> elementpath.select(root, '/A/B2/*') +[, , ] The *select* API provides the standard XPath result format that is a list or an elementary datatype's value. If you want only to iterate over results you can use the generator function @@ -34,26 +34,25 @@ datatype's value. If you want only to iterate over results you can use the gener The selectors API works also using XML data trees based on the `lxml.etree `_ library: - >>> import elementpath - >>> import lxml.etree as etree - >>> root = etree.XML('') - >>> elementpath.select(root, '/A/B2/*') - [, , ] - +>>> import elementpath +>>> import lxml.etree as etree +>>> root = etree.XML('') +>>> elementpath.select(root, '/A/B2/*') +[, , ] When you need to apply the same XPath expression to several XML data you can also use the *Selector* class, creating an instance and then using it to apply the path on distinct XML data: - >>> import elementpath - >>> import lxml.etree as etree - >>> selector = elementpath.Selector('/A/*/*') - >>> root = etree.XML('') - >>> selector.select(root) - [, , ] - >>> root = etree.XML('') - >>> selector.select(root) - [, , , ] +>>> import elementpath +>>> import lxml.etree as etree +>>> selector = elementpath.Selector('/A/*/*') +>>> root = etree.XML('') +>>> selector.select(root) +[, , ] +>>> root = etree.XML('') +>>> selector.select(root) +[, , , ] Public API classes and functions are described into the `elementpath manual on the "Read the Docs" site `_. From a274289ebbb33ee30cf0abad3642c23b523803a4 Mon Sep 17 00:00:00 2001 From: libremente Date: Wed, 28 Aug 2019 11:28:58 +0200 Subject: [PATCH 3/3] Fix MIME type and description --- publiccode.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/publiccode.yml b/publiccode.yml index 888e6bd..ac98953 100644 --- a/publiccode.yml +++ b/publiccode.yml @@ -15,7 +15,7 @@ platforms: - mac softwareType: library inputTypes: - - XML + - text/XML categories: - data-analytics - data-collection @@ -57,17 +57,17 @@ description: You can install the package with _pip_ in a Python 2.7 or Python 3.5+ environment: - - pip install elementpath - + ~~~ + pip install elementpath + ~~~ For using it import the package and apply the selectors on ElementTree nodes: - - >>> import elementpath - >>> from xml.etree import ElementTree - >>> root = ElementTree.XML('') - >>> elementpath.select(root, '/A/B2/\*') [, , ] - + ~~~ + >>> import elementpath + >>> from xml.etree import ElementTree + >>> root = ElementTree.XML('') + >>> elementpath.select(root, '/A/B2/\*') [, , ] + ~~~ features: - XPath 1.0 and XPath 2.0 implementations