pywikisource
This library contains the basic API operations like
- Number of Index Book
- Current page quality status
- Proofreader of page
- Validator of page
It is wikisource dedicated API library.
Installation
pip install pywikisource
Demo 1
from pywikisource import WikiSourceApi
# Create the Wikisource object
WS = WikiSourceApi('en')
# or
userAgent = "MyCoolTool/1.1 (https://example.org/MyCoolTool/; MyCoolTool@example.org) pywikisource/0.0.4"
WS = WikiSourceApi('en', userAgent) # It is recommended to add user agent.
# Get page list
pageList = WS.createdPageList('Landon in Literary Gazette 1833.pdf')
for page in pageList:
print(page)
# Get the number of pages of Index Book
print(WS.numpage('Landon in Literary Gazette 1833.pdf'))
# Get the proofreader of single page
print(WS.proofreader('Page:Landon_in_Literary_Gazette_1833.pdf/3'))
# Get the validator of single page
print(WS.validator('Page:Landon_in_Literary_Gazette_1833.pdf/3'))
Demo 2 (Async bookStatus; Since pywikisource 0.0.4)
from pywikisource import WikiSourceApi
import asyncio
userAgent = "MyCoolTool/1.1 (https://example.org/MyCoolTool/; MyCoolTool@example.org) pywikisource/0.0.4"
WS = WikiSourceApi('ta', userAgent) # It is recommended to add user agent.
books = [
"தமிழர் வரலாறு 1, பி. டி. சீனிவாச அய்யங்கார்.pdf",
"தமிழர் வரலாறு 2, பி. டி. சீனிவாச அய்யங்கார்.pdf",
"மாவீரர் மருதுபாண்டியர்.pdf",
"சேரன் செங்குட்டுவன்.djvu"
]
for book in books:
pageList = WS.createdPageList( book )
# Default limit is 25 requests per second
data = asyncio.run( WS.bookStatus( pageList, limit=50 ) )
for title, status in data.items():
print( title, " --> ", status["code"] )
Author
- Jay Prakash, Indic-TechCom
Instruction for Maintainer
To deploy on PyPI
administrator@Jay-Prakash % python setup.py sdist bdist_wheel
administrator@Jay-Prakash % twine check dist/*
administrator@Jay-Prakash % twine upload dist/*
Licence
This is Free Software, released under the MIT.
Metadata
Release files for pywikisource 0.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pywikisource-0.0.5-py3-none-any.whl | Python 3 | none | any | Details for pywikisource-0.0.5-py3-none-any.whl |
Release files / pywikisource-0.0.5-py3-none-any.whl
| Download URL | pywikisource-0.0.5-py3-none-any.whl |
|---|---|
| Size | 5.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6cf72df36fa854b3ffbb1c642b34261bc4403d044347d8808512981f74d70798
|
|
BLAKE2b-256 checksum How to use checksums |
77a1011a5f9ff7e1e4b9625e53da6ac385c43c4471857c38e3e205103b87e95f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.11.7
|
Security for pywikisource 0.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.