Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
.. image:: https://img.shields.io/pypi/v/cid.svg :target: https://pypi.python.org/pypi/cid/
.. image:: https://img.shields.io/pypi/dm/cid.svg :target: https://pypi.python.org/pypi/cid/
Chinese Identity Parser
提取身份证号码中的生日、性别、办证区域, 校验身份证号码格式是否正确
::
pip install cid
::
In [1]: from cid import IdParser
In [2]: ip = IdParser()
In [3]: ip.parse('360730198601011111')
Out[3]:
{'birthday': '1986-01-01',
'gender': '男',
'region': {'city': '赣州市', 'district': '宁都县', 'province': '江西省'}}
# 校验身份证号码格式是否正确
In [4]: ip.is_valid_cid('360730198601011111')
Out[4]: False
In [5]: ip.extract_gender('360730198601011111')
Out[5]: '男'
In [6]: ip.extract_birthday('360730198601011111')
Out[6]: '1986-01-01'
In [7]: ip.extract_region('360730198601011111')
Out[7]: {'city': '赣州市', 'district': '宁都县', 'province': '江西省'}
# 除了提取发证地,需要实例化 IdParser 外, 其他方法可直接使用
In [8]: from cid import (is_valid_cid, extract_gender, extract_birthday)
FAQs
Extract Chinese identity card info (gender, birthday and regions)
We found that cid demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.