https://github.com/thatxliner/stacksearch
A python script that'll search StackOverflow and give you results you can use.
https://github.com/thatxliner/stacksearch
api api-server asynchronous blessings command-line command-line-tool pypi stackexchange stackoverflow stacksearch unofficial webscraping
Last synced: 9 months ago
JSON representation
A python script that'll search StackOverflow and give you results you can use.
- Host: GitHub
- URL: https://github.com/thatxliner/stacksearch
- Owner: ThatXliner
- License: mit
- Created: 2020-07-23T03:14:32.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-04T02:04:48.000Z (about 1 year ago)
- Last Synced: 2025-03-24T11:55:25.179Z (10 months ago)
- Topics: api, api-server, asynchronous, blessings, command-line, command-line-tool, pypi, stackexchange, stackoverflow, stacksearch, unofficial, webscraping
- Language: Python
- Homepage: https://stacksearch.readthedocs.io/en/latest/
- Size: 930 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
stacksearch 🔎
**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](https://stackexchange.com) sites such as [StackOverflow](https://stackoverflow.com).
It does *not* implement the [stack search algorithm](https://en.m.wikipedia.org/wiki/Stack_search).
## Installation
You know the drill
```bash
$ pip install stacksearch
```
## Usage
### CLI
```bash
$ stacksearch "This is the query"
```
or
```bash
$ python3 -m stacksearch "This is the query"
```
### Python API
```python
>>> from stacksearch import sync_search
>>> sync_search("This is the query")
```
or the asynchronous version
```python
>>> import asyncio
>>> from stacksearch import search
>>> async def main():
... await search("This is the query")
>>> asyncio.run(main())
```
Have fun!
## Features
The benefits of this module as opposed to the other StackOverflow-searching modules is that this module provides the following:
- **Reverses HTML** via [unmarkd](https://github.com/ThatXliner/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](https://stackexchange.com/) sites
- A **beautiful command-line interface _for humans_** via [argparse](https://docs.python.org/3/library/argparse.html) and [**Rich**](https://github.com/willmcgugan/rich)
- An optional **asynchronous Python API**
- The ability to **crank out raw [JSON](https://www.json.org/json-en.html) data** to use
- Fully [type hinted](https://www.python.org/dev/peps/pep-0585/)
## Usage Examples
- 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](https://www.vim.org/) people)
- For getting lots of answers from all StackExchange sites you know
## License
[MIT](https://choosealicense.com/licenses/mit/)
Please feel free to contribute!
## Links 📎
- [GitHub](https://github.com/ThatXliner/stacksearch/tree/Stable)
- [PyPi](https://pypi.org/project/stacksearch/)