Skip to main content

一个可以离线检验公民身份号码是否合法的程序

Project description

pymod112

一个基于Python开发的公民身份号码检验与地区代码查找程序

安装 Installation

PyPi 使用pip安装

pip install pymod112

使用 Usage

身份证号码校验

import pymod112

pymod112.mod112('11010519491231002X', details=True)
'''返回值为(dict)
{'id': '11010519491231002X', 
 'province': ['11', '北京市'], 
 'city': ['01', ''], 
 'county': ['05', '朝阳区'], 
 'birth_date': ['1949', '12', '31'], 
 'gender': 0, 
 'result': True, 
 'problem': '000'}
'''

查询地区代码对应的地区名

import pymod112

pymod112.code_to_location(['51', '01', '06'])
'''返回值为(list)
['四川省', '成都市', '金牛区']
'''

返回全部错误代码及其对应内容

import pymod112

pymod112.code_to_error
'''dict
{'000':'不存在问题',
'001':'<未定义>',
'002':'<未定义>',
'003':'<未定义>',
'004':'参数id长度错误',
'005':'参数id内容包含非法字符',
'006':'参数id不合法',
'007':'参数id中包含不存在的地区',
'008':'参数id中包含不存在的时间'
}
'''

许可证 License

BSD 3-Clause License

更新日志 Changelog

0.1.1

  • 加入参数类型检查
  • 优化错误代码(停用001 002 003)
  • 删除函数problem()

0.1.0(2023-6-24)

  • 这是第一个正式发行版

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymod112-0.1.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

pymod112-0.1.1-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file pymod112-0.1.1.tar.gz.

File metadata

  • Download URL: pymod112-0.1.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for pymod112-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2af6ef7b0da0737c4b9b7bac86f3205234cf8691c6aec88028e727fcb5394775
MD5 749d910eb26826198973b54a8573ff47
BLAKE2b-256 52429238661ee63123633ce5033f28836d9c56aeaf0249f46671c2218d313fdb

See more details on using hashes here.

File details

Details for the file pymod112-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pymod112-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for pymod112-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db7d7384889e15bcff8694281f86cc05552e364855d107fc3e639eef1412df8c
MD5 7986b0cf9922955f16142085aa1a2921
BLAKE2b-256 5472595f54f76e39293c41551a4cc80d5b8f96cfdbe3e5cf3ba2cb114401157c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page