numclassify 0.2.0__tar.gz → 0.3.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.
- numclassify-0.3.0/.github/workflows/docs.yml +30 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/.gitignore +1 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/CHANGELOG.md +11 -0
- numclassify-0.3.0/CONTRIBUTING.md +71 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/PKG-INFO +19 -3
- {numclassify-0.2.0 → numclassify-0.3.0}/README.md +14 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/docs/api.md +3 -0
- numclassify-0.3.0/docs/playground.html +995 -0
- numclassify-0.3.0/examples/basic_usage.py +6 -0
- numclassify-0.3.0/examples/custom_type.py +12 -0
- numclassify-0.3.0/examples/find_perfect_numbers.py +9 -0
- numclassify-0.3.0/examples/random_classify.py +6 -0
- numclassify-0.3.0/examples/stream_large_range.py +7 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/mkdocs.yml +1 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/__init__.py +46 -33
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_registry.py +3 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/pyproject.toml +6 -6
- numclassify-0.2.0/site/404.html +0 -490
- numclassify-0.2.0/site/api/index.html +0 -731
- numclassify-0.2.0/site/assets/images/favicon.png +0 -0
- numclassify-0.2.0/site/assets/javascripts/bundle.79ae519e.min.js +0 -16
- numclassify-0.2.0/site/assets/javascripts/bundle.79ae519e.min.js.map +0 -7
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.ar.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.da.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.de.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.du.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.el.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.es.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.fi.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.fr.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.he.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.hi.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.hu.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.hy.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.it.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.ja.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.jp.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.kn.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.ko.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.multi.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.nl.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.no.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.pt.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.ro.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.ru.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.sa.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.sv.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.ta.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.te.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.th.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.tr.min.js +0 -18
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.vi.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/min/lunr.zh.min.js +0 -1
- numclassify-0.2.0/site/assets/javascripts/lunr/tinyseg.js +0 -206
- numclassify-0.2.0/site/assets/javascripts/lunr/wordcut.js +0 -6708
- numclassify-0.2.0/site/assets/javascripts/workers/search.2c215733.min.js +0 -42
- numclassify-0.2.0/site/assets/javascripts/workers/search.2c215733.min.js.map +0 -7
- numclassify-0.2.0/site/assets/stylesheets/main.484c7ddc.min.css +0 -1
- numclassify-0.2.0/site/assets/stylesheets/main.484c7ddc.min.css.map +0 -1
- numclassify-0.2.0/site/assets/stylesheets/palette.ab4e12ef.min.css +0 -1
- numclassify-0.2.0/site/assets/stylesheets/palette.ab4e12ef.min.css.map +0 -1
- numclassify-0.2.0/site/changelog/index.html +0 -533
- numclassify-0.2.0/site/cli/index.html +0 -732
- numclassify-0.2.0/site/index.html +0 -661
- numclassify-0.2.0/site/search/search_index.json +0 -1
- numclassify-0.2.0/site/sitemap.xml +0 -19
- numclassify-0.2.0/site/sitemap.xml.gz +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/.github/workflows/ci.yml +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/.github/workflows/publish.yml +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/LICENSE +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/docs/changelog.md +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/docs/cli.md +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/docs/index.md +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/__main__.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/__init__.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/combinatorial.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/digital.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/divisors.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/figurate.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/number_theory.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/powers.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/primes.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/recreational.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/_core/sequences.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/cli.py +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/numclassify/py.typed +0 -0
- {numclassify-0.2.0 → numclassify-0.3.0}/tests/test_registry.py +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: Deploy Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
release:
|
|
7
|
+
types: [published]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
deploy:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.12"
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: |
|
|
27
|
+
pip install mkdocs-material
|
|
28
|
+
|
|
29
|
+
- name: Deploy to GitHub Pages
|
|
30
|
+
run: mkdocs gh-deploy --force
|
|
@@ -6,6 +6,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
+
## [0.3.0] - 2026-06-12
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- Interactive Playground page (docs/playground.html) powered by Pyodide
|
|
13
|
+
- Classifier, property search, number comparison, random number, and Number of the Day features
|
|
14
|
+
- Shareable URLs via ?n=<number> query parameter
|
|
15
|
+
- Copy results to clipboard button
|
|
16
|
+
- Auto-deploy GitHub Pages workflow on every push to main and on version tags
|
|
17
|
+
- Version number now dynamically read from package metadata (single source of truth)
|
|
18
|
+
- PyPI version and downloads badges in README
|
|
19
|
+
|
|
9
20
|
## [0.2.0] - 2026-05-11
|
|
10
21
|
|
|
11
22
|
### Added
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Contributing to numclassify
|
|
2
|
+
|
|
3
|
+
## Adding a New Number Type
|
|
4
|
+
|
|
5
|
+
The fastest way to contribute is adding a new number type using the `@register` decorator.
|
|
6
|
+
|
|
7
|
+
### Step 1 \u2014 Write your function
|
|
8
|
+
|
|
9
|
+
```python
|
|
10
|
+
from numclassify import register
|
|
11
|
+
|
|
12
|
+
@register(name="My Type", category="recreational")
|
|
13
|
+
def is_my_type(n: int) -> bool:
|
|
14
|
+
return n > 0 and n % 7 == 0
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
That's it. Your type is now available via:
|
|
18
|
+
- `nc.get_all_properties(n)`
|
|
19
|
+
- `nc.get_true_properties(n)`
|
|
20
|
+
- `nc.find_in_range(nc.is_my_type, 1, 1000)`
|
|
21
|
+
- `numclassify find my_type` in the CLI
|
|
22
|
+
|
|
23
|
+
### Step 2 \u2014 Add it to the right module
|
|
24
|
+
|
|
25
|
+
Place your function in the appropriate file under `numclassify/_core/`:
|
|
26
|
+
|
|
27
|
+
| Module | Types |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `primes.py` | Prime families |
|
|
30
|
+
| `figurate.py` | Polygonal/figurate numbers |
|
|
31
|
+
| `divisors.py` | Divisor-based (perfect, abundant...) |
|
|
32
|
+
| `digital.py` | Digit-based (Armstrong, Harshad...) |
|
|
33
|
+
| `sequences.py` | Number sequences (Fibonacci, Lucas...) |
|
|
34
|
+
| `powers.py` | Powers and sums |
|
|
35
|
+
| `number_theory.py` | Number theory properties |
|
|
36
|
+
| `combinatorial.py` | Combinatorial numbers |
|
|
37
|
+
| `recreational.py` | Recreational/fun types |
|
|
38
|
+
|
|
39
|
+
### Step 3 \u2014 Add a test
|
|
40
|
+
|
|
41
|
+
Add a test in `tests/` following the existing pattern:
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
def test_is_my_type():
|
|
45
|
+
assert nc.is_my_type(7) == True
|
|
46
|
+
assert nc.is_my_type(1) == False
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Step 4 \u2014 Submit a PR
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
git checkout -b add-my-type
|
|
53
|
+
git add .
|
|
54
|
+
git commit -m "Add My Type number classification"
|
|
55
|
+
git push origin add-my-type
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Then open a pull request on GitHub.
|
|
59
|
+
|
|
60
|
+
## Running Tests
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
cd numclassify
|
|
64
|
+
python -m pytest tests/ -v
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Code Style
|
|
68
|
+
|
|
69
|
+
- Pure Python, no external dependencies
|
|
70
|
+
- Type hints required on all functions
|
|
71
|
+
- Function name must start with `is_` for boolean classifiers
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: numclassify
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: The most comprehensive Python library for number classification
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: The most comprehensive Python library for number classification - 3000+ number types
|
|
5
5
|
Project-URL: Homepage, https://github.com/aratrikghosh2011-tech/numclassify
|
|
6
6
|
Project-URL: Repository, https://github.com/aratrikghosh2011-tech/numclassify
|
|
7
|
+
Project-URL: Documentation, https://aratrikghosh2011-tech.github.io/numclassify/
|
|
7
8
|
Project-URL: Issues, https://github.com/aratrikghosh2011-tech/numclassify/issues
|
|
8
9
|
Author-email: Aratrik Ghosh <aratrikghosh2011@gmail.com>
|
|
9
10
|
License: MIT
|
|
10
11
|
License-File: LICENSE
|
|
11
12
|
Keywords: armstrong,classification,figurate,mathematics,number-theory,prime
|
|
12
|
-
Classifier: Development Status ::
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
14
|
Classifier: Intended Audience :: Education
|
|
14
15
|
Classifier: Intended Audience :: Science/Research
|
|
15
16
|
Classifier: License :: OSI Approved :: MIT License
|
|
@@ -20,12 +21,16 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
25
|
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
24
26
|
Requires-Python: >=3.8
|
|
25
27
|
Description-Content-Type: text/markdown
|
|
26
28
|
|
|
27
29
|
# numclassify
|
|
28
30
|
|
|
31
|
+
[](https://pypi.org/project/numclassify/)
|
|
32
|
+
[](https://pypi.org/project/numclassify/)
|
|
33
|
+
|
|
29
34
|
The most comprehensive Python library for number classification — 3000+ number types, zero dependencies.
|
|
30
35
|
|
|
31
36
|
[](https://pypi.org/project/numclassify/)
|
|
@@ -33,6 +38,9 @@ The most comprehensive Python library for number classification — 3000+ number
|
|
|
33
38
|
[](https://pypi.org/project/numclassify/)
|
|
34
39
|
[](https://github.com/aratrikghosh2011-tech/numclassify/blob/main/LICENSE)
|
|
35
40
|
[](https://github.com/aratrikghosh2011-tech/numclassify/actions/workflows/ci.yml)
|
|
41
|
+
[](https://pypi.org/project/numclassify/)
|
|
42
|
+
|
|
43
|
+
> **Latest version: 0.2.1** — See [CHANGELOG](CHANGELOG.md) for what's new.
|
|
36
44
|
|
|
37
45
|
---
|
|
38
46
|
|
|
@@ -210,12 +218,20 @@ nc.is_my_type(42) # True
|
|
|
210
218
|
nc.get_true_properties(42) # [..., 'my_type', ...]
|
|
211
219
|
```
|
|
212
220
|
|
|
221
|
+
See the [`examples/`](examples/) folder for runnable scripts demonstrating all major features:
|
|
222
|
+
- [`basic_usage.py`](examples/basic_usage.py) — classify, batch, streaming
|
|
223
|
+
- [`custom_type.py`](examples/custom_type.py) — registering custom types
|
|
224
|
+
- [`find_perfect_numbers.py`](examples/find_perfect_numbers.py) — property-based search
|
|
225
|
+
- [`stream_large_range.py`](examples/stream_large_range.py) — memory-safe range streaming
|
|
226
|
+
- [`random_classify.py`](examples/random_classify.py) — random number classification
|
|
227
|
+
|
|
213
228
|
---
|
|
214
229
|
|
|
215
230
|
## API Reference
|
|
216
231
|
|
|
217
232
|
| Function | Description |
|
|
218
233
|
|---|---|
|
|
234
|
+
| `register(name, category, ...)` | Decorator to add custom number types to the full API |
|
|
219
235
|
| `classify(n)` | Returns a dict with the number, its true properties, and a score |
|
|
220
236
|
| `classify_batch(numbers)` | Classify a list of numbers; returns a list of dicts |
|
|
221
237
|
| `random_number(max_n)` | Classify a randomly selected number up to `max_n` |
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# numclassify
|
|
2
2
|
|
|
3
|
+
[](https://pypi.org/project/numclassify/)
|
|
4
|
+
[](https://pypi.org/project/numclassify/)
|
|
5
|
+
|
|
3
6
|
The most comprehensive Python library for number classification — 3000+ number types, zero dependencies.
|
|
4
7
|
|
|
5
8
|
[](https://pypi.org/project/numclassify/)
|
|
@@ -7,6 +10,9 @@ The most comprehensive Python library for number classification — 3000+ number
|
|
|
7
10
|
[](https://pypi.org/project/numclassify/)
|
|
8
11
|
[](https://github.com/aratrikghosh2011-tech/numclassify/blob/main/LICENSE)
|
|
9
12
|
[](https://github.com/aratrikghosh2011-tech/numclassify/actions/workflows/ci.yml)
|
|
13
|
+
[](https://pypi.org/project/numclassify/)
|
|
14
|
+
|
|
15
|
+
> **Latest version: 0.2.1** — See [CHANGELOG](CHANGELOG.md) for what's new.
|
|
10
16
|
|
|
11
17
|
---
|
|
12
18
|
|
|
@@ -184,12 +190,20 @@ nc.is_my_type(42) # True
|
|
|
184
190
|
nc.get_true_properties(42) # [..., 'my_type', ...]
|
|
185
191
|
```
|
|
186
192
|
|
|
193
|
+
See the [`examples/`](examples/) folder for runnable scripts demonstrating all major features:
|
|
194
|
+
- [`basic_usage.py`](examples/basic_usage.py) — classify, batch, streaming
|
|
195
|
+
- [`custom_type.py`](examples/custom_type.py) — registering custom types
|
|
196
|
+
- [`find_perfect_numbers.py`](examples/find_perfect_numbers.py) — property-based search
|
|
197
|
+
- [`stream_large_range.py`](examples/stream_large_range.py) — memory-safe range streaming
|
|
198
|
+
- [`random_classify.py`](examples/random_classify.py) — random number classification
|
|
199
|
+
|
|
187
200
|
---
|
|
188
201
|
|
|
189
202
|
## API Reference
|
|
190
203
|
|
|
191
204
|
| Function | Description |
|
|
192
205
|
|---|---|
|
|
206
|
+
| `register(name, category, ...)` | Decorator to add custom number types to the full API |
|
|
193
207
|
| `classify(n)` | Returns a dict with the number, its true properties, and a score |
|
|
194
208
|
| `classify_batch(numbers)` | Classify a list of numbers; returns a list of dicts |
|
|
195
209
|
| `random_number(max_n)` | Classify a randomly selected number up to `max_n` |
|
|
@@ -15,6 +15,9 @@ Find numbers matching property filters.
|
|
|
15
15
|
## stream(start, end)
|
|
16
16
|
Memory-safe generator over large ranges.
|
|
17
17
|
|
|
18
|
+
## register(name, category, ...)
|
|
19
|
+
Decorator to register custom number types. See [examples/custom_type.py](https://github.com/aratrikghosh2011-tech/numclassify/blob/main/examples/custom_type.py).
|
|
20
|
+
|
|
18
21
|
## Utilities
|
|
19
22
|
- get_all_properties(n)
|
|
20
23
|
- get_true_properties(n)
|