Comments (8)
430302 应该是湘潭市,显示为邵阳市
from id-validator.py.
430302 应该是湘潭市,显示为邵阳市
@Ricky617 完整的ID方便发我吗,我测试一下。
from id-validator.py.
4303021993
from id-validator.py.
<class 'list'>: [{'address': '湘潭市', 'start_year': '', 'end_year': ''}, {'address': '邵阳市', 'start_year': 1982, 'end_year': 1983}]
93年应该是湘潭市
from id-validator.py.
def get_address(address_code, birthday_code):
"""
通过地址码与出生日期码获取地址信息
:param address_code:
:param birthday_code:
:return:
"""
address = ''
address_code_timeline = data.get_address_code_timeline()
timeline = address_code_timeline.get(address_code, '')
if timeline != '':
year = int(birthday_code[0:4])
for key, val in enumerate(timeline):
start_year = val['start_year']
end_year = val['end_year']
if start_year != '' and end_year != '' and start_year <= year <= end_year:
address = val['address']
break
if start_year != '' and end_year == '' and year >= start_year:
address = val['address']
if start_year == '' and end_year != '' and year <= end_year:
address = val['address']
if start_year == '' and end_year == '':
address = val['address']
return address
不知道这么写行不行
from id-validator.py.
谢谢,我周末复查一下,最近加班没时间搞。
from id-validator.py.
计划最迟下周发布,需要优化一些逻辑和补上一些tests
from id-validator.py.
已发布:https://pypi.org/project/id-validator/1.0.14/
from id-validator.py.
Related Issues (20)
- 单元测试新增python版本
- get_info中建议增加年龄信息 HOT 2
- test on python 3.9
- 有的身份证 正确的但是校验显示不通过 HOT 4
- 關於區劃代碼的問題 HOT 22
- data文件中value=‘未曾使用‘的数据是什么意思? HOT 1
- 验证有点问题:12403、230119、632824、622961 不在官方的数据库中 HOT 2
- bug:无 321119 区划代码 HOT 1
- birthday参数可能有点问题
- 请问能否实现按规则(日期、顺序码连续那种)批量生成身份证的功能?有需要但一直没找到合适的工具 HOT 9
- 请问您是怎么根据年份对地区码进行查找的? HOT 2
- 请问直接用省/市直属区划代码的身份证号现实生活里真实存在吗?这种校验是否会出现误差
- 出现BUG:地址区划代码与年份不同的错误身份证也能通过 HOT 3
- 出现bug
- java版本
- 校验错误python版本
- 建立增加省份信息 HOT 2
- ValueError: invalid literal for int() with base 10: '*' HOT 3
- 提取信息速度有点慢,建议优化一下 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from id-validator.py.