造数据
from faker import Faker fk = Faker(locale="zh-CN") #姓名 name = fk.name() print(name) #身份证 id_card = fk.ssn() print(id_card) #手机号 phone = fk.phone_number() print(phone) #银行卡 card = fk.credit_card_number() print(card) #地址 addr = fk.address() print(addr) #邮箱 email = fk.email() print(email) #公司 company = fk.company() print(company) #公司邮箱 company_email = fk.company_email() print(company_email) #工作岗位 job = fk.job() print(job) #个人信息 # per = fk.profile() per = fk.simple_profile() print(per) #随机数 res=fk.random_int(min=100,max=999) print(res) #生成一句话 res = fk.sentence() print(res) #生成一段文字 text = fk.text() print(text) #随机生成字符串 test_str = fk.pystr() print(test_str) #生成多个数据,保证数据不重复 result =[fk.unique.name() for i in range(10)] print(result) #年 year = fk.year() this_year = fk.date_this_year() # print(this_year) #月 month = fk.month() this_month = fk.date_this_month() # print(this_month) #精确到秒 date_time=fk.date_time() # print(date_time) #年月日 date_time = fk.date() # print(date_time) #指定时间范围 年月日 target__time = fk.date_between(start_date="-3y",end_date="today") print(target__time) #指定时间范围 年月日 时分秒 target__time_now = fk.date_time_between(start_date="-2y",end_date="now") print(target__time_now) #未来时间 future_date = fk.future_date() # print(future_date) future_date_time = fk.future_datetime() print(future_date_time)