%global _empty_manifest_terminate_build 0 Name: python-socli Version: 7.3 Release: 1 Summary: Stack overflow command line interface. SoCLI allows you to search and browse stack overflow from the terminal. License: BSD URL: https://www.github.com/gautamkrishnar/socli Source0: https://mirrors.nju.edu.cn/pypi/web/packages/ed/c9/8af1f627155f2cb8af88d16344173dab0053da992a6e6feaead4283a67da/socli-7.3.tar.gz BuildArch: noarch Requires: python3-BeautifulSoup4 Requires: python3-requests Requires: python3-colorama Requires: python3-Py-stackExchange Requires: python3-sentry-sdk Requires: python3-urwid Requires: python3-argcomplete %description # SoCLI [![PyPI](https://img.shields.io/pypi/v/socli?color=brightgreen) ![PyPI Downloads](https://img.shields.io/pypi/dm/socli)](https://pypi.org/project/socli/) [![Build Status](https://travis-ci.com/gautamkrishnar/socli.svg?branch=master)](https://travis-ci.com/gautamkrishnar/socli) [![Gitter Chat](https://badges.gitter.im/socli-community/Lobby.svg)](https://gitter.im/socli-community/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Stack Overflow command line written in python. Using SoCLI you can search and browse Stack Overflow without leaving the terminal. Just use the **socli** command: ![SoCLI in action](https://cloud.githubusercontent.com/assets/8397274/24831468/86c290aa-1cb7-11e7-8161-2665d0c02e4b.gif) ### Installation ##### Supported platforms * Linux * Windows * Mac ##### Requirements * Python 3.5 or higher ##### For Linux Install **python** and just use **pip** command to install **socli**: ```bash sudo apt-get install python3 python3-pip pip install socli ``` ##### For Windows [Download and install Python](https://www.python.org/downloads/). Don't forget to check the option "Add to path". Open a command prompt with administrative privileges and use **pip** command to install **socli**: ```bash pip install socli ``` Use **easy_install** if your python path has a space in it. [Read more: "Failed to create process"](https://github.com/gautamkrishnar/socli/issues/6): ``` easy_install socli ``` ##### For Mac/Linux (via [homebrew](https://brew.sh/)) Install **socli**: ```bash brew tap gautamkrishnar/socli brew install socli ``` ##### Enabling the shell autocompletion If you installed socli via pyPi you may need to enable the shell autocompletion. Add the following to your `.bashrc` file to enable it: ```bash socli --register ``` ### Updating Use the command below to update your existing version of **socli** to the newest version so that you won't miss any features: ```bash pip install --upgrade socli ``` If you installed via homebrew: ```bash brew upgrade socli ``` ### Usage ##### Quick Search Use the **socli** command followed by the search query: ```bash socli for loop in python syntax ``` The above command will search for the query "*for loop in python syntax*" and displays the first most voted question in Stack Overflow with its most voted answer. Pretty quick, right? ##### Interactive Search You can search Stack Overflow interactively by using the command below: ```sh socli -iq html error 404 ``` This will display a list of questions from Stack Overflow for the query "*html error 404*" and it will allow you to choose any of the questions you like interactively. When you choose a question, it will display the complete description of the chosen question with its most voted answer. You can also browse through the other answers to that question using the up and down arrow keys as well as go back to the list of questions using the left arrow key. ##### Manual Search This will allow you to specify a requested question number for your query. For example, consider the following command: ```sh socli -r 2 -q javascript prototype function ``` This command searches for "*javascript prototype function*" in Stack Overflow and displays the second question that contains it. ##### Topic-Based Search Stack Overflow supports topic by using tags. **socli** allows you to query Stack Overflow based on specific tags. Just specify the tag via the following command: ```sh socli -t javascript -q window.open ``` You can also specify multiple tags, Just separate them with a comma: ```sh socli -t javascript,node.js -q window.open ``` See the complete list of tags [here](http://stackoverflow.com/tags). ##### User Profile Browsing Just use the command below to set your [user ID]( http://meta.stackexchange.com/a/111130) in socli. When you execute the command next time, it will automatically fetch the data. ```sh socli -u ``` if your are an extensive user of StackOverflow, **socli** allows you to set your own API key to overcome the [StackOverflow API Limitations](http://stackapps.com/a/3057/41332). Just use the command below: ```sh socli --api ``` You can get an API Key [here](http://stackapps.com/apps/oauth/register) by registering as a new app. Please don't use SoCLI as app name. ##### Posting a New Question If you can't find an answer for your question in Stack Overflow, **socli** allows you to create a new question via the web browser. Just type the command below and **socli** will open the new question page of Stack Overflow in the web browser for you: ```sh socli -n ``` ##### Opening a url directly If you have the url of the Stack Overflow post then you can pass it using `--open-url` or `-o`. For example ``` socli --open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works``` ### Syntax: **socli** has the following syntax ``` Usage: socli [ Arguments] < Search Query > ``` ###### Arguments (optional) | Short | Long | Description | Example | |--------|--------|--------|--------| | -q | --query | Used to specify the query when arguments are used. A query value must be passed to it. If it is used alone (socli -q query) then it will display the same result as **socli query**. | **socli -q query** | | -i | --interactive | Used to search interactively. It doesn't take any values. It must be followed by a -q or --query after it. | **socli -i -q query** | | -r | --res | Used for manual search. It takes the question number as the argument and it must be followed by a -q or --query after it. | **socli -r 4 -q query** | | -t | --tag | Specifies the tag to search for the query on Stack Overflow. It must be followed by a -q or --query after it. | **socli -t js -q query** | | -n | --new | Opens the web browser to create a new question on Stack Overflow. | **socli --new** | | -u | --user | Displays the user profile informations. If no argument is given, it will display your profile. | **socli -u 22656** | | -a | --api | Sets a custom API key. | **socli --api** | | -d | --del | Deletes the configuration file generated by socli -u manually. | **socli -d** | | -s | --sosearch | SoCLI uses Google search by default to search for questions. To override this and use stackoverflow's default search instead. | **socli -s -q for loop python** | | -h | --help | Displays the help text. | **socli --help** | | -o | --open-url | Displays the given url in socli if possible if not opens in browser. | **socli -o https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works** | | -j | --json-output | Gives output to stdout as json | **socli -jq for loop python** | | -g | --register | Registers socli's shell autocompletion | socli -g | | -v | --version | Displays the version of socli. | **socli -v** | ###### Query This term refers to what you're searching for in Stack Overflow. ### Features These are the amazing features of SoCLI: * Manual Search * Interactively browse Stack Overflow using the interactive mode * Coloured interface * Question stats view * Tag support * Can open the page in a browser * Can view user profiles * Can create a new question via the web browser * Can open a Stack Overflow page on the terminal directly from a url ### To Do Command line interface for: - [ ] Stack Overflow authentication - [ ] Posting to Stack Overflow - [ ] Upvote answer - [ ] Comment on an answer - [ ] Browsing stackoverflow home page Please check out the list of [issues](https://github.com/gautamkrishnar/socli/issues). ### Testing Automated tests are setup by using [pytest](https://docs.pytest.org/en/latest/contents.html), the tests can be run locally by invoking a `python setup.py test`. All tests are in the `socli/tests/` subdirectory of this repository. TravisCI is supposed to run the test-suite on build. ### πŸ’₯ How to Contribute ? If you are willing to contribute to SoCLI project, you are awesome! Just follow the steps given in [CONTRIBUTING.md](https://github.com/gautamkrishnar/socli/blob/master/CONTRIBUTING.md) πŸ˜ƒ ## Maintainers Please reach out to any of the following people if you have any queries:

Gautam krishna R

πŸ’»

Hedy Li

πŸ’»
## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

aaxu

πŸ’»

kilbee

πŸ’»

Sam Dean

πŸ“–

mwwynne

πŸ’»

Carlos J. Puga Medina

πŸ›

Jon Ericson

πŸ’»

Ankit Kr. Singh

πŸ’»

Harsha Alva

πŸ’»

Pia Mancini

πŸ“–

Aditya Tandon

πŸ›

Akshatha Nayak

πŸ’»

Liam Hawkins

πŸ’»

Arount

πŸ’»

CΓ©dric Picard

πŸ›

Amartya Chaudhuri

πŸ’»

Elliott Beach

πŸ’»

Prashant Chahal

πŸ’»

Insiyah Hajoori

πŸ’»

C

πŸ’»

Liam Byrne

πŸ’»

Tran Chi Khang

πŸ’»

Alix Poulsen

πŸ“–

albalitz

πŸ’»

Aniruddha Bhattacharjee

πŸ’»

Daniel St.Jacques

πŸ’»

Donnell Muse

πŸ’»

JM Lopez

πŸ’»

JOBIN PHILIP ABRAHAM

πŸ“–

Jakub Kukul

πŸ’»

Pigeon

πŸ“–

Rajdeep Biswas

πŸ’»

Sachin Kukreja

πŸ’»

Simon Reap

πŸ’»

Srisaila

πŸ’»

agarwalnishtha

πŸ’»

Frederick Kozlowski

πŸ’»

Esha Lath

πŸ’»

thumpri

πŸ’»

Adam Zhang

πŸ’»

prathampowar2001

πŸ’»

Subhankar Hotta

πŸ’»

ankushduacodes

πŸ’»

Shriram Bhat

πŸ’»

Vjs Pranav

πŸ’»

Saif Kazi

πŸ’»

pstreff

πŸ’»

anshik1998

πŸ’»

abstanton

πŸ’»

Sabu Siyad

πŸ’»

pspiagicw

πŸ’»

Ryan Hertz

πŸ’»

tharunc

πŸ“–

Ananthakrishnan Nair RS

πŸ“–

Muthu Annamalai.V

πŸ“–

Ayushman

πŸ’»

Tushar Nankani

πŸ’»

Ikko Ashimine

πŸ“–

Sidharth Ajithkumar

πŸ’»

Sam Sheffres

πŸ’»

Rushi Dolas

πŸ’»

mostlyvirtual

πŸ’»
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! ### Bugs If you are experiencing any bugs, don’t forget to open a [new issue](https://github.com/gautamkrishnar/socli/issues/new). ### Error Solving If you encounter "AttributeError: 'module' object has no attribute 'SSL ST INIT' ``` sudo pip uninstall pyopenssl sudo pip install pyopenssl or sudo easy_install pyopenssl ``` ### Thanks * Thanks to all the existing users of SoCLI. * Thanks to all upvoters and followers on reddit. * [impress that girl in the Starbucks by browsing SO with your CLI app XD XD](https://www.reddit.com/r/programmingcirclejerk/comments/4pwil4/impress_that_girl_in_the_starbucks_by_browsing_so/) by [insane0hflex](https://www.reddit.com/user/insane0hflex). Thanks for the post πŸ˜‰ * Special thanks to people who wrote about SoCLI on their blogs and websites: * [wykop.pl](http://www.wykop.pl/wpis/18286681/python-stackoverflow-interfejs-bo-sciaga-musi-byc-/) * [memect.com](http://forum.memect.com/blog/thread/py-2016-06-26/) * [pseudoscripter](https://pseudoscripter.wordpress.com/2016/06/28/socli-stack-overflow-command-line-client/) * [b.hatena.ne.jp](http://b.hatena.ne.jp/entry/s/github.com/gautamkrishnar/socli) * [jericson.github.io](http://jericson.github.io/2016/08/25/long_tail_docs.html) * [The really big list of really interesting Open Source projects](https://medium.com/@likid.geimfari/the-list-of-interesting-open-source-projects-2daaa2153f7c#.6qm1v3ioa) * [Ostechnix](http://www.ostechnix.com/search-browse-stack-overflow-website-commandline/) * [lamiradadelreplicante.com](lamiradadelreplicante.com/2017/04/17/socli-navegando-por-stack-overflow-sin-salir-de-la-terminal) * [dou.ua](https://dou.ua/lenta/digests/python-digest-13/) * Tweets: * [@cyb3rops](https://twitter.com/cyb3rops/status/747380776350650368) * [@pythontrending](https://twitter.com/pythontrending/status/745635512803819521) * Thanks to my favourite IDE JetBrains PyCharm ❀️ πŸ˜„ ### Sponsors Sponsor SoCLI on [Open Collective](https://opencollective.com/socli): * Thanks [Steven Reubenstone](https://www.collaborizm.com/profile/1) for contributing $5 for the issue [#22](https://github.com/gautamkrishnar/socli/issues/22) ### Liked it? Hope you liked this project, don't forget to give it a star ⭐ %package -n python3-socli Summary: Stack overflow command line interface. SoCLI allows you to search and browse stack overflow from the terminal. Provides: python-socli BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-socli # SoCLI [![PyPI](https://img.shields.io/pypi/v/socli?color=brightgreen) ![PyPI Downloads](https://img.shields.io/pypi/dm/socli)](https://pypi.org/project/socli/) [![Build Status](https://travis-ci.com/gautamkrishnar/socli.svg?branch=master)](https://travis-ci.com/gautamkrishnar/socli) [![Gitter Chat](https://badges.gitter.im/socli-community/Lobby.svg)](https://gitter.im/socli-community/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Stack Overflow command line written in python. Using SoCLI you can search and browse Stack Overflow without leaving the terminal. Just use the **socli** command: ![SoCLI in action](https://cloud.githubusercontent.com/assets/8397274/24831468/86c290aa-1cb7-11e7-8161-2665d0c02e4b.gif) ### Installation ##### Supported platforms * Linux * Windows * Mac ##### Requirements * Python 3.5 or higher ##### For Linux Install **python** and just use **pip** command to install **socli**: ```bash sudo apt-get install python3 python3-pip pip install socli ``` ##### For Windows [Download and install Python](https://www.python.org/downloads/). Don't forget to check the option "Add to path". Open a command prompt with administrative privileges and use **pip** command to install **socli**: ```bash pip install socli ``` Use **easy_install** if your python path has a space in it. [Read more: "Failed to create process"](https://github.com/gautamkrishnar/socli/issues/6): ``` easy_install socli ``` ##### For Mac/Linux (via [homebrew](https://brew.sh/)) Install **socli**: ```bash brew tap gautamkrishnar/socli brew install socli ``` ##### Enabling the shell autocompletion If you installed socli via pyPi you may need to enable the shell autocompletion. Add the following to your `.bashrc` file to enable it: ```bash socli --register ``` ### Updating Use the command below to update your existing version of **socli** to the newest version so that you won't miss any features: ```bash pip install --upgrade socli ``` If you installed via homebrew: ```bash brew upgrade socli ``` ### Usage ##### Quick Search Use the **socli** command followed by the search query: ```bash socli for loop in python syntax ``` The above command will search for the query "*for loop in python syntax*" and displays the first most voted question in Stack Overflow with its most voted answer. Pretty quick, right? ##### Interactive Search You can search Stack Overflow interactively by using the command below: ```sh socli -iq html error 404 ``` This will display a list of questions from Stack Overflow for the query "*html error 404*" and it will allow you to choose any of the questions you like interactively. When you choose a question, it will display the complete description of the chosen question with its most voted answer. You can also browse through the other answers to that question using the up and down arrow keys as well as go back to the list of questions using the left arrow key. ##### Manual Search This will allow you to specify a requested question number for your query. For example, consider the following command: ```sh socli -r 2 -q javascript prototype function ``` This command searches for "*javascript prototype function*" in Stack Overflow and displays the second question that contains it. ##### Topic-Based Search Stack Overflow supports topic by using tags. **socli** allows you to query Stack Overflow based on specific tags. Just specify the tag via the following command: ```sh socli -t javascript -q window.open ``` You can also specify multiple tags, Just separate them with a comma: ```sh socli -t javascript,node.js -q window.open ``` See the complete list of tags [here](http://stackoverflow.com/tags). ##### User Profile Browsing Just use the command below to set your [user ID]( http://meta.stackexchange.com/a/111130) in socli. When you execute the command next time, it will automatically fetch the data. ```sh socli -u ``` if your are an extensive user of StackOverflow, **socli** allows you to set your own API key to overcome the [StackOverflow API Limitations](http://stackapps.com/a/3057/41332). Just use the command below: ```sh socli --api ``` You can get an API Key [here](http://stackapps.com/apps/oauth/register) by registering as a new app. Please don't use SoCLI as app name. ##### Posting a New Question If you can't find an answer for your question in Stack Overflow, **socli** allows you to create a new question via the web browser. Just type the command below and **socli** will open the new question page of Stack Overflow in the web browser for you: ```sh socli -n ``` ##### Opening a url directly If you have the url of the Stack Overflow post then you can pass it using `--open-url` or `-o`. For example ``` socli --open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works``` ### Syntax: **socli** has the following syntax ``` Usage: socli [ Arguments] < Search Query > ``` ###### Arguments (optional) | Short | Long | Description | Example | |--------|--------|--------|--------| | -q | --query | Used to specify the query when arguments are used. A query value must be passed to it. If it is used alone (socli -q query) then it will display the same result as **socli query**. | **socli -q query** | | -i | --interactive | Used to search interactively. It doesn't take any values. It must be followed by a -q or --query after it. | **socli -i -q query** | | -r | --res | Used for manual search. It takes the question number as the argument and it must be followed by a -q or --query after it. | **socli -r 4 -q query** | | -t | --tag | Specifies the tag to search for the query on Stack Overflow. It must be followed by a -q or --query after it. | **socli -t js -q query** | | -n | --new | Opens the web browser to create a new question on Stack Overflow. | **socli --new** | | -u | --user | Displays the user profile informations. If no argument is given, it will display your profile. | **socli -u 22656** | | -a | --api | Sets a custom API key. | **socli --api** | | -d | --del | Deletes the configuration file generated by socli -u manually. | **socli -d** | | -s | --sosearch | SoCLI uses Google search by default to search for questions. To override this and use stackoverflow's default search instead. | **socli -s -q for loop python** | | -h | --help | Displays the help text. | **socli --help** | | -o | --open-url | Displays the given url in socli if possible if not opens in browser. | **socli -o https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works** | | -j | --json-output | Gives output to stdout as json | **socli -jq for loop python** | | -g | --register | Registers socli's shell autocompletion | socli -g | | -v | --version | Displays the version of socli. | **socli -v** | ###### Query This term refers to what you're searching for in Stack Overflow. ### Features These are the amazing features of SoCLI: * Manual Search * Interactively browse Stack Overflow using the interactive mode * Coloured interface * Question stats view * Tag support * Can open the page in a browser * Can view user profiles * Can create a new question via the web browser * Can open a Stack Overflow page on the terminal directly from a url ### To Do Command line interface for: - [ ] Stack Overflow authentication - [ ] Posting to Stack Overflow - [ ] Upvote answer - [ ] Comment on an answer - [ ] Browsing stackoverflow home page Please check out the list of [issues](https://github.com/gautamkrishnar/socli/issues). ### Testing Automated tests are setup by using [pytest](https://docs.pytest.org/en/latest/contents.html), the tests can be run locally by invoking a `python setup.py test`. All tests are in the `socli/tests/` subdirectory of this repository. TravisCI is supposed to run the test-suite on build. ### πŸ’₯ How to Contribute ? If you are willing to contribute to SoCLI project, you are awesome! Just follow the steps given in [CONTRIBUTING.md](https://github.com/gautamkrishnar/socli/blob/master/CONTRIBUTING.md) πŸ˜ƒ ## Maintainers Please reach out to any of the following people if you have any queries:

Gautam krishna R

πŸ’»

Hedy Li

πŸ’»
## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

aaxu

πŸ’»

kilbee

πŸ’»

Sam Dean

πŸ“–

mwwynne

πŸ’»

Carlos J. Puga Medina

πŸ›

Jon Ericson

πŸ’»

Ankit Kr. Singh

πŸ’»

Harsha Alva

πŸ’»

Pia Mancini

πŸ“–

Aditya Tandon

πŸ›

Akshatha Nayak

πŸ’»

Liam Hawkins

πŸ’»

Arount

πŸ’»

CΓ©dric Picard

πŸ›

Amartya Chaudhuri

πŸ’»

Elliott Beach

πŸ’»

Prashant Chahal

πŸ’»

Insiyah Hajoori

πŸ’»

C

πŸ’»

Liam Byrne

πŸ’»

Tran Chi Khang

πŸ’»

Alix Poulsen

πŸ“–

albalitz

πŸ’»

Aniruddha Bhattacharjee

πŸ’»

Daniel St.Jacques

πŸ’»

Donnell Muse

πŸ’»

JM Lopez

πŸ’»

JOBIN PHILIP ABRAHAM

πŸ“–

Jakub Kukul

πŸ’»

Pigeon

πŸ“–

Rajdeep Biswas

πŸ’»

Sachin Kukreja

πŸ’»

Simon Reap

πŸ’»

Srisaila

πŸ’»

agarwalnishtha

πŸ’»

Frederick Kozlowski

πŸ’»

Esha Lath

πŸ’»

thumpri

πŸ’»

Adam Zhang

πŸ’»

prathampowar2001

πŸ’»

Subhankar Hotta

πŸ’»

ankushduacodes

πŸ’»

Shriram Bhat

πŸ’»

Vjs Pranav

πŸ’»

Saif Kazi

πŸ’»

pstreff

πŸ’»

anshik1998

πŸ’»

abstanton

πŸ’»

Sabu Siyad

πŸ’»

pspiagicw

πŸ’»

Ryan Hertz

πŸ’»

tharunc

πŸ“–

Ananthakrishnan Nair RS

πŸ“–

Muthu Annamalai.V

πŸ“–

Ayushman

πŸ’»

Tushar Nankani

πŸ’»

Ikko Ashimine

πŸ“–

Sidharth Ajithkumar

πŸ’»

Sam Sheffres

πŸ’»

Rushi Dolas

πŸ’»

mostlyvirtual

πŸ’»
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! ### Bugs If you are experiencing any bugs, don’t forget to open a [new issue](https://github.com/gautamkrishnar/socli/issues/new). ### Error Solving If you encounter "AttributeError: 'module' object has no attribute 'SSL ST INIT' ``` sudo pip uninstall pyopenssl sudo pip install pyopenssl or sudo easy_install pyopenssl ``` ### Thanks * Thanks to all the existing users of SoCLI. * Thanks to all upvoters and followers on reddit. * [impress that girl in the Starbucks by browsing SO with your CLI app XD XD](https://www.reddit.com/r/programmingcirclejerk/comments/4pwil4/impress_that_girl_in_the_starbucks_by_browsing_so/) by [insane0hflex](https://www.reddit.com/user/insane0hflex). Thanks for the post πŸ˜‰ * Special thanks to people who wrote about SoCLI on their blogs and websites: * [wykop.pl](http://www.wykop.pl/wpis/18286681/python-stackoverflow-interfejs-bo-sciaga-musi-byc-/) * [memect.com](http://forum.memect.com/blog/thread/py-2016-06-26/) * [pseudoscripter](https://pseudoscripter.wordpress.com/2016/06/28/socli-stack-overflow-command-line-client/) * [b.hatena.ne.jp](http://b.hatena.ne.jp/entry/s/github.com/gautamkrishnar/socli) * [jericson.github.io](http://jericson.github.io/2016/08/25/long_tail_docs.html) * [The really big list of really interesting Open Source projects](https://medium.com/@likid.geimfari/the-list-of-interesting-open-source-projects-2daaa2153f7c#.6qm1v3ioa) * [Ostechnix](http://www.ostechnix.com/search-browse-stack-overflow-website-commandline/) * [lamiradadelreplicante.com](lamiradadelreplicante.com/2017/04/17/socli-navegando-por-stack-overflow-sin-salir-de-la-terminal) * [dou.ua](https://dou.ua/lenta/digests/python-digest-13/) * Tweets: * [@cyb3rops](https://twitter.com/cyb3rops/status/747380776350650368) * [@pythontrending](https://twitter.com/pythontrending/status/745635512803819521) * Thanks to my favourite IDE JetBrains PyCharm ❀️ πŸ˜„ ### Sponsors Sponsor SoCLI on [Open Collective](https://opencollective.com/socli): * Thanks [Steven Reubenstone](https://www.collaborizm.com/profile/1) for contributing $5 for the issue [#22](https://github.com/gautamkrishnar/socli/issues/22) ### Liked it? Hope you liked this project, don't forget to give it a star ⭐ %package help Summary: Development documents and examples for socli Provides: python3-socli-doc %description help # SoCLI [![PyPI](https://img.shields.io/pypi/v/socli?color=brightgreen) ![PyPI Downloads](https://img.shields.io/pypi/dm/socli)](https://pypi.org/project/socli/) [![Build Status](https://travis-ci.com/gautamkrishnar/socli.svg?branch=master)](https://travis-ci.com/gautamkrishnar/socli) [![Gitter Chat](https://badges.gitter.im/socli-community/Lobby.svg)](https://gitter.im/socli-community/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) Stack Overflow command line written in python. Using SoCLI you can search and browse Stack Overflow without leaving the terminal. Just use the **socli** command: ![SoCLI in action](https://cloud.githubusercontent.com/assets/8397274/24831468/86c290aa-1cb7-11e7-8161-2665d0c02e4b.gif) ### Installation ##### Supported platforms * Linux * Windows * Mac ##### Requirements * Python 3.5 or higher ##### For Linux Install **python** and just use **pip** command to install **socli**: ```bash sudo apt-get install python3 python3-pip pip install socli ``` ##### For Windows [Download and install Python](https://www.python.org/downloads/). Don't forget to check the option "Add to path". Open a command prompt with administrative privileges and use **pip** command to install **socli**: ```bash pip install socli ``` Use **easy_install** if your python path has a space in it. [Read more: "Failed to create process"](https://github.com/gautamkrishnar/socli/issues/6): ``` easy_install socli ``` ##### For Mac/Linux (via [homebrew](https://brew.sh/)) Install **socli**: ```bash brew tap gautamkrishnar/socli brew install socli ``` ##### Enabling the shell autocompletion If you installed socli via pyPi you may need to enable the shell autocompletion. Add the following to your `.bashrc` file to enable it: ```bash socli --register ``` ### Updating Use the command below to update your existing version of **socli** to the newest version so that you won't miss any features: ```bash pip install --upgrade socli ``` If you installed via homebrew: ```bash brew upgrade socli ``` ### Usage ##### Quick Search Use the **socli** command followed by the search query: ```bash socli for loop in python syntax ``` The above command will search for the query "*for loop in python syntax*" and displays the first most voted question in Stack Overflow with its most voted answer. Pretty quick, right? ##### Interactive Search You can search Stack Overflow interactively by using the command below: ```sh socli -iq html error 404 ``` This will display a list of questions from Stack Overflow for the query "*html error 404*" and it will allow you to choose any of the questions you like interactively. When you choose a question, it will display the complete description of the chosen question with its most voted answer. You can also browse through the other answers to that question using the up and down arrow keys as well as go back to the list of questions using the left arrow key. ##### Manual Search This will allow you to specify a requested question number for your query. For example, consider the following command: ```sh socli -r 2 -q javascript prototype function ``` This command searches for "*javascript prototype function*" in Stack Overflow and displays the second question that contains it. ##### Topic-Based Search Stack Overflow supports topic by using tags. **socli** allows you to query Stack Overflow based on specific tags. Just specify the tag via the following command: ```sh socli -t javascript -q window.open ``` You can also specify multiple tags, Just separate them with a comma: ```sh socli -t javascript,node.js -q window.open ``` See the complete list of tags [here](http://stackoverflow.com/tags). ##### User Profile Browsing Just use the command below to set your [user ID]( http://meta.stackexchange.com/a/111130) in socli. When you execute the command next time, it will automatically fetch the data. ```sh socli -u ``` if your are an extensive user of StackOverflow, **socli** allows you to set your own API key to overcome the [StackOverflow API Limitations](http://stackapps.com/a/3057/41332). Just use the command below: ```sh socli --api ``` You can get an API Key [here](http://stackapps.com/apps/oauth/register) by registering as a new app. Please don't use SoCLI as app name. ##### Posting a New Question If you can't find an answer for your question in Stack Overflow, **socli** allows you to create a new question via the web browser. Just type the command below and **socli** will open the new question page of Stack Overflow in the web browser for you: ```sh socli -n ``` ##### Opening a url directly If you have the url of the Stack Overflow post then you can pass it using `--open-url` or `-o`. For example ``` socli --open-url https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works``` ### Syntax: **socli** has the following syntax ``` Usage: socli [ Arguments] < Search Query > ``` ###### Arguments (optional) | Short | Long | Description | Example | |--------|--------|--------|--------| | -q | --query | Used to specify the query when arguments are used. A query value must be passed to it. If it is used alone (socli -q query) then it will display the same result as **socli query**. | **socli -q query** | | -i | --interactive | Used to search interactively. It doesn't take any values. It must be followed by a -q or --query after it. | **socli -i -q query** | | -r | --res | Used for manual search. It takes the question number as the argument and it must be followed by a -q or --query after it. | **socli -r 4 -q query** | | -t | --tag | Specifies the tag to search for the query on Stack Overflow. It must be followed by a -q or --query after it. | **socli -t js -q query** | | -n | --new | Opens the web browser to create a new question on Stack Overflow. | **socli --new** | | -u | --user | Displays the user profile informations. If no argument is given, it will display your profile. | **socli -u 22656** | | -a | --api | Sets a custom API key. | **socli --api** | | -d | --del | Deletes the configuration file generated by socli -u manually. | **socli -d** | | -s | --sosearch | SoCLI uses Google search by default to search for questions. To override this and use stackoverflow's default search instead. | **socli -s -q for loop python** | | -h | --help | Displays the help text. | **socli --help** | | -o | --open-url | Displays the given url in socli if possible if not opens in browser. | **socli -o https://stackoverflow.com/questions/20639180/explanation-of-how-nested-list-comprehension-works** | | -j | --json-output | Gives output to stdout as json | **socli -jq for loop python** | | -g | --register | Registers socli's shell autocompletion | socli -g | | -v | --version | Displays the version of socli. | **socli -v** | ###### Query This term refers to what you're searching for in Stack Overflow. ### Features These are the amazing features of SoCLI: * Manual Search * Interactively browse Stack Overflow using the interactive mode * Coloured interface * Question stats view * Tag support * Can open the page in a browser * Can view user profiles * Can create a new question via the web browser * Can open a Stack Overflow page on the terminal directly from a url ### To Do Command line interface for: - [ ] Stack Overflow authentication - [ ] Posting to Stack Overflow - [ ] Upvote answer - [ ] Comment on an answer - [ ] Browsing stackoverflow home page Please check out the list of [issues](https://github.com/gautamkrishnar/socli/issues). ### Testing Automated tests are setup by using [pytest](https://docs.pytest.org/en/latest/contents.html), the tests can be run locally by invoking a `python setup.py test`. All tests are in the `socli/tests/` subdirectory of this repository. TravisCI is supposed to run the test-suite on build. ### πŸ’₯ How to Contribute ? If you are willing to contribute to SoCLI project, you are awesome! Just follow the steps given in [CONTRIBUTING.md](https://github.com/gautamkrishnar/socli/blob/master/CONTRIBUTING.md) πŸ˜ƒ ## Maintainers Please reach out to any of the following people if you have any queries:

Gautam krishna R

πŸ’»

Hedy Li

πŸ’»
## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

aaxu

πŸ’»

kilbee

πŸ’»

Sam Dean

πŸ“–

mwwynne

πŸ’»

Carlos J. Puga Medina

πŸ›

Jon Ericson

πŸ’»

Ankit Kr. Singh

πŸ’»

Harsha Alva

πŸ’»

Pia Mancini

πŸ“–

Aditya Tandon

πŸ›

Akshatha Nayak

πŸ’»

Liam Hawkins

πŸ’»

Arount

πŸ’»

CΓ©dric Picard

πŸ›

Amartya Chaudhuri

πŸ’»

Elliott Beach

πŸ’»

Prashant Chahal

πŸ’»

Insiyah Hajoori

πŸ’»

C

πŸ’»

Liam Byrne

πŸ’»

Tran Chi Khang

πŸ’»

Alix Poulsen

πŸ“–

albalitz

πŸ’»

Aniruddha Bhattacharjee

πŸ’»

Daniel St.Jacques

πŸ’»

Donnell Muse

πŸ’»

JM Lopez

πŸ’»

JOBIN PHILIP ABRAHAM

πŸ“–

Jakub Kukul

πŸ’»

Pigeon

πŸ“–

Rajdeep Biswas

πŸ’»

Sachin Kukreja

πŸ’»

Simon Reap

πŸ’»

Srisaila

πŸ’»

agarwalnishtha

πŸ’»

Frederick Kozlowski

πŸ’»

Esha Lath

πŸ’»

thumpri

πŸ’»

Adam Zhang

πŸ’»

prathampowar2001

πŸ’»

Subhankar Hotta

πŸ’»

ankushduacodes

πŸ’»

Shriram Bhat

πŸ’»

Vjs Pranav

πŸ’»

Saif Kazi

πŸ’»

pstreff

πŸ’»

anshik1998

πŸ’»

abstanton

πŸ’»

Sabu Siyad

πŸ’»

pspiagicw

πŸ’»

Ryan Hertz

πŸ’»

tharunc

πŸ“–

Ananthakrishnan Nair RS

πŸ“–

Muthu Annamalai.V

πŸ“–

Ayushman

πŸ’»

Tushar Nankani

πŸ’»

Ikko Ashimine

πŸ“–

Sidharth Ajithkumar

πŸ’»

Sam Sheffres

πŸ’»

Rushi Dolas

πŸ’»

mostlyvirtual

πŸ’»
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! ### Bugs If you are experiencing any bugs, don’t forget to open a [new issue](https://github.com/gautamkrishnar/socli/issues/new). ### Error Solving If you encounter "AttributeError: 'module' object has no attribute 'SSL ST INIT' ``` sudo pip uninstall pyopenssl sudo pip install pyopenssl or sudo easy_install pyopenssl ``` ### Thanks * Thanks to all the existing users of SoCLI. * Thanks to all upvoters and followers on reddit. * [impress that girl in the Starbucks by browsing SO with your CLI app XD XD](https://www.reddit.com/r/programmingcirclejerk/comments/4pwil4/impress_that_girl_in_the_starbucks_by_browsing_so/) by [insane0hflex](https://www.reddit.com/user/insane0hflex). Thanks for the post πŸ˜‰ * Special thanks to people who wrote about SoCLI on their blogs and websites: * [wykop.pl](http://www.wykop.pl/wpis/18286681/python-stackoverflow-interfejs-bo-sciaga-musi-byc-/) * [memect.com](http://forum.memect.com/blog/thread/py-2016-06-26/) * [pseudoscripter](https://pseudoscripter.wordpress.com/2016/06/28/socli-stack-overflow-command-line-client/) * [b.hatena.ne.jp](http://b.hatena.ne.jp/entry/s/github.com/gautamkrishnar/socli) * [jericson.github.io](http://jericson.github.io/2016/08/25/long_tail_docs.html) * [The really big list of really interesting Open Source projects](https://medium.com/@likid.geimfari/the-list-of-interesting-open-source-projects-2daaa2153f7c#.6qm1v3ioa) * [Ostechnix](http://www.ostechnix.com/search-browse-stack-overflow-website-commandline/) * [lamiradadelreplicante.com](lamiradadelreplicante.com/2017/04/17/socli-navegando-por-stack-overflow-sin-salir-de-la-terminal) * [dou.ua](https://dou.ua/lenta/digests/python-digest-13/) * Tweets: * [@cyb3rops](https://twitter.com/cyb3rops/status/747380776350650368) * [@pythontrending](https://twitter.com/pythontrending/status/745635512803819521) * Thanks to my favourite IDE JetBrains PyCharm ❀️ πŸ˜„ ### Sponsors Sponsor SoCLI on [Open Collective](https://opencollective.com/socli): * Thanks [Steven Reubenstone](https://www.collaborizm.com/profile/1) for contributing $5 for the issue [#22](https://github.com/gautamkrishnar/socli/issues/22) ### Liked it? Hope you liked this project, don't forget to give it a star ⭐ %prep %autosetup -n socli-7.3 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-socli -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Mon May 29 2023 Python_Bot - 7.3-1 - Package Spec generated