Skip to content

Commit 44f8464

Browse files
Merge pull request prathimacode-hub#597 from Umesh-01/patch-7
added a script for quotes automation
2 parents 8ddf528 + 0d70337 commit 44f8464

File tree

7 files changed

+73
-0
lines changed

7 files changed

+73
-0
lines changed
33.3 KB
Loading
34.3 KB
Loading
20.1 KB
Loading
18.1 KB
Loading

Diff for: AutomationScripts/Quotes Automation/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Quotes Automation
2+
For quotes automation we are using `quote` library which is a python wrapper for the Goodreads Quote API.
3+
To generate a random quote we will be using the quote function from the quote module.
4+
5+
### Installation
6+
7+
Install with `pip` command in any terminal
8+
```python
9+
pip install poetpy
10+
```
11+
12+
OR
13+
14+
```python
15+
pip install -r requirements.txt
16+
```
17+
18+
### Working
19+
20+
It is simple to use and `quote` library can also be used from the command line tool.
21+
22+
```python
23+
from quote import quote
24+
25+
author = 'Albert Einstein'
26+
27+
result = quote(author, limit=2)
28+
29+
print(result)
30+
```
31+
32+
### Output
33+
#### In PyCharm
34+
35+
<img src="https://github.com/Umesh-01/Awesome_Python_Scripts/blob/patch-7/AutomationScripts/Quotes%20Automation/Images/quotes_img1.png">
36+
37+
<img src="https://github.com/Umesh-01/Awesome_Python_Scripts/blob/patch-7/AutomationScripts/Quotes%20Automation/Images/quotes_img2.png">
38+
39+
#### In CLI
40+
41+
<img src="https://github.com/Umesh-01/Awesome_Python_Scripts/blob/patch-7/AutomationScripts/Quotes%20Automation/Images/quotes_img3.png">
42+
43+
<img src="https://github.com/Umesh-01/Awesome_Python_Scripts/blob/patch-7/AutomationScripts/Quotes%20Automation/Images/quotes_img4.png">
44+
45+
### Contributor
46+
47+
<a href="https://github.com/Umesh-01">Umesh Singh</a>
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# install quote library using pip install quote
2+
# import quote from quote library
3+
from quote import quote
4+
import random
5+
6+
try:
7+
print("Tell me the author or person name?")
8+
9+
# taking the name as input to get the quotes related to that author/person
10+
q_author = input()
11+
12+
# getting the quotes into quotes variable
13+
quotes = quote(q_author)
14+
15+
# selecting a random quote from multiple quotes
16+
quote_no = random.randint(1, len(quotes))
17+
18+
# displaying the quote with author name
19+
print("Author: ", quotes[quote_no]['author'])
20+
print("-->", quotes[quote_no]['quote'])
21+
22+
except Exception as e:
23+
pass

Diff for: AutomationScripts/Quotes Automation/requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pip==21.1.2
2+
quote==2.0.4
3+
random==21.0.1

0 commit comments

Comments
 (0)