Metadata-Version: 2.4
Name: idog
Version: 0.1.3
Summary: Check whether the ID card is legal.
Project-URL: Homepage, https://github.com/mmdjiji/idog
Project-URL: Repository, https://github.com/mmdjiji/idog
Project-URL: Issues, https://github.com/mmdjiji/idog/issues
Author-email: JiJi <i@mmdjiji.com>
License-Expression: GPL-3.0
License-File: LICENSE
Keywords: cli,idcard,validator
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# 🐶 idog

Check whether the ID card is legal.

## 📦 Install

Before installing, please ensure that you have installed Python (>=3.8) and its matching version of pip, and then enter the following command at the command prompt:
```bash
pip install idog
```
Or use uv to run directly without installing:
```bash
uvx idog
```
Note: If you use this method, subsequent usage will require adding uvx before the command. You can also set an alias for easier use:
```bash
alias idog='uvx idog'
```

## 🔐 Usage
```sh
idog <idcard>
```
* Use `-` if a digit is unknown;
* Use `o` if a digit is known to be odd (e.g. male on the gender digit);
* Use `e` if a digit is known to be even (e.g. female on the gender digit);

For example:
```sh
idog 11010519491231002X
```

## 🐍 Python API
You can also use idog as a library:
```python
import idog

idog.eval("11010519491231002X")   # ['11010519491231002X']  (legal → 1 element)
idog.eval("11010519491231000X")   # []                      (illegal → empty)
idog.eval("1101051949123100eX")   # ['11010519491231002X']  (e/o/- expand to all matches)
idog.eval("11010519491231--2X")   # ['11010519491231002X', '11010519491231192X', '11010519491231272X', '11010519491231352X', '11010519491231432X', '11010519491231512X', '11010519491231782X', '11010519491231862X', '11010519491231942X']
```
`eval(s)` always returns a list of legal 18-character IDs.

## License
[GPL-3.0](LICENSE)
