### Install pywikisource Source: https://pypi.org/project/pywikisource/0.0.5 Install the pywikisource library using pip. It is recommended to specify a version for consistent behavior. ```bash pip install pywikisource==0.0.5 ``` -------------------------------- ### Initialize WikiSourceApi and Get Page List Source: https://pypi.org/project/pywikisource/0.0.5 Demonstrates how to create a WikiSourceApi object with or without a custom user agent and retrieve a list of pages for a given book. ```python 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) ``` -------------------------------- ### Install pywikisource Source: https://pypi.org/project/pywikisource Install the pywikisource library using pip. It is recommended to specify a user agent when creating the WikiSourceApi object for API requests. ```bash pip install pywikisource ``` -------------------------------- ### Build and Upload Project to PyPI Source: https://pypi.org/project/pywikisource Commands for building source and wheel distributions and uploading them to PyPI using twine. Ensure you have the necessary build tools and twine installed. ```bash python setup.py sdist bdist_wheel twine check dist/* twine upload dist/* ``` -------------------------------- ### Get Validator of a Single Page Source: https://pypi.org/project/pywikisource/0.0.5 Retrieves the validator status for a specific page of a book. ```python print(WS.validator('Page:Landon_in_Literary_Gazette_1833.pdf/3')) ``` -------------------------------- ### Get Proofreader of a Single Page Source: https://pypi.org/project/pywikisource/0.0.5 Fetches the proofreader information for a specific page of a book. ```python print(WS.proofreader('Page:Landon_in_Literary_Gazette_1833.pdf/3')) ``` -------------------------------- ### Get Number of Pages for Index Book Source: https://pypi.org/project/pywikisource/0.0.5 Retrieves the total number of pages for a given index book using the WikiSourceApi. ```python print(WS.numpage('Landon in Literary Gazette 1833.pdf')) ``` -------------------------------- ### Deploy pywikisource to PyPI Source: https://pypi.org/project/pywikisource/0.0.5 Commands for building and uploading the pywikisource package to PyPI using setuptools and twine. ```bash administrator@Jay-Prakash % python setup.py sdist bdist_wheel administrator@Jay-Prakash % twine check dist/* administrator@Jay-Prakash % twine upload dist/* ``` -------------------------------- ### Asynchronous Book Status Retrieval Source: https://pypi.org/project/pywikisource/0.0.5 Demonstrates fetching the status of multiple books asynchronously. Ensure to set a user agent and consider the rate limit for requests. ```python 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"] ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.