numclassify 0.3.0__tar.gz → 0.3.1__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.
- {numclassify-0.3.0 → numclassify-0.3.1}/CHANGELOG.md +29 -0
- numclassify-0.3.1/PKG-INFO +195 -0
- numclassify-0.3.1/README.md +167 -0
- numclassify-0.3.1/docs/playground.css +1001 -0
- numclassify-0.3.1/docs/playground.html +171 -0
- numclassify-0.3.1/docs/playground.js +672 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/pyproject.toml +1 -1
- numclassify-0.3.0/PKG-INFO +0 -262
- numclassify-0.3.0/README.md +0 -234
- numclassify-0.3.0/docs/playground.html +0 -995
- {numclassify-0.3.0 → numclassify-0.3.1}/.github/workflows/ci.yml +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/.github/workflows/docs.yml +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/.github/workflows/publish.yml +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/.gitignore +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/CONTRIBUTING.md +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/LICENSE +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/docs/api.md +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/docs/changelog.md +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/docs/cli.md +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/docs/index.md +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/examples/basic_usage.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/examples/custom_type.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/examples/find_perfect_numbers.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/examples/random_classify.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/examples/stream_large_range.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/mkdocs.yml +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/__init__.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/__main__.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/__init__.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/combinatorial.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/digital.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/divisors.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/figurate.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/number_theory.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/powers.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/primes.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/recreational.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_core/sequences.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/_registry.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/cli.py +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/numclassify/py.typed +0 -0
- {numclassify-0.3.0 → numclassify-0.3.1}/tests/test_registry.py +0 -0
|
@@ -6,6 +6,35 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [0.3.1] - 2026-06-12
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Version number displayed on playground page (fetched live from installed package)
|
|
13
|
+
- Category-colored tags on playground (distinct accent color per property category)
|
|
14
|
+
- Batch classify — enter comma/space-separated numbers for a mini-table of results
|
|
15
|
+
- Recent classification history panel (last 20 numbers, persisted in localStorage)
|
|
16
|
+
- Property tooltips on tag hover (shows category name)
|
|
17
|
+
- Fuzzy search suggestion ("Did you mean X?") on property misspellings
|
|
18
|
+
- Search pagination with "Load More" button (50 results per page)
|
|
19
|
+
- Number of the Day date picker — pick any past date for that day's number
|
|
20
|
+
- Scroll-to-top floating button (appears after 400px scroll)
|
|
21
|
+
- Light theme toggle (sun/moon button, saved to localStorage)
|
|
22
|
+
- Download classification results as JSON file
|
|
23
|
+
- Keyboard shortcut hints displayed on buttons
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Split playground.html into 3 files: HTML skeleton, CSS (~1000 lines), JS (~660 lines)
|
|
27
|
+
- Tab switching now has slide-in animation (translateX + opacity)
|
|
28
|
+
- Result panels slide up on reveal (translateY + opacity)
|
|
29
|
+
- Score counter animates from 0 to final count (cubic ease-out, 400ms)
|
|
30
|
+
- Number digits fade in sequentially (40ms stagger per digit)
|
|
31
|
+
- Score badge pulses green on update
|
|
32
|
+
- Tags enter with random rotation (-3° to +3°) per tag
|
|
33
|
+
- Search results stagger in with 25ms delay per item
|
|
34
|
+
- Buttons have click ripple effect (radial gradient at cursor position)
|
|
35
|
+
- Toast slides in from the right instead of appearing in place
|
|
36
|
+
- All backgrounds and text colors transition smoothly on theme switch
|
|
37
|
+
|
|
9
38
|
## [0.3.0] - 2026-06-12
|
|
10
39
|
|
|
11
40
|
### Added
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: numclassify
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: The most comprehensive Python library for number classification - 3000+ number types
|
|
5
|
+
Project-URL: Homepage, https://github.com/aratrikghosh2011-tech/numclassify
|
|
6
|
+
Project-URL: Repository, https://github.com/aratrikghosh2011-tech/numclassify
|
|
7
|
+
Project-URL: Documentation, https://aratrikghosh2011-tech.github.io/numclassify/
|
|
8
|
+
Project-URL: Issues, https://github.com/aratrikghosh2011-tech/numclassify/issues
|
|
9
|
+
Author-email: Aratrik Ghosh <aratrikghosh2011@gmail.com>
|
|
10
|
+
License: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: armstrong,classification,figurate,mathematics,number-theory,prime
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Education
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
26
|
+
Requires-Python: >=3.8
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# numclassify
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/numclassify/)
|
|
32
|
+
[](https://pypi.org/project/numclassify/)
|
|
33
|
+
[](https://pypi.org/project/numclassify/)
|
|
34
|
+
[](https://github.com/aratrikghosh2011-tech/numclassify/actions/workflows/ci.yml)
|
|
35
|
+
[](LICENSE)
|
|
36
|
+
|
|
37
|
+
**Given a number, what is it?**
|
|
38
|
+
|
|
39
|
+
Most number-theory libraries — `labmath`, `eulerlib`, `pyntlib` — compute things: factor integers, find GCDs, generate primes. `numclassify` solves a different problem. Hand it a number and it tells you every named mathematical type that number belongs to, across 3000+ categories, with zero external dependencies.
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
153 → Armstrong, Harshad, Triangular, Abundant, ...
|
|
43
|
+
1729 → Taxicab (Hardy-Ramanujan), Carmichael, Zeisel, ...
|
|
44
|
+
28 → Perfect, Triangular, Hexagonal, Semiprime, ...
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Try it in your browser: **[numclassify Playground](https://aratrikghosh2011-tech.github.io/numclassify/playground.html)**
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Installation
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install numclassify
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Python 3.8+ required. No external dependencies.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
```python
|
|
64
|
+
import numclassify as nc
|
|
65
|
+
|
|
66
|
+
# Boolean checks
|
|
67
|
+
nc.is_prime(17) # True
|
|
68
|
+
nc.is_perfect(28) # True
|
|
69
|
+
|
|
70
|
+
# Classify a single number — returns number, true properties, and a score
|
|
71
|
+
nc.classify(1729)
|
|
72
|
+
# {'number': 1729, 'true_properties': ['Taxicab', 'Carmichael', ...], 'score': 22}
|
|
73
|
+
|
|
74
|
+
# Batch classify
|
|
75
|
+
nc.classify_batch([6, 28, 496])
|
|
76
|
+
|
|
77
|
+
# Find numbers in a range with a given property
|
|
78
|
+
nc.find_by_property(start=1, end=1000, Perfect=True)
|
|
79
|
+
# [6, 28, 496]
|
|
80
|
+
|
|
81
|
+
# Stream over large ranges without loading everything into memory
|
|
82
|
+
for result in nc.stream(1, 1_000_000):
|
|
83
|
+
if result['score'] > 30:
|
|
84
|
+
print(result)
|
|
85
|
+
|
|
86
|
+
# All true properties of a number
|
|
87
|
+
nc.get_true_properties(1729)
|
|
88
|
+
|
|
89
|
+
# Pretty-print a formatted table
|
|
90
|
+
nc.print_properties(153)
|
|
91
|
+
# ┌─────────────────────────────────────────┐
|
|
92
|
+
# │ Properties of 153 │
|
|
93
|
+
# ├─────────────────────────────────────────┤
|
|
94
|
+
# │ armstrong ✓ │
|
|
95
|
+
# │ harshad ✓ │
|
|
96
|
+
# │ triangular ✓ │
|
|
97
|
+
# │ ... │
|
|
98
|
+
# └─────────────────────────────────────────┘
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## CLI
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# Classify a number
|
|
107
|
+
numclassify check 1729
|
|
108
|
+
|
|
109
|
+
# JSON output for piping
|
|
110
|
+
numclassify check 153 --json
|
|
111
|
+
|
|
112
|
+
# Find numbers of a type
|
|
113
|
+
numclassify find armstrong --limit 10
|
|
114
|
+
|
|
115
|
+
# Filter a range
|
|
116
|
+
numclassify range 1 20 --filter prime
|
|
117
|
+
|
|
118
|
+
# Compare two numbers
|
|
119
|
+
numclassify compare 6 28
|
|
120
|
+
|
|
121
|
+
# List all types in a category
|
|
122
|
+
numclassify list --category primes
|
|
123
|
+
|
|
124
|
+
# Get info and OEIS reference for a type
|
|
125
|
+
numclassify info armstrong
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## Number Categories
|
|
131
|
+
|
|
132
|
+
| Category | Count | Examples |
|
|
133
|
+
|---|---|---|
|
|
134
|
+
| Polygonal figurate | ~998 | Triangular, Square, Pentagonal, Chiliagonal |
|
|
135
|
+
| Centered polygonal | ~998 | Centered Triangular, Centered Hexagonal |
|
|
136
|
+
| Prime families | 41 | Twin, Mersenne, Sophie Germain, Wilson, Safe |
|
|
137
|
+
| Digital invariants | 10 | Armstrong, Spy, Harshad, Disarium, Happy, Neon |
|
|
138
|
+
| Divisor-based | 27 | Perfect, Abundant, Weird, Amicable, Practical |
|
|
139
|
+
| Sequences | 15 | Fibonacci, Lucas, Catalan, Bell, Padovan |
|
|
140
|
+
| Powers | 13 | Perfect Square, Taxicab, Sum of Two Squares |
|
|
141
|
+
| Number theory | 14 | Evil, Carmichael, Keith, Autobiographical |
|
|
142
|
+
| Combinatorial | 10 | Factorial, Primorial, Subfactorial |
|
|
143
|
+
| Recreational | 5 | Kaprekar, Automorphic, Palindrome |
|
|
144
|
+
| **Total** | **3000+** | |
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Custom Types
|
|
149
|
+
|
|
150
|
+
The `@register` decorator lets you add your own number types. Once registered, the type appears everywhere — `classify()`, `find_by_property()`, the CLI, all of it.
|
|
151
|
+
|
|
152
|
+
```python
|
|
153
|
+
from numclassify import register
|
|
154
|
+
|
|
155
|
+
@register(name="my_type", category="custom")
|
|
156
|
+
def is_my_type(n: int) -> bool:
|
|
157
|
+
return n > 0 and n % 7 == 0 and str(n)[0] == "4"
|
|
158
|
+
|
|
159
|
+
import numclassify as nc
|
|
160
|
+
nc.is_my_type(42) # True
|
|
161
|
+
nc.get_true_properties(42) # [..., 'my_type', ...]
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
See [`examples/`](examples/) for runnable scripts covering all major features.
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## API Reference
|
|
169
|
+
|
|
170
|
+
| Function | Description |
|
|
171
|
+
|---|---|
|
|
172
|
+
| `classify(n)` | Returns `{number, true_properties, score}` |
|
|
173
|
+
| `classify_batch(numbers)` | Classify a list; returns list of dicts |
|
|
174
|
+
| `random_number(max_n)` | Classify a randomly selected number |
|
|
175
|
+
| `find_by_property(start, end, **filters)` | Numbers in range matching property filters |
|
|
176
|
+
| `stream(start, end)` | Generator — memory-safe range classification |
|
|
177
|
+
| `get_all_properties(n)` | Dict of every type mapped to True/False |
|
|
178
|
+
| `get_true_properties(n)` | List of True property names only |
|
|
179
|
+
| `print_properties(n)` | Pretty-print property table to stdout |
|
|
180
|
+
| `count_properties(n)` | Count of True properties |
|
|
181
|
+
| `most_special_in_range(lo, hi)` | Number in range with the most True properties |
|
|
182
|
+
| `find_in_range(fn, lo, hi)` | Numbers where `fn` returns True |
|
|
183
|
+
| `find_all_in_range(lo, hi)` | Dict mapping each number to its true properties |
|
|
184
|
+
| `register` | Decorator to add custom number types |
|
|
185
|
+
| `is_prime(n)` | Convenience boolean |
|
|
186
|
+
| `is_armstrong(n)` | Convenience boolean |
|
|
187
|
+
| `is_perfect(n)` | Convenience boolean |
|
|
188
|
+
|
|
189
|
+
Full docs: [aratrikghosh2011-tech.github.io/numclassify](https://aratrikghosh2011-tech.github.io/numclassify/)
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
MIT © 2026 Aratrik Ghosh
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# numclassify
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/numclassify/)
|
|
4
|
+
[](https://pypi.org/project/numclassify/)
|
|
5
|
+
[](https://pypi.org/project/numclassify/)
|
|
6
|
+
[](https://github.com/aratrikghosh2011-tech/numclassify/actions/workflows/ci.yml)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
|
|
9
|
+
**Given a number, what is it?**
|
|
10
|
+
|
|
11
|
+
Most number-theory libraries — `labmath`, `eulerlib`, `pyntlib` — compute things: factor integers, find GCDs, generate primes. `numclassify` solves a different problem. Hand it a number and it tells you every named mathematical type that number belongs to, across 3000+ categories, with zero external dependencies.
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
153 → Armstrong, Harshad, Triangular, Abundant, ...
|
|
15
|
+
1729 → Taxicab (Hardy-Ramanujan), Carmichael, Zeisel, ...
|
|
16
|
+
28 → Perfect, Triangular, Hexagonal, Semiprime, ...
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Try it in your browser: **[numclassify Playground](https://aratrikghosh2011-tech.github.io/numclassify/playground.html)**
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install numclassify
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Python 3.8+ required. No external dependencies.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import numclassify as nc
|
|
37
|
+
|
|
38
|
+
# Boolean checks
|
|
39
|
+
nc.is_prime(17) # True
|
|
40
|
+
nc.is_perfect(28) # True
|
|
41
|
+
|
|
42
|
+
# Classify a single number — returns number, true properties, and a score
|
|
43
|
+
nc.classify(1729)
|
|
44
|
+
# {'number': 1729, 'true_properties': ['Taxicab', 'Carmichael', ...], 'score': 22}
|
|
45
|
+
|
|
46
|
+
# Batch classify
|
|
47
|
+
nc.classify_batch([6, 28, 496])
|
|
48
|
+
|
|
49
|
+
# Find numbers in a range with a given property
|
|
50
|
+
nc.find_by_property(start=1, end=1000, Perfect=True)
|
|
51
|
+
# [6, 28, 496]
|
|
52
|
+
|
|
53
|
+
# Stream over large ranges without loading everything into memory
|
|
54
|
+
for result in nc.stream(1, 1_000_000):
|
|
55
|
+
if result['score'] > 30:
|
|
56
|
+
print(result)
|
|
57
|
+
|
|
58
|
+
# All true properties of a number
|
|
59
|
+
nc.get_true_properties(1729)
|
|
60
|
+
|
|
61
|
+
# Pretty-print a formatted table
|
|
62
|
+
nc.print_properties(153)
|
|
63
|
+
# ┌─────────────────────────────────────────┐
|
|
64
|
+
# │ Properties of 153 │
|
|
65
|
+
# ├─────────────────────────────────────────┤
|
|
66
|
+
# │ armstrong ✓ │
|
|
67
|
+
# │ harshad ✓ │
|
|
68
|
+
# │ triangular ✓ │
|
|
69
|
+
# │ ... │
|
|
70
|
+
# └─────────────────────────────────────────┘
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## CLI
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Classify a number
|
|
79
|
+
numclassify check 1729
|
|
80
|
+
|
|
81
|
+
# JSON output for piping
|
|
82
|
+
numclassify check 153 --json
|
|
83
|
+
|
|
84
|
+
# Find numbers of a type
|
|
85
|
+
numclassify find armstrong --limit 10
|
|
86
|
+
|
|
87
|
+
# Filter a range
|
|
88
|
+
numclassify range 1 20 --filter prime
|
|
89
|
+
|
|
90
|
+
# Compare two numbers
|
|
91
|
+
numclassify compare 6 28
|
|
92
|
+
|
|
93
|
+
# List all types in a category
|
|
94
|
+
numclassify list --category primes
|
|
95
|
+
|
|
96
|
+
# Get info and OEIS reference for a type
|
|
97
|
+
numclassify info armstrong
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Number Categories
|
|
103
|
+
|
|
104
|
+
| Category | Count | Examples |
|
|
105
|
+
|---|---|---|
|
|
106
|
+
| Polygonal figurate | ~998 | Triangular, Square, Pentagonal, Chiliagonal |
|
|
107
|
+
| Centered polygonal | ~998 | Centered Triangular, Centered Hexagonal |
|
|
108
|
+
| Prime families | 41 | Twin, Mersenne, Sophie Germain, Wilson, Safe |
|
|
109
|
+
| Digital invariants | 10 | Armstrong, Spy, Harshad, Disarium, Happy, Neon |
|
|
110
|
+
| Divisor-based | 27 | Perfect, Abundant, Weird, Amicable, Practical |
|
|
111
|
+
| Sequences | 15 | Fibonacci, Lucas, Catalan, Bell, Padovan |
|
|
112
|
+
| Powers | 13 | Perfect Square, Taxicab, Sum of Two Squares |
|
|
113
|
+
| Number theory | 14 | Evil, Carmichael, Keith, Autobiographical |
|
|
114
|
+
| Combinatorial | 10 | Factorial, Primorial, Subfactorial |
|
|
115
|
+
| Recreational | 5 | Kaprekar, Automorphic, Palindrome |
|
|
116
|
+
| **Total** | **3000+** | |
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Custom Types
|
|
121
|
+
|
|
122
|
+
The `@register` decorator lets you add your own number types. Once registered, the type appears everywhere — `classify()`, `find_by_property()`, the CLI, all of it.
|
|
123
|
+
|
|
124
|
+
```python
|
|
125
|
+
from numclassify import register
|
|
126
|
+
|
|
127
|
+
@register(name="my_type", category="custom")
|
|
128
|
+
def is_my_type(n: int) -> bool:
|
|
129
|
+
return n > 0 and n % 7 == 0 and str(n)[0] == "4"
|
|
130
|
+
|
|
131
|
+
import numclassify as nc
|
|
132
|
+
nc.is_my_type(42) # True
|
|
133
|
+
nc.get_true_properties(42) # [..., 'my_type', ...]
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
See [`examples/`](examples/) for runnable scripts covering all major features.
|
|
137
|
+
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## API Reference
|
|
141
|
+
|
|
142
|
+
| Function | Description |
|
|
143
|
+
|---|---|
|
|
144
|
+
| `classify(n)` | Returns `{number, true_properties, score}` |
|
|
145
|
+
| `classify_batch(numbers)` | Classify a list; returns list of dicts |
|
|
146
|
+
| `random_number(max_n)` | Classify a randomly selected number |
|
|
147
|
+
| `find_by_property(start, end, **filters)` | Numbers in range matching property filters |
|
|
148
|
+
| `stream(start, end)` | Generator — memory-safe range classification |
|
|
149
|
+
| `get_all_properties(n)` | Dict of every type mapped to True/False |
|
|
150
|
+
| `get_true_properties(n)` | List of True property names only |
|
|
151
|
+
| `print_properties(n)` | Pretty-print property table to stdout |
|
|
152
|
+
| `count_properties(n)` | Count of True properties |
|
|
153
|
+
| `most_special_in_range(lo, hi)` | Number in range with the most True properties |
|
|
154
|
+
| `find_in_range(fn, lo, hi)` | Numbers where `fn` returns True |
|
|
155
|
+
| `find_all_in_range(lo, hi)` | Dict mapping each number to its true properties |
|
|
156
|
+
| `register` | Decorator to add custom number types |
|
|
157
|
+
| `is_prime(n)` | Convenience boolean |
|
|
158
|
+
| `is_armstrong(n)` | Convenience boolean |
|
|
159
|
+
| `is_perfect(n)` | Convenience boolean |
|
|
160
|
+
|
|
161
|
+
Full docs: [aratrikghosh2011-tech.github.io/numclassify](https://aratrikghosh2011-tech.github.io/numclassify/)
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
MIT © 2026 Aratrik Ghosh
|