A package for searching documentation built with sphinx
Project description
Doc-search
A simple package for searching documentation built with sphinx
Features
- Both async and sync support
- utilizes a cache to limit the number of requests being made
- works for any documentation that is built with sphinx
Example
asyncio
import asyncio
from doc_search import AsyncScraper
scraper = AsyncScraper()
async def main(query):
results = await scraper.search(query, page="https://docs.python.org/3/")
#returns a list of tuples in the format of [(item, url), (item, url)...]
if not results:
print("no results were found")
else:
for item, url in results: #loop through the list of results
print(f"{item} | {url}") #print out each result
asyncio.run(main("str.split"))
# to view the cache
# print(scraper.cache)
sync
from doc_search import SyncScraper
scraper = SyncScraper()
results = scraper.search("resize", page="https://pillow.readthedocs.io/en/stable/")
if not results:
print("no results were found")
else:
for item, url in results: #loop through the list of results
print(f"{item} | {url}") #print out each result
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for doc_search-1.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 338487fa5185ee4dc58073923c94ec4663864a12d527d3566517f0de475aa7cb |
|
MD5 | 3c0dacc5d9b8c4d3ba3af44c674a42d1 |
|
BLAKE2b-256 | 6596b0bf752a51a0e33fac7bc2c9c79fb4ca8fd782f99098ba26c66f020ab420 |