Menu

Developers Italia Sviluppiamo i servizi pubblici, insieme

Seguici su

elementpath v4.4.0

elementpath

Python library that provides XPath 1.0/2.0/3.0/3.1 parsers and selectors for ElementTree and lxml

Vitalità:

77%

i

L’indice di vitalità, così come previsto nelle linee guida sull’acquisizione e riuso di software per la PA, è calcolato prendendo in considerazione le seguenti quattro categorie:

  • Code activity: il numero di commit e merge giornalieri;
  • Release history: il numero di release giornaliere;
  • User community: il numero di autori unici;
  • Longevity: l’età del progetto.

I range di ogni misura possono essere trovati nel file vitality-ranges.yml.

Stato di sviluppo: stabile


Funzionalità del software

XPath 1.0, XPath 2.0, XPath 3.0 and XPath 3.1 implementations

Informazioni di dettaglio

elementpath v4.4.0

elementpath

Ultimo rilascio 2024-03-11 (v4.4.0)

Tipo di manutenzione internal

Documentazione API elementpath API

Descrizione estesa

This is a library for Python 3.7+ that provides XPath 1.0, 2.0, 3.0 and 3.1 selectors for Python’s ElementTree XML data structures, both for the 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 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('<A><B1/><B2><C1/><C2/><C3/></B2></A>')
>>> elementpath.select(root, '/A/B2/\*') [<Element 'C1' at ...>, <Element'C2' at ...>, <Element 'C3' at ...>]

torna all'inizio dei contenuti