ssonal-pyutils 0.1.0__py3-none-any.whl
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.
- ssonal_pyutils-0.1.0.dist-info/METADATA +100 -0
- ssonal_pyutils-0.1.0.dist-info/RECORD +8 -0
- ssonal_pyutils-0.1.0.dist-info/WHEEL +5 -0
- ssonal_pyutils-0.1.0.dist-info/licenses/LICENSE +22 -0
- ssonal_pyutils-0.1.0.dist-info/top_level.txt +1 -0
- usser_pkg/armstrong.py +12 -0
- usser_pkg/init.py +10 -0
- usser_pkg/palindrome.py +5 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ssonal-pyutils
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python utilities for palindrome and Armstrong number checking
|
|
5
|
+
Author: Sonal Gupta
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Keywords: python,palindrome,armstrong,utilities
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# ssonal-pkg1
|
|
19
|
+
|
|
20
|
+
A lightweight Python package that provides simple utility functions to check whether a number or string is a palindrome and whether a number is an Armstrong number.
|
|
21
|
+
|
|
22
|
+
## Features
|
|
23
|
+
|
|
24
|
+
- Check palindrome numbers.
|
|
25
|
+
- Check palindrome strings.
|
|
26
|
+
- Check Armstrong numbers.
|
|
27
|
+
- Lightweight and easy to use.
|
|
28
|
+
- No external dependencies.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pip install ssonal-pkg1
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
### 1. Check Palindrome
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from ssonal_pkg1 import is_palindrome
|
|
42
|
+
|
|
43
|
+
print(is_palindrome(121))
|
|
44
|
+
# Output: True
|
|
45
|
+
|
|
46
|
+
print(is_palindrome("madam"))
|
|
47
|
+
# Output: True
|
|
48
|
+
|
|
49
|
+
print(is_palindrome(123))
|
|
50
|
+
# Output: False
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 2. Check Armstrong Number
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from ssonal_pkg1 import is_armstrong
|
|
57
|
+
|
|
58
|
+
print(is_armstrong(153))
|
|
59
|
+
# Output: True
|
|
60
|
+
|
|
61
|
+
print(is_armstrong(370))
|
|
62
|
+
# Output: True
|
|
63
|
+
|
|
64
|
+
print(is_armstrong(123))
|
|
65
|
+
# Output: False
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Available Functions
|
|
69
|
+
|
|
70
|
+
| Function | Description |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `is_palindrome(value)` | Checks whether a string or number is a palindrome. |
|
|
73
|
+
| `is_armstrong(number)` | Checks whether a number is an Armstrong number. |
|
|
74
|
+
|
|
75
|
+
## Project Structure
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
ssonal_pkg1/
|
|
79
|
+
│
|
|
80
|
+
├── ssonal_pkg1/
|
|
81
|
+
│ ├── __init__.py
|
|
82
|
+
│ ├── palindrome.py
|
|
83
|
+
│ └── armstrong.py
|
|
84
|
+
│
|
|
85
|
+
├── README.md
|
|
86
|
+
├── LICENSE
|
|
87
|
+
└── pyproject.toml
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Requirements
|
|
91
|
+
|
|
92
|
+
- Python 3.8 or above
|
|
93
|
+
|
|
94
|
+
## Author
|
|
95
|
+
|
|
96
|
+
Sonal Gupta
|
|
97
|
+
|
|
98
|
+
## License
|
|
99
|
+
|
|
100
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
ssonal_pyutils-0.1.0.dist-info/licenses/LICENSE,sha256=A0cz3xD9cfEfpsQCEvOoEdkUKJygIjAeVyxv3-Lha-4,1091
|
|
2
|
+
usser_pkg/armstrong.py,sha256=_XhWduWut_H0R02XDp_0Jk2jE3iObK69-Ed4XBMofSs,303
|
|
3
|
+
usser_pkg/init.py,sha256=MygSChzmP_0Cm0zw5Ft0BRVeIwL2PSJ5iLOFLm3XLf8,163
|
|
4
|
+
usser_pkg/palindrome.py,sha256=zfU33qclnQEaFX-pK_ad6p4eSkBmygkTFhjHvouHBU8,172
|
|
5
|
+
ssonal_pyutils-0.1.0.dist-info/METADATA,sha256=tXi10B02pb3ExfAVfZVtJpSToUomDkeOmn35WeYj03Y,2002
|
|
6
|
+
ssonal_pyutils-0.1.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
7
|
+
ssonal_pyutils-0.1.0.dist-info/top_level.txt,sha256=YgDceU0yR8HZ16MDkDBwUOac_is8leFaEDtIgR4IAQs,10
|
|
8
|
+
ssonal_pyutils-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 Sonal Gupta
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
usser_pkg
|
usser_pkg/armstrong.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
def is_armstrong(number):
|
|
3
|
+
"""Check whether a number is an Armstrong number."""
|
|
4
|
+
if not isinstance(number, int) or number < 0:
|
|
5
|
+
return False
|
|
6
|
+
|
|
7
|
+
digits = str(number)
|
|
8
|
+
power = len(digits)
|
|
9
|
+
|
|
10
|
+
total = sum(int(digit) ** power for digit in digits)
|
|
11
|
+
|
|
12
|
+
return total == number
|
usser_pkg/init.py
ADDED