Query Language for Wikipedia
Project description
WikipediaQL: querying structured data from Wikipedia
WikipediaQL is an experimental query language and, executable script, and Python library for querying structured data from Wikipedia. It looks like this:
$ wikipedia_ql --page "Guardians of the Galaxy (film)" \
'{
page@title as "title";
section[heading="Cast"] as "cast" >> {
li >> text:matches("^(.+?) as (.+?):") >> {
text-group[group=1] as "actor";
text-group[group=2] as "character"
}
};
section[heading="Critical response"] >> {
sentence:contains("Rotten Tomatoes") as "RT ratings" >> {
text:matches("\d+%") as "percent";
text:matches("(\d+) (critic|review)") >> text-group[group=1] as "reviews";
text:matches("[\d.]+/10") as "overall"
}
}
}'
title: Guardians of the Galaxy (film)
RT ratings:
overall: 7.8/10
percent: 92%
reviews: '334'
cast:
- actor: Chris Pratt
character: Peter Quill / Star-Lord
- actor: Zoe Saldaña
character: Gamora
...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wikipedia_ql-0.0.6.tar.gz
(25.5 kB
view hashes)
Built Distribution
Close
Hashes for wikipedia_ql-0.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8c3ee0f329ae1d633b70f4bd5f3bdea41003111540ce82be7dbb1c683edd6354 |
|
MD5 | 226be9d26d9f9086f19d2f00243d3e8d |
|
BLAKE2b-256 | 4afb8f9cd3fe774e912d5cdaba6fbcacfe5ef80d7697ae527a19ce1d715b666e |