-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
105 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,9 @@ build | |
dist | ||
*.egg-info | ||
|
||
# Docs | ||
site/ | ||
|
||
# virtualenv | ||
venv_pwiki | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# dwrap | ||
::: pwiki.dwrap |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Examples | ||
⚠️ This section is under construction | ||
|
||
## Basics | ||
```python | ||
from pwiki.wiki import Wiki | ||
|
||
# new Wiki instance, pointed to en.wikipedia.org, not logged in | ||
wiki = Wiki() | ||
|
||
# new Wiki instance, pointed at commons.wikimedia.org, logging in with user/pass | ||
wiki = Wiki("commons.wikimedia.org", "MyCoolUsername", "MySuperSecretPassword") | ||
``` | ||
|
||
## Read Page Content | ||
```python | ||
from pwiki.wiki import Wiki | ||
|
||
wiki = Wiki() | ||
|
||
# print all the titles in "Category:American 3D films" | ||
for title in wiki.category_members("Category:American 3D films"): | ||
print(title) | ||
|
||
# print all external links on the page "GitHub" | ||
for url in wiki.external_links("GitHub"): | ||
print(url) | ||
``` | ||
|
||
## Edit/Create Page Content | ||
```python | ||
from pwiki.wiki import Wiki | ||
|
||
# you'll need to create a real account on Wikipedia otherwise the snippets below won't work | ||
wiki = Wiki(username="MyCoolUsername", password="MySuperSecretPassword") | ||
|
||
# Append "this is a test" to "Wikipedia:Sandbox" | ||
wiki.edit("Wikipedia:Sandbox", append="this is a test") | ||
|
||
# Replace "Wikipedia:Sandbox" with "I changed the page!" and edit summary "Hello, world!" | ||
wiki.edit("Wikipedia:Sandbox", "I changed the page!", "Hello, world!") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# gquery | ||
::: pwiki.gquery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Welcome to pwiki's docs | ||
|
||
**pwiki** is a Python library which makes interacting with the MediaWiki API simple and easy. It can be used with sites such as Wikipedia, or virtually any other website that runs on MediaWiki. | ||
|
||
## Installation | ||
|
||
Install with `pip` | ||
|
||
```bash | ||
pip install pwiki | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# mquery | ||
::: pwiki.mquery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# ns | ||
::: pwiki.ns |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# oquery | ||
::: pwiki.oquery |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# wiki | ||
::: pwiki.wiki |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# wparser | ||
::: pwiki.wparser |
Oops, something went wrong.