File tree 7 files changed +73
-0
lines changed
AutomationScripts/Quotes Automation
7 files changed +73
-0
lines changed Original file line number Diff line number Diff line change
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 >
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
1
+ pip == 21.1.2
2
+ quote == 2.0.4
3
+ random == 21.0.1
You can’t perform that action at this time.
0 commit comments