int-checker 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: int-checker
3
+ Version: 0.1.0
4
+ Summary: Adds functions to check if variables are integers and turns them into such.
5
+ Author-email: Battleboy96 <tggblake.2012@gmail.com>
6
+ Requires-Python: >=3.6
7
+ Description-Content-Type: text/markdown
8
+
9
+ # Integer Checker
10
+
11
+ A lightweight Python module that handles converting compatable data types into integers.
12
+
13
+ Disclamer: Right now there is only the ability to use this when taking and converting user input. I will try to add more features later. This has only been tested in basic examples, please report any bugs so I can try to fix them.
14
+
15
+ ## Features
16
+
17
+ * **Safe Integer Checking:** Easily verify and force user inputs to be valid integers without crashing your program.
18
+ * **Default Error Message:** Has a default error message of "Please input a number!" This can be changed by adding a string as the second argument.
19
+
20
+ ## Installation
21
+
22
+ Just use pip as you normally would!
23
+
24
+ ```bash
25
+ pip3 install int-checker
26
+ ```
27
+ ## Usage Example
28
+
29
+ ```python
30
+ import int_checker
31
+
32
+ var1 = int_checker.conv_input("Give number: ", "This is a different error message")
33
+
34
+ print(2 + var1)
35
+ ```
36
+
37
+ ## Syntax
38
+
39
+ The way you need to structure the code is quite simple. Using up to two arguments, you can define both the input request and error message, as shown before.
@@ -0,0 +1,31 @@
1
+ # Integer Checker
2
+
3
+ A lightweight Python module that handles converting compatable data types into integers.
4
+
5
+ Disclamer: Right now there is only the ability to use this when taking and converting user input. I will try to add more features later. This has only been tested in basic examples, please report any bugs so I can try to fix them.
6
+
7
+ ## Features
8
+
9
+ * **Safe Integer Checking:** Easily verify and force user inputs to be valid integers without crashing your program.
10
+ * **Default Error Message:** Has a default error message of "Please input a number!" This can be changed by adding a string as the second argument.
11
+
12
+ ## Installation
13
+
14
+ Just use pip as you normally would!
15
+
16
+ ```bash
17
+ pip3 install int-checker
18
+ ```
19
+ ## Usage Example
20
+
21
+ ```python
22
+ import int_checker
23
+
24
+ var1 = int_checker.conv_input("Give number: ", "This is a different error message")
25
+
26
+ print(2 + var1)
27
+ ```
28
+
29
+ ## Syntax
30
+
31
+ The way you need to structure the code is quite simple. Using up to two arguments, you can define both the input request and error message, as shown before.
@@ -0,0 +1,7 @@
1
+ def conv_input(prompt, error_message="Please input a number!"):
2
+ while True:
3
+ try:
4
+ variable = input(prompt)
5
+ return int(variable)
6
+ except ValueError:
7
+ print(error_message)
@@ -0,0 +1,11 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "int-checker"
7
+ version = "0.1.0"
8
+ description = "Adds functions to check if variables are integers and turns them into such."
9
+ readme = "README.md"
10
+ authors = [{ name = "Battleboy96", email = "tggblake.2012@gmail.com" }]
11
+ requires-python = ">=3.6"