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.5.tar.gz
(25.2 kB
view hashes)
Built Distribution
Close
Hashes for wikipedia_ql-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0728be2d4f277ff8cfbbc1f7b744ac57da01a07c392e5ee5d41abd61656d52b3 |
|
MD5 | d370e8f71b4fefdaffb02bf5b302a395 |
|
BLAKE2b-256 | 399ae7f7fe8184c6439cfe884c0dfccf62bb85ce362378d6cf8d0d445bade7c2 |