Skip to main content

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
...

Read full README.md on GitHub

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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wikipedia_ql-0.0.6-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file wikipedia_ql-0.0.6.tar.gz.

File metadata

  • Download URL: wikipedia_ql-0.0.6.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.27.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.6

File hashes

Hashes for wikipedia_ql-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6f78987f526b6fe36b425c2b1d424bc6e078fd0ef436a46c431bc6af14cc82df
MD5 35d0e8fcdb5a1d7835638c8356c3e4bd
BLAKE2b-256 fe2c7dc817dc213929d4a3c02555bd1b22536d64ac5e832c1e192d17a3301e2a

See more details on using hashes here.

File details

Details for the file wikipedia_ql-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: wikipedia_ql-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 23.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.27.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.6

File hashes

Hashes for wikipedia_ql-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8c3ee0f329ae1d633b70f4bd5f3bdea41003111540ce82be7dbb1c683edd6354
MD5 226be9d26d9f9086f19d2f00243d3e8d
BLAKE2b-256 4afb8f9cd3fe774e912d5cdaba6fbcacfe5ef80d7697ae527a19ce1d715b666e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.0.6 This release

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Supported by

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