%global _empty_manifest_terminate_build 0
Name: python-elementpath
Version: 4.1.0
Release: 1
Summary: XPath 1.0/2.0/3.0/3.1 parsers and selectors for ElementTree and lxml
License: MIT
URL: https://github.com/sissaschool/elementpath
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ff/cf/0d6f2c642d156b884b8e626332ece1f5c7243376fd207ec4e7bca89ab978/elementpath-4.1.0.tar.gz
BuildArch: noarch
Requires: python3-tox
Requires: python3-coverage
Requires: python3-lxml
Requires: python3-xmlschema
Requires: python3-Sphinx
Requires: python3-memory-profiler
Requires: python3-memray
Requires: python3-flake8
Requires: python3-mypy
Requires: python3-lxml-stubs
%description
You can install the package with *pip* in a Python 3.7+ 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/*')
[, , ]
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
*iter_select* that accepts the same arguments of *select*.
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/*')
[, , ]
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)
[, , , ]
Public API classes and functions are described into the
`elementpath manual on the "Read the Docs" site `_.
For default the XPath 2.0 is used. If you need XPath 1.0 parser provide the *parser* argument:
>>> from elementpath import select, XPath1Parser
>>> from xml.etree import ElementTree
>>> root = ElementTree.XML('')
>>> select(root, '/A/B2/*', parser=XPath1Parser)
[, , ]
For XPath 3.0/3.1 import the parser from *elementpath.xpath3* subpackage, that is not loaded
for default:
>>> from elementpath.xpath3 import XPath3Parser
>>> select(root, 'math:atan(1.0e0)', parser=XPath3Parser)
0.7853981633974483
Note: *XPath3Parser* is an alias of *XPath31Parser*.
If you need only XPath 3.0 you can also use a more specific subpackage,
avoiding the loading of XPath 3.1 implementation:
>>> from elementpath.xpath30 import XPath30Parser
>>> select(root, 'math:atan(1.0e0)', parser=XPath30Parser)
0.7853981633974483
%package -n python3-elementpath
Summary: XPath 1.0/2.0/3.0/3.1 parsers and selectors for ElementTree and lxml
Provides: python-elementpath
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-elementpath
You can install the package with *pip* in a Python 3.7+ 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/*')
[, , ]
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
*iter_select* that accepts the same arguments of *select*.
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/*')
[, , ]
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)
[, , , ]
Public API classes and functions are described into the
`elementpath manual on the "Read the Docs" site `_.
For default the XPath 2.0 is used. If you need XPath 1.0 parser provide the *parser* argument:
>>> from elementpath import select, XPath1Parser
>>> from xml.etree import ElementTree
>>> root = ElementTree.XML('')
>>> select(root, '/A/B2/*', parser=XPath1Parser)
[, , ]
For XPath 3.0/3.1 import the parser from *elementpath.xpath3* subpackage, that is not loaded
for default:
>>> from elementpath.xpath3 import XPath3Parser
>>> select(root, 'math:atan(1.0e0)', parser=XPath3Parser)
0.7853981633974483
Note: *XPath3Parser* is an alias of *XPath31Parser*.
If you need only XPath 3.0 you can also use a more specific subpackage,
avoiding the loading of XPath 3.1 implementation:
>>> from elementpath.xpath30 import XPath30Parser
>>> select(root, 'math:atan(1.0e0)', parser=XPath30Parser)
0.7853981633974483
%package help
Summary: Development documents and examples for elementpath
Provides: python3-elementpath-doc
%description help
You can install the package with *pip* in a Python 3.7+ 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/*')
[, , ]
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
*iter_select* that accepts the same arguments of *select*.
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/*')
[, , ]
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)
[, , , ]
Public API classes and functions are described into the
`elementpath manual on the "Read the Docs" site `_.
For default the XPath 2.0 is used. If you need XPath 1.0 parser provide the *parser* argument:
>>> from elementpath import select, XPath1Parser
>>> from xml.etree import ElementTree
>>> root = ElementTree.XML('')
>>> select(root, '/A/B2/*', parser=XPath1Parser)
[, , ]
For XPath 3.0/3.1 import the parser from *elementpath.xpath3* subpackage, that is not loaded
for default:
>>> from elementpath.xpath3 import XPath3Parser
>>> select(root, 'math:atan(1.0e0)', parser=XPath3Parser)
0.7853981633974483
Note: *XPath3Parser* is an alias of *XPath31Parser*.
If you need only XPath 3.0 you can also use a more specific subpackage,
avoiding the loading of XPath 3.1 implementation:
>>> from elementpath.xpath30 import XPath30Parser
>>> select(root, 'math:atan(1.0e0)', parser=XPath30Parser)
0.7853981633974483
%prep
%autosetup -n elementpath-4.1.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-elementpath -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Mon Apr 10 2023 Python_Bot - 4.1.0-1
- Package Spec generated