1
+ # This is like making a package.lock file for npm package.
2
+ # Yes, I should be making it.
3
+ __author__ = "Nitkarsh Chourasia"
4
+ __version__ = "0.0.0" # SemVer # Understand more about it
5
+ __license__ = "MIT" # Understand more about it
6
+ # Want to make it open source but how to do it?
1
7
# Program to make a simple calculator
8
+ # Will have to extensively work on Jarvis and local_document and MongoDb and Redis and JavaScript and CSS and DOM manipulation to understand it.
9
+ # Will have to study maths to understand it more better.
10
+ # How can I market gtts? Like showing used google's api? This is how can I market it?
11
+ # Project description? What will be the project description?
2
12
3
13
from numbers import Number
4
14
from sys import exit
12
22
import date
13
23
14
24
25
+ # Find the best of best extensions for the auto generation of the documentation parts.
26
+ # For your favourite languages like JavaScript, Python ,etc,...
15
27
# Should be able to print date and time too.
16
28
# Should use voice assistant for specially abled people.
17
29
# A fully personalised calculator.
@@ -26,39 +38,172 @@ def __init__(self):
26
38
self .take_inputs ()
27
39
28
40
def add (self ):
41
+ """summary: Get the sum of numbers
42
+
43
+ Returns:
44
+ _type_: _description_
45
+ """
29
46
return self .num1 + self .num2
30
47
31
48
def sub (self ):
49
+ """_summary_: Get the difference of numbers
50
+
51
+ Returns:
52
+ _type_: _description_
53
+ """
32
54
return self .num1 - self .num2
33
55
34
56
def multi (self ):
57
+ """_summary_: Get the product of numbers
58
+
59
+ Returns:
60
+ _type_: _description_
61
+ """
35
62
return self .num1 * self .num2
36
63
37
64
def div (self ):
65
+ """_summary_: Get the quotient of numbers
66
+
67
+ Returns:
68
+ _type_: _description_
69
+ """
70
+ # What do we mean by quotient?
38
71
return self .num1 / self .num2
39
72
40
73
def power (self ):
74
+ """_summary_: Get the power of numbers
75
+
76
+ Returns:
77
+ _type_: _description_
78
+ """
41
79
return self .num1 ** self .num2
42
80
43
81
def root (self ):
82
+ """_summary_: Get the root of numbers
83
+
84
+ Returns:
85
+ _type_: _description_
86
+ """
44
87
return self .num1 ** (1 / self .num2 )
45
88
46
89
def remainer (self ):
90
+ """_summary_: Get the remainder of numbers
91
+
92
+ Returns:
93
+ _type_: _description_
94
+ """
95
+
96
+ # Do I have to use the '.' period or full_stop in the numbers?
47
97
return self .num1 % self .num2
48
98
49
99
def cube_root (self ):
100
+ """_summary_: Get the cube root of numbers
101
+
102
+ Returns:
103
+ _type_: _description_
104
+ """
50
105
return self .num1 ** (1 / 3 )
51
106
52
107
def cube_exponent (self ):
108
+ """_summary_: Get the cube exponent of numbers
109
+
110
+ Returns:
111
+ _type_: _description_
112
+ """
53
113
return self .num1 ** 3
54
114
55
115
def square_root (self ):
116
+ """_summary_: Get the square root of numbers
117
+
118
+ Returns:
119
+ _type_: _description_
120
+ """
56
121
return self .num1 ** (1 / 2 )
57
122
58
123
def square_exponent (self ):
124
+ """_summary_: Get the square exponent of numbers
125
+
126
+ Returns:
127
+ _type_: _description_
128
+ """
59
129
return self .num1 ** 2
60
130
131
+ def factorial (self ):
132
+ """_summary_: Get the factorial of numbers"""
133
+ pass
134
+
135
+ def list_factors (self ):
136
+ """_summary_: Get the list of factors of numbers"""
137
+ pass
138
+
139
+ def factorial (self ):
140
+ for i in range (1 , self .num + 1 ):
141
+ self .factorial = self .factorial * i # is this right?
142
+
143
+ def LCM (self ):
144
+ """_summary_: Get the LCM of numbers"""
145
+ pass
146
+
147
+ def HCF (self ):
148
+ """_summary_: Get the HCF of numbers"""
149
+ pass
150
+
151
+ # class time: # Working with days calculator
152
+ def age_calculator (self ):
153
+ """_summary_: Get the age of the user"""
154
+ # This is be very accurate and precise it should include proper leap year and last birthday till now every detail.
155
+ # Should show the preciseness in seconds when called.
156
+ pass
157
+
158
+ def days_calculator (self ):
159
+ """_summary_: Get the days between two dates"""
160
+ pass
161
+
162
+ def leap_year (self ):
163
+ """_summary_: Get the leap year of the user"""
164
+ pass
165
+
166
+ def perimeter (self ):
167
+ """_summary_: Get the perimeter of the user"""
168
+ pass
169
+
170
+ class Trigonometry :
171
+ """_summary_: Class enriched with all the methods to solve basic trignometric problems"""
172
+
173
+ def pythagorean_theorem (self ):
174
+ """_summary_: Get the pythagorean theorem of the user"""
175
+ pass
176
+
177
+ def find_hypotenuse (self ):
178
+ """_summary_: Get the hypotenuse of the user"""
179
+ pass
180
+
181
+ def find_base (self ):
182
+ """_summary_: Get the base of the user"""
183
+ pass
184
+
185
+ def find_perpendicular (self ):
186
+ """_summary_: Get the perpendicular of the user"""
187
+ pass
188
+
189
+ # class Logarithms:
190
+ # Learn more about Maths in general
191
+
192
+ def quadratic_equation (self ):
193
+ """_summary_: Get the quadratic equation of the user"""
194
+ pass
195
+
196
+ def open_system_calculator (self ):
197
+ """_summary_: Open the calculator present on the machine of the user"""
198
+ # first identify the os
199
+ # track the calculator
200
+ # add a debugging feature like error handling
201
+ # for linux and mac
202
+ # if no such found then print a message to the user that sorry dear it wasn't possible to so
203
+ # then open it
204
+
61
205
def take_inputs (self ):
206
+ """_summary_: Take the inputs from the user in proper sucession"""
62
207
while True :
63
208
while True :
64
209
try :
@@ -76,6 +221,7 @@ def take_inputs(self):
76
221
# exit() # Some how I need to exit it
77
222
78
223
def greeting (self ):
224
+ """_summary_: Greet the user with using Audio"""
79
225
text_to_audio = "Welcome To The Calculator"
80
226
self .gtts_object = gTTS (text = text_to_audio , lang = "en" , tld = "co.in" , slow = False )
81
227
tts = self .gtts_object
@@ -90,6 +236,7 @@ def greeting(self):
90
236
91
237
# Here OOP is not followed.
92
238
def user_name (self ):
239
+ """_summary_: Get the name of the user and have an option to greet him/her"""
93
240
self .name = input ("Please enter your good name: " )
94
241
# Making validation checks here
95
242
text_to_audio = "{self.name}"
@@ -105,6 +252,12 @@ def user_name(self):
105
252
time .Clock ().tick (10 )
106
253
107
254
def user_name_art (self ):
255
+ """_summary_: Get the name of the user and have an option to show him his user name in art"""
256
+ # Default is to show = True, else False if user tries to disable it.
257
+
258
+ # Tell him to show the time and date
259
+ # print(art.text2art(self.name))
260
+ # print(date and time of now)
108
261
# Remove whitespaces from beginning and end
109
262
# Remove middle name and last name
110
263
# Remove special characters
@@ -122,6 +275,99 @@ def user_name_art(self):
122
275
# Remove numbers
123
276
# Remove everything
124
277
278
+ class unitConversion :
279
+ """_summary_: Class enriched with all the methods to convert units"""
280
+
281
+ # Do we full-stops in generating documentations?
282
+
283
+ def __init__ (self ):
284
+ """_summary_: Initialise the class with the required attributes"""
285
+ self .take_inputs ()
286
+
287
+ def length (self ):
288
+ """_summary_: Convert length units"""
289
+ # It should have a meter to unit and unit to meter converter
290
+ # Othe lengths units it should also have.
291
+ # Like cm to pico meter and what not
292
+ pass
293
+
294
+ def area (self ):
295
+ # This will to have multiple shapes and polygons to it to improve it's area.
296
+ # This will to have multiple shapes and polygons to it to improve it's area.
297
+ # I will try to use the best of the formula to do it like the n number of polygons to be solved.
298
+
299
+ pass
300
+
301
+ def volume (self ):
302
+ # Different shapes and polygons to it to improve it's volume.
303
+ pass
304
+
305
+ def mass (self ):
306
+ pass
307
+
308
+ def time (self ):
309
+ pass
310
+
311
+ def speed (self ):
312
+ pass
313
+
314
+ def temperature (self ):
315
+ pass
316
+
317
+ def data (self ):
318
+ pass
319
+
320
+ def pressure (self ):
321
+ pass
322
+
323
+ def energy (self ):
324
+ pass
325
+
326
+ def power (self ):
327
+ pass
328
+
329
+ def angle (self ):
330
+ pass
331
+
332
+ def force (self ):
333
+ pass
334
+
335
+ def frequency (self ):
336
+ pass
337
+
338
+ def take_inputs (self ):
339
+ pass
340
+
341
+ class CurrencyConverter :
342
+ def __init__ (self ):
343
+ self .take_inputs ()
344
+
345
+ def take_inputs (self ):
346
+ pass
347
+
348
+ def convert (self ):
349
+ pass
350
+
351
+ class Commands :
352
+ def __init__ (self ):
353
+ self .take_inputs ()
354
+
355
+ def previous_number (self ):
356
+ pass
357
+
358
+ def previous_operation (self ):
359
+ pass
360
+
361
+ def previous_result (self ):
362
+ pass
363
+
364
+ def clear_screen (self ):
365
+ # Do I need a clear screen?
366
+ # os.system("cls" if os.name == "nt" else "clear")
367
+ # os.system("cls")
368
+ # os.system("clear")
369
+ pass
370
+
125
371
126
372
if __name__ == "__main__" :
127
373
operation_1 = Calculator (10 , 5 )
@@ -134,3 +380,12 @@ def user_name_art(self):
134
380
135
381
136
382
# Let's explore colorma
383
+ # Also user log ins, and it saves user data and preferences.
384
+ # A feature of the least priority right now.
385
+
386
+ # List of features priority should be planned.
387
+
388
+
389
+ # Documentations are good to read and understand.
390
+ # A one stop solution is to stop and read the document.
391
+ # It is much better and easier to understand.
0 commit comments