Code Monkey home page Code Monkey logo

Comments (8)

Ricky617 avatar Ricky617 commented on August 30, 2024

430302 应该是湘潭市,显示为邵阳市

from id-validator.py.

jxlwqq avatar jxlwqq commented on August 30, 2024

430302 应该是湘潭市,显示为邵阳市

@Ricky617 完整的ID方便发我吗,我测试一下。

from id-validator.py.

Ricky617 avatar Ricky617 commented on August 30, 2024

4303021993

from id-validator.py.

Ricky617 avatar Ricky617 commented on August 30, 2024

<class 'list'>: [{'address': '湘潭市', 'start_year': '', 'end_year': ''}, {'address': '邵阳市', 'start_year': 1982, 'end_year': 1983}]
93年应该是湘潭市

from id-validator.py.

Ricky617 avatar Ricky617 commented on August 30, 2024

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.

jxlwqq avatar jxlwqq commented on August 30, 2024

谢谢,我周末复查一下,最近加班没时间搞。

from id-validator.py.

jxlwqq avatar jxlwqq commented on August 30, 2024

计划最迟下周发布,需要优化一些逻辑和补上一些tests

from id-validator.py.

jxlwqq avatar jxlwqq commented on August 30, 2024

已发布:https://pypi.org/project/id-validator/1.0.14/

from id-validator.py.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.