A python library to extract information from Wikipedia pages.
Project description
toolwiki
This is a python library to extract information from Wikipedia pages.
Contents
tables.pymodule includes function to extract information from a wikipedia table as a pandas dataframe.pages.pymodule includes function to extract inferred gender based on the ratio of male and female pronouns on a wikipedia page.
Installation
You can install toolwiki package from PyPI:
python -m pip install toolwiki
toolwiki is supported on Python 3.7 and above.
How to use
You can use this package in your own Python code by importing from the toolwiki package:
>>> from toolwiki import tables
>>> dfs= tables.get_dataframes(url='https://en.wikipedia.org/wiki/List_of_UFC_events', by_class='wikitable', table_indices= [], raw=False)
[ Event ... Ref.
1 UFC 276 ... [9]
2 UFC Fight Night 211 ... [10]
.. ... ... ... ... ...
14 UFC Fight Night 202 ... [20]
15 UFC Fight Night: Walker vs. Hill ... [21]
[15 rows x 5 columns], # Event ... Attendance Ref.
1 593 UFC 271: Adesanya vs. Whittaker II ... 17,872 [22]
2 592 UFC Fight Night: Hermansson vs. Strickland ... N/A [23]
.. ... ... ... ... ...
601 002 UFC 2: No Way Out ... 2,000 [558]
602 001 UFC 1: The Beginning ... 7,800 [559]
[602 rows x 7 columns]]
>>> from toolwiki import page
>>> print(page.get_gender('https://en.wikipedia.org/wiki/Karolina_Kowalkiewicz', gender_threshold=0.8)
('female', '1.0')
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toolwiki-0.1.14.tar.gz.
File metadata
- Download URL: toolwiki-0.1.14.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8dc7ed9ea72b700cd928c526a0bc9581ce0ce53764ace2c4a6a9062e54c3cf6
|
|
| MD5 |
99b852efe1ba9b24c4b88fec82a22f06
|
|
| BLAKE2b-256 |
fd3caf58c91715ccb8eac253bcd9c9813d1bb35c712d133c27695b296befafbf
|
File details
Details for the file toolwiki-0.1.14-py3-none-any.whl.
File metadata
- Download URL: toolwiki-0.1.14-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4aee82f611d6e1df235b42b5744e5ede13c1a0d5fa2011600196e783d73737a0
|
|
| MD5 |
636c1961b45c55a9832dd959571840c0
|
|
| BLAKE2b-256 |
7e460f87f548db7aae25b5c98a22ae66fcbe5ec626303ce4b31f1cf3ce34e507
|