A python package to search in books available on wikisource.org
Project description
WikiSource
wikisource is a python package to help search the Wikisource Books
It offers a few classes to help find sentences in a book, or in a book collection.
For example, to search in a book for a specific string
from wikisource import WikiSource
book = WikiSource("https://fr.wikisource.org/wiki/Discours_de_la_m%C3%A9thode_(%C3%A9d._Cousin)"
book.search("bon sens")
To search in a collection of books, you can use:
from wikisource import Collection, WikiSource
books = Collection([WikiSource("https://fr.wikisource.org/wiki/Discours_de_la_m%C3%A9thode_(%C3%A9d._Cousin)"),
WikiSource("https://fr.wikisource.org/wiki/Les_Confessions_(Rousseau)"),
WikiSource("https://fr.wikisource.org/wiki/L%E2%80%99Origine_de_la_Trag%C3%A9die")])
books.search("bon sens")
The first search takes longer due to the fact that every chapter of the book needs to be downloaded locally. The next searches are faster.
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
wikisource-0.0.12.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for wikisource-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a368c561351ddd4e3b722569088c446fa92a8528b74cc2641f5019c8fb640778 |
|
MD5 | 494320d7768c65cced5ffcaa1c0cf5d3 |
|
BLAKE2b-256 | be89bb2ff66a96747c8074865078d9273605b1d58754aba1f960039d0662ff7e |