Skip to main content

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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wikisource-0.0.12-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file wikisource-0.0.12.tar.gz.

File metadata

  • Download URL: wikisource-0.0.12.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for wikisource-0.0.12.tar.gz
Algorithm Hash digest
SHA256 1c3d0c09d8e6e28ed6176f30d6d066c8f9f225bf66d8f0a1d5d5536902c7426a
MD5 a3cf52e7f1552ced2d69aeff317d721e
BLAKE2b-256 ef9e5c7c7481b58ff5b952ffc289c544ae1a45c9b2f726128af614c04ba72c52

See more details on using hashes here.

File details

Details for the file wikisource-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: wikisource-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for wikisource-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 a368c561351ddd4e3b722569088c446fa92a8528b74cc2641f5019c8fb640778
MD5 494320d7768c65cced5ffcaa1c0cf5d3
BLAKE2b-256 be89bb2ff66a96747c8074865078d9273605b1d58754aba1f960039d0662ff7e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page