Skip to main content

wake

🍰 Making Wikipedia and Wikidata Processing Easy, Like Eating a Piece of Cake

installation

pip3 install wake or pipenv install wake

methods

get_wikidata_entities

Stream Wikidata Entities

from wake import get_wikidata_entities

for entity in get_wikidata_entities():
    print(entity)

You can also filter entities by their type. For example, to get all entities that are humans (Q5) run:

from wake import get_wikidata_entities

for human in get_wikidata_entities(instance_of="Q5"):
    print(human)

clean_title

takes in a title of a Wikipedia page as a string and escapes and cleans it of weird characters, so it can be put in a normal database

download_if_necessary

dowloads a url to the system's temp directory if a file by its name isn't already there

get_most_recent_available_dump

figures out what Wikipedia dump has certain subdumps complete

tokenize

pass in the page text from a dump and get a list of tokens in return

get links in an article(i.e. what's between '[[' and ']]')

test

python3 -m unittest wake.test

license

CC0-1.0 / Public Domain

contact

Post an issue! Thank you!

Metadata

Release files for wake 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wake 0.11.0
File Size Uploaded
wake-0.11.0.tar.gz 6.2 kB Details

Release files / wake-0.11.0.tar.gz

Download URL wake-0.11.0.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5794764bda56dcedab3b56680855462462bbc1c7649bc018a013fb0bf1edc371
BLAKE2b-256 checksum
How to use checksums
549a461d1514f2ffe67acaa5c5b51db312e8ccdf933a43dea50879f3783e9481
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/44.1.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/2.7.17

Release history Release notifications | RSS feed

This release

0.11.0 This release

1 release file

0.10.1

1 release file

0.10

1 release file

0.9

1 release file

0.8

1 release file

0.7

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page