NOTE: STACKSEARCH IS NO LONGER ACTIVELY MAINTAINED. There will still be the occasional bug fixes and updates, but not as much.
StackSearch is a python library that provides an unofficial API to search various StackExchange sites such as StackOverflow.
It does not implement the stack search algorithm.
You know the drill
$ pip install stacksearch
$ stacksearch "This is the query"
or
$ python3 -m stacksearch "This is the query"
>>> from stacksearch import sync_search
>>> sync_search("This is the query")
or the asynchronous version
>>> import asyncio
>>> from stacksearch import search
>>> async def main():
... await search("This is the query")
>>> asyncio.run(main())
Have fun!
The benefits of this module as opposed to the other StackOverflow-searching modules is that this module provides the following:
- Reverses HTML via unmarkd to return useful and beautiful answers
- The ability to return a dictionary of ALL the search results found, not just the first result (returning from every page found still WIP)
- The ability to return results from all StackExchange sites
- A beautiful command-line interface for humans via argparse and Rich
- An optional asynchronous Python API
- The ability to crank out raw JSON data to use
- Fully type hinted
-
For creating a text editor extension built on this package
-
For searching StackOverflow and/or other StackExchange websites without leaving the Terminal (for those Vim people)
-
For getting lots of answers from all StackExchange sites you know
Please feel free to contribute!