Like jq but for XML and XPath.
Project description
Apply XPath expressions to XML, like jq does for JSONPath and JSON.
Installation
Install with pip:
pip install xq
Or download the repo and install via setuptools:
python setup.py install
Usage
Extract download URLs from an RSS feed:
http get 'http://br-rss.jeffbr13.net/rss/channels/1/' | xq '//item/enclosure/@url'
Extract all links from an HTML page footer:
http get 'http://br-rss.jeffbr13.net/ | xq '//footer//a/@href'
Test
Run unittest in the root directory to autodetect and run tests:
python -m unittest
Build
Increment xq.VERSION and run the following two commands to create a source distribution, create a universal wheel, and upload to PyPI
python setup.py sdist python setup.py bdist_wheel --universal twine upload dist/*
See Also
Project details
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
xq-0.0.4.tar.gz
(4.1 kB
view details)
Built Distributions
xq-0.0.4-py3.6.egg
(9.9 kB
view details)
File details
Details for the file xq-0.0.4.tar.gz
.
File metadata
- Download URL: xq-0.0.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28574d5c614d4012a8ad0e08b1c53712f4d69c9f1d8a6c7aa3134262edd82977 |
|
MD5 | 91cde23e6ce09016ed58c3839378eac7 |
|
BLAKE2b-256 | ca9d1b464621f4a18c997579e0cc3ad0ba701c0b917702529a67deeaedade4bf |
File details
Details for the file xq-0.0.4-py3.6.egg
.
File metadata
- Download URL: xq-0.0.4-py3.6.egg
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f553244cdc1e7de9c7af5e707c47cb05a943180a262c7bee0a843f6d54e5b8e |
|
MD5 | 1bec40cf2b22fcfbe2358ea93d6128d6 |
|
BLAKE2b-256 | 1ae06989fc30f3524dfceb6092b470790223c477f06f1c69785921f0b7a0c775 |
File details
Details for the file xq-0.0.4-py2.py3-none-any.whl
.
File metadata
- Download URL: xq-0.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fc71de12ca0608321458269bf007b24eff61efe74382a644ab7cb587a26fd6 |
|
MD5 | 00ae02650f59ecbd5a347f0dd2448fe6 |
|
BLAKE2b-256 | 5cc8c039729a023207a973a0181f41debf07ee03ad3e167693b1900445ef4f05 |