Skip to main content

Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API.

Project description

lxml is a Pythonic, mature binding for the libxml2 and libxslt libraries. It provides safe and convenient access to these libraries using the ElementTree API.

It extends the ElementTree API significantly to offer support for XPath, RelaxNG, XML Schema, XSLT, C14N and much more.

To contact the project, go to the project home page or see our bug tracker at https://launchpad.net/lxml

In case you want to use the current in-development version of lxml, you can get it from the github repository at https://github.com/lxml/lxml . Note that this requires Cython to build the sources, see the build instructions on the project home page. To the same end, running easy_install lxml==dev will install lxml from https://github.com/lxml/lxml/tarball/master#egg=lxml-dev if you have an appropriate version of Cython installed.

After an official release of a new stable series, bug fixes may become available at https://github.com/lxml/lxml/tree/lxml-3.4 . Running easy_install lxml==3.4bugfix will install the unreleased branch state from https://github.com/lxml/lxml/tarball/lxml-3.4#egg=lxml-3.4bugfix as soon as a maintenance branch has been established. Note that this requires Cython to be installed at an appropriate version for the build.

3.4.0 (2014-09-10)

Features added

  • xmlfile(buffered=False) disables output buffering and flushes the content after each API operation (starting/ending element blocks or writes). A new method xf.flush() can alternatively be used to explicitly flush the output.

  • lxml.html.document_fromstring has a new option ensure_head_body=True which will add an empty head and/or body element to the result document if missing.

  • lxml.html.iterlinks now returns links inside meta refresh tags.

  • New XMLParser option collect_ids=False to disable ID hash table creation. This can substantially speed up parsing of documents with many different IDs that are not used.

  • The parser uses per-document hash tables for XML IDs. This reduces the load of the global parser dict and speeds up parsing for documents with many different IDs.

  • ElementTree.getelementpath(element) returns a structural ElementPath expression for the given element, which can be used for lookups later.

  • xmlfile() accepts a new argument close=True to close file(-like) objects after writing to them. Before, xmlfile() only closed the file if it had opened it internally.

  • Allow “bytearray” type for ASCII text input.

Bugs fixed

Other changes

  • LP#400588: decoding errors have become hard errors even in recovery mode. Previously, they could lead to an internal tree representation in a mixed encoding state, which lead to very late errors or even silently incorrect behaviour during tree traversal or serialisation.

  • Requires Python 2.6, 2.7, 3.2 or later. No longer supports Python 2.4, 2.5 and 3.1, use lxml 3.3.x for those.

  • Requires libxml2 2.7.0 or later and libxslt 1.1.23 or later, use lxml 3.3.x with older versions.

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lxml-3.4.0.tar.gz (3.5 MB view details)

Uploaded Source

Built Distributions

lxml-3.4.0.win-amd64-py3.4.exe (3.5 MB view details)

Uploaded Source

lxml-3.4.0.win-amd64-py3.3.exe (3.5 MB view details)

Uploaded Source

lxml-3.4.0.win-amd64-py3.2.exe (3.5 MB view details)

Uploaded Source

lxml-3.4.0.win-amd64-py2.7.exe (3.5 MB view details)

Uploaded Source

lxml-3.4.0.win-amd64-py2.6.exe (3.5 MB view details)

Uploaded Source

lxml-3.4.0.win32-py3.4.exe (3.2 MB view details)

Uploaded Source

lxml-3.4.0.win32-py3.3.exe (3.2 MB view details)

Uploaded Source

lxml-3.4.0.win32-py3.2.exe (3.2 MB view details)

Uploaded Source

lxml-3.4.0.win32-py2.7.exe (3.2 MB view details)

Uploaded Source

lxml-3.4.0.win32-py2.6.exe (3.2 MB view details)

Uploaded Source

lxml-3.4.0-cp32-none-win32.whl (3.0 MB view details)

Uploaded CPython 3.2Windows x86

lxml-3.4.0-cp27-none-win_amd64.whl (3.3 MB view details)

Uploaded CPython 2.7Windows x86-64

lxml-3.4.0-cp27-none-win32.whl (3.0 MB view details)

Uploaded CPython 2.7Windows x86

lxml-3.4.0-cp26-none-win_amd64.whl (3.3 MB view details)

Uploaded CPython 2.6Windows x86-64

lxml-3.4.0-cp26-none-win32.whl (3.0 MB view details)

Uploaded CPython 2.6Windows x86

File details

Details for the file lxml-3.4.0.tar.gz.

File metadata

  • Download URL: lxml-3.4.0.tar.gz
  • Upload date:
  • Size: 3.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0.tar.gz
Algorithm Hash digest
SHA256 714a68bf567fdec2bb7959560dc8376c0bfc688cfceb135f43b9bd87af7a956a
MD5 bc90cc4e4ee04e1f8290ae0f70e34eea
BLAKE2b-256 1bfe0096422c56b077780b843f1614dd5208bfb97919c42ee7e4f4603d70092e

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win-amd64-py3.4.exe.

File metadata

File hashes

Hashes for lxml-3.4.0.win-amd64-py3.4.exe
Algorithm Hash digest
SHA256 cc43031b89c4e65112ac9bdec2998603d3ae808c68383779e018cc551b4d0767
MD5 e835ea6fab4345d45c7332362888a817
BLAKE2b-256 3666acef7540fc5ab92db5a89bf947fac99cb90a7196f30b30e8399fdee2f31f

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win-amd64-py3.3.exe.

File metadata

File hashes

Hashes for lxml-3.4.0.win-amd64-py3.3.exe
Algorithm Hash digest
SHA256 1fe2120ca26be2bc8e8bdb54b762aa3ab6dcb5b6840e49108306e19b27c0e2e8
MD5 98b55c7bcaa011f209a0cfc1c5b35d74
BLAKE2b-256 c2bdddbe7e8f6132141a8352b4eb787c794cb4c9580e3e6bb34cde3565c64ca2

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win-amd64-py3.2.exe.

File metadata

File hashes

Hashes for lxml-3.4.0.win-amd64-py3.2.exe
Algorithm Hash digest
SHA256 177702e7bb2317993d39e05a5544a66ca5320dbad25f4788f3d98d8e1efe575c
MD5 931b2b9b2cfd9b6af3f90e17fd76f2f3
BLAKE2b-256 0466f86270cd5aa88ca31a3facac0b16d2f8cc3d8d0f174d69bd71e5f8d4dfa0

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win-amd64-py2.7.exe.

File metadata

File hashes

Hashes for lxml-3.4.0.win-amd64-py2.7.exe
Algorithm Hash digest
SHA256 a1a9f79d80dd1549b878ea871876a9058766eba0566f0ab821af9538bc7c735b
MD5 4243a3c0eecad1e0d39fe12541ef17b2
BLAKE2b-256 e6dc8de4da9ff15803c85ddcd6788045f86633f7750381bbcc6b6e9cc5a5dd3d

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win-amd64-py2.6.exe.

File metadata

File hashes

Hashes for lxml-3.4.0.win-amd64-py2.6.exe
Algorithm Hash digest
SHA256 10b1349a046e0cfa5bf30095011eca1566df3c9b73c72319498a4730fce25dc3
MD5 4ad4f4929558d461170d544b2a07f0d1
BLAKE2b-256 fb261ceed262b36bf239bd64079349f596aea6388027706ed825409298a9c35e

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win32-py3.4.exe.

File metadata

  • Download URL: lxml-3.4.0.win32-py3.4.exe
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0.win32-py3.4.exe
Algorithm Hash digest
SHA256 db1473bc0b654893ff19f75d5fc1741fd7bfbf983773b231c38c2f2d4d9313b6
MD5 d45968df7e2c579fed91c05da8f2b96a
BLAKE2b-256 1aa3abb60b80092b5811347b1130b631e67c1548ee4382305ebdbf6079286194

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win32-py3.3.exe.

File metadata

  • Download URL: lxml-3.4.0.win32-py3.3.exe
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0.win32-py3.3.exe
Algorithm Hash digest
SHA256 542ad5777aa0915a56f36e3b7a458c01d1fe6e325f335a854c38934e273162b5
MD5 551a0185741df641ad3a1dbc93d90b42
BLAKE2b-256 1290e5e8125650dbaa9dd386b598f49b09929c6c2a56a5c03ba09d1a4c4d614a

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win32-py3.2.exe.

File metadata

  • Download URL: lxml-3.4.0.win32-py3.2.exe
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0.win32-py3.2.exe
Algorithm Hash digest
SHA256 964fad573c31d31df51dd8bbff30a57028d71eff9c5ef70b9d348f23356e6ca2
MD5 cd675f11458a2f1309880a1bbb2e2ac5
BLAKE2b-256 1f4dab2c0f91a3f13c956bfd2fe74978667d696197356039d11354a1a6800e64

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win32-py2.7.exe.

File metadata

  • Download URL: lxml-3.4.0.win32-py2.7.exe
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0.win32-py2.7.exe
Algorithm Hash digest
SHA256 473a26d3a42a0304375e5f07dc329fd005a66f5ae72836d48ef2c77573bc6558
MD5 5a9d8e4f3f8d8d2c703a8e2f94181890
BLAKE2b-256 40d292fb3a80f015d0426c1c19d0b2f5c866fd168369ed98a36850479ae030fb

See more details on using hashes here.

File details

Details for the file lxml-3.4.0.win32-py2.6.exe.

File metadata

  • Download URL: lxml-3.4.0.win32-py2.6.exe
  • Upload date:
  • Size: 3.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0.win32-py2.6.exe
Algorithm Hash digest
SHA256 46601544663a1eab6f39b8249347ca374e87da0d3922bd1cbf7c16b79434b1f7
MD5 97c8c0baf0d9981f47b02cadd02b4bbf
BLAKE2b-256 3eee8fa6b7f94013ee0754f46d3d28ee8b9e08ba45f8d038e8c046ec18b53e7a

See more details on using hashes here.

File details

Details for the file lxml-3.4.0-cp32-none-win32.whl.

File metadata

  • Download URL: lxml-3.4.0-cp32-none-win32.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.2, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0-cp32-none-win32.whl
Algorithm Hash digest
SHA256 808a8a67f803ea93f56a16d7ec8063a333a6e2bae32e041735f55c10acfd5eca
MD5 587da550d2549611953f00558d62b006
BLAKE2b-256 19b4eedc04edd544672f81a87b606549b71f52ec3fc5cae3c38169212c337b2f

See more details on using hashes here.

File details

Details for the file lxml-3.4.0-cp27-none-win_amd64.whl.

File metadata

File hashes

Hashes for lxml-3.4.0-cp27-none-win_amd64.whl
Algorithm Hash digest
SHA256 522407a152f9812d69647289012c67b48bb4471dc2df6eaf865b0f4fc5fc5cef
MD5 543bb22dd7b18b788b5f9ae9d7f53e00
BLAKE2b-256 340e6f5b8523ad479cc9ed0246fddd829efdddc9e6e00c04d4c758d002428448

See more details on using hashes here.

File details

Details for the file lxml-3.4.0-cp27-none-win32.whl.

File metadata

  • Download URL: lxml-3.4.0-cp27-none-win32.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 2.7, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0-cp27-none-win32.whl
Algorithm Hash digest
SHA256 264557e90df6d00066c287644d008e5a92920cdd04124b8c6ab59d098319bbc6
MD5 a369044d5f8957f2fea38c1b4e6455a7
BLAKE2b-256 9ca0c1fc48e55b5d7cb98be53a44c55c4de07ba266bb22c4accaa5d80367f71f

See more details on using hashes here.

File details

Details for the file lxml-3.4.0-cp26-none-win_amd64.whl.

File metadata

File hashes

Hashes for lxml-3.4.0-cp26-none-win_amd64.whl
Algorithm Hash digest
SHA256 0392bda949ee48e27773874a1fbb4c47441db34bb88233c94c197509ff23a9ff
MD5 8543161d26d5a8965f0e5f4fbdaaf170
BLAKE2b-256 28c6ce858da5371b620a78ee60a33abb67192cff2fd3c1959c3425174a8851d6

See more details on using hashes here.

File details

Details for the file lxml-3.4.0-cp26-none-win32.whl.

File metadata

  • Download URL: lxml-3.4.0-cp26-none-win32.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 2.6, Windows x86
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for lxml-3.4.0-cp26-none-win32.whl
Algorithm Hash digest
SHA256 d2d9688234121548c88b5557ff92af3100e8a3a931eb19955e9130d62239fec0
MD5 ac45e268480af9af2e7cb19b6397f26a
BLAKE2b-256 89032736a837c0df4d9817f020710fe29d79ae0dd7f4e0c48004389de5e1a8fe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page