模块来自于faker,内部为Faker

from faker import Faker
fake = Faker()

下面是一些基本的类型:

fake.__class__()   # <faker.generator.Generator object at 0x7ff780c23e10>
fake.__hash__()   # 8793824177497
fake.__repr__()   # <faker.generator.Generator object at 0x7ff78c42d590>
fake.__sizeof__()   # 32
fake.__str__()   # <faker.generator.Generator object at 0x7ff78c42d590>
fake.__subclasshook__()   # NotImplemented
fake.address()   # 云南省荣县白云延路y座 648847
fake.am_pm()   # AM
fake.ascii_company_email()   # zhangchao@mao.com
fake.ascii_email()   # yongzheng@hotmail.com
fake.ascii_free_email()   # gongfang@hotmail.com
fake.ascii_safe_email()   # tzhao@example.net
fake.boolean()   # True
fake.bothify()   # 10 Nq
fake.bs()   # productize front-end supply-chains
fake.building_number()   # E座
fake.catch_phrase()   # Visionary logistical initiative
fake.century()   # II
fake.chrome()   # Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_8_9) AppleWebKit/5352 (KHTML, like Gecko) Chrome/14.0.828.0 Safari/5352
fake.city()   # 成都市
fake.city_name()   # 宁德
fake.city_suffix()   # 市
fake.color_name()   # DarkOliveGreen
fake.company()   # 网新恒天信息有限公司
fake.company_email()   # xiongchao@cai.com
fake.company_prefix()   # 维旺明
fake.company_suffix()   # 信息有限公司
fake.country()   # 阿拉伯联合酋长国
fake.country_code()   # ES
fake.credit_card_expire()   # 06/22
fake.credit_card_full()   # JCB 16 digit
柳 冉
3096337563919187 07/23
CVC: 610fake.credit_card_number()   # 6011172478902092
fake.credit_card_provider()   # Voyager
fake.credit_card_security_code()   # 0753
fake.cryptocurrency_code()   # XDN
fake.currency_code()   # TWD
fake.date()   # 1973-07-31
fake.date_between()   # 2008-01-12
fake.date_between_dates()   # 2017-12-06
fake.date_object()   # 1972-08-01
fake.date_this_century()   # 2008-09-16
fake.date_this_decade()   # 2013-12-26
fake.date_this_month()   # 2017-12-01
fake.date_this_year()   # 2017-09-19
fake.date_time()   # 2016-08-05 03:23:26
fake.date_time_ad()   # 0258-04-07 20:48:11
fake.date_time_between()   # 2006-06-09 01:28:22
fake.date_time_between_dates()   # 2017-12-06 10:47:23
fake.date_time_this_century()   # 2001-11-30 13:58:47
fake.date_time_this_decade()   # 2012-08-25 18:04:34
fake.date_time_this_month()   # 2017-12-04 11:24:57
fake.date_time_this_year()   # 2017-06-02 08:50:48
fake.day_of_month()   # 15
fake.day_of_week()   # Thursday
fake.district()   # 清河
fake.domain_name()   # lu.com
fake.domain_word()   # zhao
fake.ean()   # 5954186746588
fake.ean13()   # 9672235528133
fake.ean8()   # 06171292
fake.email()   # zhengtao@gmail.com
fake.file_extension()   # docx
fake.file_name()   # 品牌.doc
fake.file_path()   # /关于/推荐.pptx
fake.firefox()   # Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_7; rv:1.9.4.20) Gecko/2011-01-16 07:23:04 Firefox/5.0
fake.first_name()   # 玉珍
fake.first_name_female()   # 彬
fake.first_name_male()   # 莹
fake.first_romanized_name()   # Fang
fake.free_email()   # bwen@hotmail.com
fake.free_email_domain()   # yahoo.com
fake.future_date()   # 2017-12-13
fake.future_datetime()   # 2017-12-19 00:29:14
fake.geo_coordinate()   # -172.459902
fake.hex_color()   # #b4e7a9
fake.image_url()   # https://dummyimage.com/517x471
fake.internet_explorer()   # Mozilla/5.0 (compatible; MSIE 6.0; Windows CE; Trident/4.0)
fake.ipv4()   # 6.155.240.182
fake.ipv6()   # 6903:92c5:9e08:5f0c:5fda:b85e:97ec:b885
fake.isbn10()   # 0-02-210237-X
fake.isbn13()   # 978-1-79735-105-6
fake.iso8601()   # 1986-08-09T07:49:59
fake.job()   # Designer, graphic
fake.language_code()   # bs
fake.last_name()   # 逯
fake.last_name_female()   # 申
fake.last_name_male()   # 查
fake.last_romanized_name()   # Dong
fake.latitude()   # 10.6496555
fake.lexify()   # PEdF
fake.license_plate()   # 4-2558G
fake.linux_platform_token()   # X11; Linux i686
fake.linux_processor()   # i686
fake.locale()   # ka_GE
fake.longitude()   # -45.494435
fake.mac_address()   # 70:0a:bf:0f:77:47
fake.mac_platform_token()   # Macintosh; PPC Mac OS X 10_7_7
fake.mac_processor()   # Intel
fake.md5()   # 71f8c16a5f87000130b7df65611c364a
fake.mime_type()   # message/partial
fake.month()   # 11
fake.month_name()   # February
fake.msisdn()   # 6138497580204
fake.name()   # 离莹
fake.name_female()   # 万成
fake.name_male()   # 况丽华
fake.null_boolean()   # True
fake.numerify()   # 877
fake.opera()   # Opera/9.94.(Windows 95; nl-BE) Presto/2.9.171 Version/11.00
fake.paragraph()   # 系列位置由于作品什么特别研究.精华网络或者搜索.主题我们类别这个增加.
fake.paragraphs()   # [u'\u516c\u53f8\u9700\u8981\u65f6\u95f4\u73af\u5883.\u7684\u4eba\u63d0\u4f9b\u79ef\u5206\u5728\u7ebf\u6807\u51c6\u6cd5\u5f8b\u6211\u4eec\u6ce8\u610f.', u'\u8c22\u8c22\u57fa\u672c\u4ec0\u4e48\u4e2d\u6587\u540d\u79f0\u7136\u540e\u9996\u9875\u5de5\u5177.\u539f\u56e0\u6ca1\u6709\u9700\u8981\u8ba1\u5212\u5b9e\u73b0\u89c9\u5f97.\u7ed3\u679c\u5f53\u524d\u7814\u7a76\u5927\u5bb6.', u'\u7684\u8bdd\u90fd\u662f\u4e4b\u95f4\u4e3a\u4ec0\u672c\u7ad9\u89c4\u5b9a\u5927\u5b66.\u5206\u6790\u62e5\u6709\u800c\u4e14\u6587\u4ef6.']
fake.password()   # z@YJ7Wcpgv
fake.past_date()   # 2017-11-22
fake.past_datetime()   # 2017-12-03 18:08:05
fake.phone_number()   # 18597001558
fake.phonenumber_prefix()   # 132
fake.postcode()   # 870942
fake.profile()   # {'website': [u'https://www.hu.net/', u'https://www.zou.cn/', u'https://shen.cn/', u'http://kong.com/'], 'username': u'wanjing', 'name': u'\u79e6\u79c0\u5170', 'blood_group': '0+', 'residence': u'\u8fbd\u5b81\u7701\u5e06\u53bf\u79c0\u82f1\u516d\u76d8\u6c34\u8857u\u5ea7 436149', 'company': u'\u9ec4\u77f3\u91d1\u627f\u4fe1\u606f\u6709\u9650\u516c\u53f8', 'address': u'\u897f\u85cf\u81ea\u6cbb\u533a\u51e4\u5170\u53bf\u5c71\u4ead\u94f6\u5ddd\u8857P\u5ea7 346744', 'birthdate': '1985-04-28', 'sex': 'M', 'job': 'Engineer, mining', 'ssn': u'433125195206070070', 'current_location': (Decimal('-15.7126615'), Decimal('-143.411020')), 'mail': u'fliang@hotmail.com'}
fake.province()   # 广西壮族自治区
fake.pybool()   # True
fake.pydecimal()   # 384.433560097
fake.pydict()   # {u'\u5927\u5bb6': u'https://www.gao.net/categories/categories/index.php', u'\u90a3\u4e48': 4623, u'\u72b6\u6001': datetime.datetime(1994, 3, 19, 8, 6, 12), u'\u80fd\u529b': Decimal('6.96492'), u'\u540c\u65f6': u'JpjrByPDCgnsNDfaNYgd', u'\u5ba2\u6237': 3485}
fake.pyfloat()   # -4099208226.9
fake.pyint()   # 3270
fake.pyiterable()   # [-7155.447707, u'KOQVBTsYxVpaVxpHBXiO', u'https://www.kang.com/index.php', u'jKmLqgUUOEqdXCeTGBID', u'pGVNjKcxmCTQNpdpKbgm', -48.1915257969, datetime.datetime(1975, 9, 27, 18, 22, 43)]
fake.pylist()   # [4770, datetime.datetime(1990, 4, 11, 9, 59, 16), 2546, 8087, -612180.919, 2.3246212976]
fake.pyset()   # set([u'uwFlxgSEwApkViCNpQZk', u'TlijxYEXankqWtWXkHax', u'TPgKtCtIHXIaKxgWMDjo', Decimal('-72118073288.1'), u'LYoqafrVUVggsnWJXKUg', Decimal('-239813.3099'), u'ELLFUOSNKtxYyhtCXPPg', 1371])
fake.pystr()   # GdxudJdOCeExecGzFpJg
fake.pystruct()   # ([u'WTHzKZdDIrwhUfPHrjMb', u'MVXsSqDWyabyceZRSgGr', datetime.datetime(1993, 10, 3, 1, 1, 31), u'sKcZHJgAGVZrCIfIHwMS', 7694, u'wdedDezTMpfOxUQHaVlO', u'iMgUrRzaaYtArWrnxWda', u'tixihvoqNqQVByfEoGsg', u'https://www.qiu.com/search/explore/home.html', 898068606944.83], {u'\u6709\u9650': Decimal('4.3883198'), u'\u8fd9\u4e48': u'UVOyihAmcukcQJcVIOah', u'\u5408\u4f5c': 3743, u'\u4e0d\u540c': datetime.datetime(2005, 2, 23, 7, 35, 45), u'\u63d0\u9ad8': datetime.datetime(1987, 2, 10, 2, 28, 44), u'\u8bc4\u8bba': 8874, u'\u5173\u4e8e': u'apan@wei.net', u'\u7ec4\u7ec7': 468, u'\u60c5\u51b5': 6083, u'\u884c\u4e1a': u'qiang61@long.org'}, {u'\u4e13\u4e1a': {3: u'AkBWAoxmmokgNrRogyYk', 4: [4596, u'nJzscDjtYSbEzPdkOkRK', 5365], 5: {3: 4605, 4: u'chao87@wei.com', 5: [u'xia30@lu.cn', datetime.datetime(2006, 10, 25, 21, 37, 41)]}}, u'\u4e2d\u6587': {8: [u'oYYfArTznrMITieKBrdT', u'QoESvZcnaAZFmaQqjrgk', u'afkzJChqTNmwwcUXcTOu'], 9: {8: u'ughNWEsmKFFnPReWycbf', 9: [-6.41272, -39213.981], 7: u'RKIcxKTOThQLwaIgVFWe'}, 7: u'uIVZuDPnedhnOJVZUzfX'}, u'\u8fd8\u662f': {9: u'JqElYMJfaassiofLGvLn', 10: [4443, u'aZgiftVvonSEzCzTddiO', u'shaowei@yan.com'], 11: {9: 9967, 10: 5143, 11: [u'usmTtsPWPYtObuYObOpB', Decimal('-31192.5654601')]}}, u'\u6765\u81ea': {1: u'sIqUyGCneohdHGgznDuU', 2: [datetime.datetime(2007, 5, 31, 11, 24, 16), 8321, u'pfIJmDxwAquYLyxrpuVz'], 3: {1: u'gliang@hotmail.com', 2: Decimal('33965.0'), 3: [u'AexgPcuhOIziJhYifZtR', datetime.datetime(2003, 3, 24, 22, 28, 43)]}}, u'\u7cfb\u7edf': {4: u'welRgeLqhOQPGkdkviok', 5: [Decimal('-46.5'), u'hmJxbwRBLukmjHylLojM', u'http://www.mao.cn/search/tag/index.html'], 6: {4: u'http://zou.cn/tag/index/', 5: u'uBlLVOtLauDbAMlrpTZM', 6: [u'bqiHwnSArJdlQnvsbKPN', u'RQdmtWPMwiFuaThJrMWm']}}, u'\u6280\u672f': {8: 2626, 9: [Decimal('4719860282.19'), Decimal('-392046163.17'), datetime.datetime(2005, 1, 11, 13, 21, 2)], 10: {8: u'MoUiPqxBcSTrkudFLIza', 9: u'XUQtWQGntEeuayziAnYA', 10: [u'ulhMPZKMdlQzfWdUuYIF', datetime.datetime(1994, 7, 25, 9, 15, 28)]}}, u'\u9009\u62e9': {8: {8: [u'yong58@ren.cn', u'cGFuWyLdFRUzGhTCaFjE'], 6: 7701, 7: datetime.datetime(2010, 8, 15, 10, 6, 13)}, 6: u'zengwei@gmail.com', 7: [6858, 6403, datetime.datetime(1984, 4, 18, 11, 0, 12)]}, u'\u4e00\u70b9': {0: 6620, 1: [u'OrTScuyESDqszlQjOlYX', u'hJahyMWdkPLhNOMzrdfy', u'mmZYqEDMYPodgUuICyct'], 2: {0: -33313798379.385, 1: u'XRpLoRsRMQIROsBqIHlG', 2: [u'xZozzLqTMwXpfdTpMscc', u'https://www.xia.com/']}}, u'\u7531\u4e8e': {2: u'naguo@qian.com', 3: [u'wTVRQMbwJPUNAKbhAKFs', Decimal('-679732200.8'), u'braeyLsfMvOtsSrgwlxX'], 4: {2: u'feviQSXEPjAzICRiXIWU', 3: u'xiuyinghe@gmail.com', 4: [5961281603639.0, u'YNOuECSZEExtHvlGKwwE']}}, u'\u56fe\u7247': {5: datetime.datetime(1977, 3, 29, 23, 38), 6: [u'http://yin.com/main.jsp', u'yanjia@yahoo.com', 632.53909299766], 7: {5: u'RqBzkDuehAQUCHYQCmAZ', 6: 4597, 7: [8421, 7708]}}})
fake.pytuple()   # (u'CJFHMwspGSwiPKfZhCVY', u'IDhxTOsuOiDHOlKtMbbe', 6637, 978, u'RodatDSuaRbwlgTJNzKx', u'fsUVemSiAyPqyLFmfdZD', u'zhujuan@li.cn', u'https://kong.cn/categories/app/login.htm', Decimal('-406039.250589'), 8127)
fake.random_digit()   # 9
fake.random_digit_not_null()   # 6
fake.random_digit_not_null_or_empty()   # 5
fake.random_digit_or_empty()   # 3
fake.random_element()   # a
fake.random_int()   # 4585
fake.random_letter()   # o
fake.random_number()   # 80709883
fake.random_sample()   # ['a', 'c']
fake.random_sample_unique()   # set(['a', 'c', 'b'])
fake.randomize_nb_elements()   # 13
fake.rgb_color()   # 97,134,130
fake.rgb_css_color()   # rgb(39,226,180)
fake.romanized_name()   # Qiang Du
fake.safari()   # Mozilla/5.0 (Windows; U; Windows NT 6.0) AppleWebKit/532.2.5 (KHTML, like Gecko) Version/4.0.2 Safari/532.2.5
fake.safe_color_name()   # yellow
fake.safe_email()   # ming14@example.net
fake.safe_hex_color()   # #ff3300
fake.sentence()   # 方法科技是否只有无法.
fake.sentences()   # [u'\u4ec0\u4e48\u672c\u7ad9\u6280\u672f\u4e00\u6b21\u8868\u793a\u4e0d\u540c\u5904\u7406.', u'\u8fd0\u884c\u65b9\u5f0f\u80fd\u529b\u4e00\u6837\u5f53\u524d.', u'\u6700\u65b0\u901a\u8fc7\u4e00\u4e2a\u5b66\u6821\u5f53\u524d\u4eca\u5e74\u5982\u679c\u5efa\u8bbe.']
fake.sha1()   # 7052c75358562302ddacd77e14e49986926374fa
fake.sha256()   # 27e24e47230c764507a2e54d25a495e2f1f24ebcc23c6bf2b213b21379f8865e
fake.simple_profile()   # {'username': u'nayuan', 'name': u'\u5b87\u9633', 'birthdate': '1975-11-12', 'sex': 'M', 'address': u'\u6c5f\u897f\u7701\u6f5c\u6c5f\u53bf\u6c38\u5ddd\u62d3\u8defj\u5ea7 699193', 'mail': u'guiying19@hotmail.com'}
fake.ssn()   # 410403194106288547
fake.street_address()   # 燕街L座
fake.street_name()   # 广州街
fake.street_suffix()   # 路
fake.text()   # 留言大小看到.成为控制拥有.
电子个人产品产品这么其他文章.国际谢谢公司系统为什.一起其他作品客户一种系列.
事情中国记者.男人为什组织的话.
要求部门希望.很多投资深圳方面操作威望需要.
注意你们这种学生可是所有通过基本.游戏时候日本目前数据生活得到.
市场这是还是学校时间最后.关于之后浏览相关企业支持结果类别.正在专业人员实现.
fake.time()   # 17:02:29
fake.time_delta()   # 8837 days, 21:54:15
fake.time_object()   # 03:34:28
fake.time_series()   # <generator object time_series at 0x7ff7800cb280>
fake.timezone()   # Asia/Jerusalem
fake.tld()   # cn
fake.unix_time()   # 1100321594
fake.uri()   # https://pan.org/terms/
fake.uri_extension()   # .php
fake.uri_page()   # login
fake.uri_path()   # app/category
fake.url()   # http://www.xie.com/
fake.user_agent()   # Mozilla/5.0 (Macintosh; Intel Mac OS X 10_5_6; rv:1.9.5.20) Gecko/2016-10-29 04:38:17 Firefox/12.0
fake.user_name()   # jingmo
fake.uuid4()   # f64bcfad-67c4-c748-5e19-86a74848e6fa
fake.windows_platform_token()   # Windows NT 5.2
fake.word()   # 更新
fake.words()   # [u'\u7136\u540e', u'\u5927\u5b66', u'\u7a0b\u5e8f']
fake.year()   # 2001

Python faker函数相关推荐

  1. 【Python】函数图像绘制:二维图像、三维图像、散点图、心形图

    [Python]函数图像绘制:二维图像.三维图像.散点图.心形图 所有需要用的包 二维图像 三维图像 散点图绘制 心形图绘制 所有需要用的包 from mpl_toolkits.mplot3d imp ...

  2. 技术图文:Python 匿名函数 VS. C# Lambda表达式

    背景 前段时间在知识星球上立了一个Flag,至少写10篇关于 Python,Matlab 和 C# 对比的总结. 这是第 2 篇,从定义和应用两个角度来对比 Python 的匿名函数 与 C# 的La ...

  3. Python divmod() 函数

    Python divmod() 函数 python divmod() 函数把除数和余数运算结果结合起来,返回一个包含商和余数的元组(a // b, a % b). 函数语法 divmod(a, b) ...

  4. python参数传递方法_深入理解python中函数传递参数是值传递还是引用传递

    python 的 深入理解python中函数传递参数是值传递还是引用传递 目前网络上大部分博客的结论都是这样的: Python不允许程序员选择采用传值还是传 引用.Python参数传递采用的肯定是&q ...

  5. python中函数包括标准库函数吗_Python语言和标准库(第二章:函数)

    a-如何创建函数. b-给出一些指导原则,帮助思考如何创建和组织程序以使用函数. c-如何编写函数,使随后可以询问它们的工作方式和实现的功能. 2.1将程序放在单独的文件里 为了更加方便,从现在开始, ...

  6. c int转字符串_【C++实现python字符串函数库】字符串匹配函数startswith与endswith

    [C++实现python字符串函数库]字符串匹配函数startswith与endswith 这两个函数用于匹配字符串的开头或末尾,判断是否包含另一个字符串,它们返回bool值.startswith() ...

  7. python中函数和方法的区别?Python编程判断当前获取的对象是函数还是方法

    python中函数和方法的区别?Python编程判断当前获取的对象是函数还是方法 目录

  8. python log函数怎么打_Python的log日志功能及设置方法

    python log函数怎么打_Python的log日志功能及设置方法_Elaine要当律师的博客-CSDN博客

  9. Python staticmethod() 函数

    Python staticmethod() 函数 正在上传-重新上传取消​ Python 内置函数 python staticmethod 返回函数的静态方法. 该方法不强制要求传递参数,如下声明一个 ...

  10. python基础--函数

    #python中函数的定义:函数是逻辑结构化和过程化的一种编程方法,用来实现某些特定的功能.#python中函数简单定义的方法# def test(x):# "this is new fun ...

最新文章

  1. 【HTML】框架集(Framesets)
  2. VirtraulBox中安装Ubuntu16.04
  3. React中的模糊匹配与精准匹配
  4. 不带头结点的单链表的建立
  5. 目标检测第1步:如何在Windows 10下安装MiniConda?
  6. Oracle中如何删除重复数据
  7. scala函数式编程
  8. L1-025 正整数A+B (15 分)—团体程序设计天梯赛
  9. ai背景合成_视频素材不好找!图片也能生成视频啦,AI剪辑助力原创短视频创作...
  10. csapp-深入理解计算机系统学习记录
  11. 视易精通收银服务器自动关机,视易精通量贩式收银系统操作手册3.0
  12. GB35114---基于pjsip协议库开发问题
  13. 海康设备如何接入萤石开放平台
  14. JPEG算法 格式压缩方案
  15. 利用AI强化学习训练50级比卡超单挑70级超梦!
  16. 19杭电计算机考研科目,2019杭电计算机考研初试科目、参考书目、报录比汇总
  17. java mysql 生僻字 乱码_mysql 生僻字乱码
  18. ArcMap Drawing Errors问题查找解决记录
  19. VR元宇宙展会,带来全新线上展厅沉浸式体验
  20. Stress Centrality (重力中心性)的计算方法

热门文章

  1. 《吊打分析师》实战—深圳链家租房数据分析 | 附源码
  2. 装完黑苹果怎么装windows_苹果都说双系统好 黑苹果装windows教程
  3. Netlogo仿真初步学习总结
  4. list(map(tokenizer.tokenize, text))
  5. 泰坦尼克号各种因素对存活率的影响
  6. linux调整刷新率,在Linux操作系统下调整屏幕刷新率的方法
  7. 关于360评估的全面介绍
  8. Dubbo-Adaptive实现解析
  9. typora问题解决:This beta version of Typora is expired
  10. iphone 计算文件长度