{"id":19862773,"url":"https://github.com/pyunits/pyunit-idcard","last_synced_at":"2025-05-02T04:30:52.567Z","repository":{"id":57458190,"uuid":"274015794","full_name":"pyunits/pyunit-idCard","owner":"pyunits","description":"身份证实体抽取，身份证补全，身份证检测等功能","archived":false,"fork":false,"pushed_at":"2020-06-23T06:07:12.000Z","size":562,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-27T01:46:34.670Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pyunits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-22T01:48:47.000Z","updated_at":"2025-04-08T01:16:27.000Z","dependencies_parsed_at":"2022-09-09T22:51:13.645Z","dependency_job_id":null,"html_url":"https://github.com/pyunits/pyunit-idCard","commit_stats":null,"previous_names":["pyunit/pyunit-idcard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyunits%2Fpyunit-idCard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyunits%2Fpyunit-idCard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyunits%2Fpyunit-idCard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pyunits%2Fpyunit-idCard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pyunits","download_url":"https://codeload.github.com/pyunits/pyunit-idCard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251986735,"owners_count":21675950,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T15:12:38.929Z","updated_at":"2025-05-02T04:30:51.491Z","avatar_url":"https://github.com/pyunits.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **PyUnit-IDCard** [![](https://gitee.com/tyoui/logo/raw/master/logo/photolog.png)][1]\n\n## 身份证实体抽取，身份证补全，身份证检测等功能。\n[![](https://img.shields.io/badge/Python-3.7-green.svg)](https://pypi.org/project/pyunit-address/)\n\n## 安装\n    pip install pyunit-idcard\n\n\n## 使用\n```python\nfrom pyunit_idcard import IdCard\n\ncard = IdCard()\n\n\ndef check_up():\n    \"\"\"检验身份证正确性\"\"\"\n    assert card.check_up('522121199505307051') is True\n\n\ndef find_card():\n    \"\"\"查询身份证信息测试\"\"\"\n    assert card.find_card('522121199505307051') == {'发证地': '贵州省遵义地区遵义县', '出生日期': '1995年05月30日', '性别': '男'}\n\n\ndef complete_information():\n    \"\"\"补全身份证测试\"\"\"\n    assert card.complete_information('522121*99505307051') == ['522121199505307051']\n\ndef match_card():\n    \"\"\"寻找身份证测试\"\"\"\n    assert card.match_card('我的身份证信息是5**121199505*07051你能猜出来吗') == [\n        {'发证地': '贵州省遵义地区遵义县', '出生日期': '1995年05月30日', '性别': '男', '身份证号码': '522121199505307051'},\n        {'发证地': '云南省昆明市呈贡县', '出生日期': '1995年05月30日', '性别': '男', '身份证号码': '530121199505307051'},\n        {'发证地': '西藏自治区拉萨市林周县', '出生日期': '1995年05月10日', '性别': '男', '身份证号码': '540121199505107051'}]\n\n\nif __name__ == '__main__':\n    check_up()\n    find_card()\n    match_card()\n    complete_information()\n```\n\n## Docker部署\n    docker pull jtyoui/pyunit-idcard\n    docker run -d -P jtyoui/pyunit-idcard\n\n### 车牌号规则提取\n|**参数名**|**类型**|**是否可以为空**|**说明**|\n|------|------|-------|--------|\n|data|string|YES|输入话带有身份证，未知数可以用*来替代|\n\n### 请求示例\n\u003e #### Python3 Requests测试\n```python\nimport requests\n\nurl = \"http://IP:端口/pyunit/idCard\"\ndata = {\n    'data': '我的身份证信息是5**121199505*07051你能猜出来吗',\n}\nheaders = {'Content-Type': \"application/x-www-form-urlencoded\"}\nresponse = requests.post(url, data=data, headers=headers).json()\nprint(response)\n``` \n\n\u003e #### 返回结果\n```json\n{\n    \"code\":200,\n    \"result\":[\n        {\n            \"出生日期\":\"1995年05月30日\",\n            \"发证地\":\"贵州省遵义地区遵义县\",\n            \"性别\":\"男\",\n            \"身份证号码\":\"522121199505307051\"\n        },\n        {\n            \"出生日期\":\"1995年05月30日\",\n            \"发证地\":\"云南省昆明市呈贡县\",\n            \"性别\":\"男\",\n            \"身份证号码\":\"530121199505307051\"\n        },\n        {\n            \"出生日期\":\"1995年05月10日\",\n            \"发证地\":\"西藏自治区拉萨市林周县\",\n            \"性别\":\"男\",\n            \"身份证号码\":\"540121199505107051\"\n        }\n    ]\n}\n```\n\n***\n[1]: https://blog.jtyoui.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyunits%2Fpyunit-idcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpyunits%2Fpyunit-idcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpyunits%2Fpyunit-idcard/lists"}