Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/viveksb007/pybrainyquote
Python Package to get quotes from BrainyQuote.
https://github.com/viveksb007/pybrainyquote
Last synced: 25 days ago
JSON representation
Python Package to get quotes from BrainyQuote.
- Host: GitHub
- URL: https://github.com/viveksb007/pybrainyquote
- Owner: viveksb007
- License: mit
- Created: 2016-08-02T18:47:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-31T01:49:37.000Z (about 5 years ago)
- Last Synced: 2024-11-07T19:54:00.401Z (about 2 months ago)
- Language: Python
- Homepage: https://pypi.python.org/pypi/brainyquote/0.1
- Size: 7.81 KB
- Stars: 9
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# pybrainyquote
Python Package to get quotes from [`BrainyQuote`](http://www.brainyquote.com/)
Install using pip:
pip install brainyquote
## Dependencies :beautifulsoup4
requests## Install Dependencies :
pip install beautifulsoup4
pip install requests## Usage
### Get quotes from topic
```python
from brainyquote import pybrainyquote
print(pybrainyquote.get_quotes('inspirational')) # returns one quote from the 'inspirational' topic
print(pybrainyquote.get_quotes('motivational', 3)) # returns list with 3 quotes from the 'motivational' topic
```All parameters suggested in [`Topics`](http://www.brainyquote.com/quotes/topics.html) are supported.
### Get a single quote
```python
from brainyquote import pybrainyquoteprint(pybrainyquote.get_random_quote()) # returns random quotes on popular_choice
```Change **[popular_choice](https://github.com/viveksb007/pybrainyquote/blob/master/brainyquote/pybrainyquote.py)** for more random quotes
## Quote
All quotes returned follow the same format. First they contain the quote itself in single quotes, which is followed by the author.
### Example
```python
from brainyquote import pybrainyquotequote = pybrainyquote.get_random_quote()
# may return: "'Choosing to be positive and having a grateful attitude is going to determine how you're going to live your life.' Joel Osteen"
```## Features
* returns number of quotes in list specified as ``` get_quotes( 'topic', number_of_quotes ) ```
* return any random quote from popular topics as ``` get_random_quote() ```# License
>(c) 2016 Vivek Singh Bhadauria>This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
>This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
>You should have received a copy of the GNU General Public License along with this app. If not, see .