生成假数据
fakeit的Python项目详细描述
遇到提供生成简单伪数据的伪it项目
安装:
- python setup.py安装
- pip安装fakeit
- pip安装git+https://github.com/RCheese/fakeit
用法:
为python类型生成假数据
字节
>>>fromfakeitimportbytes>>>bytes.fake_bytes(min_length=2,max_length=5)...b'/\xf5Q\x9a\xcd'>>>bytes.fake_b64(min_length=2,max_length=5)...b'QpwJug=='
散列
>>>fromfakeitimporthashes>>>hashes.fake_md5()...'37c6c63ee4dd8516d3d8ee4319b3e7b8'>>>hashes.fake_sha256()...'bc6c64d150e869cf10e3d9c0cf582fa78fe46282de75911b464c46a023a08038'
数字
>>>fromfakeitimportnumerics>>>numerics.fake_complex(1,2,3,4)...(1.2157335093960198+3.17909803327301j)>>>numerics.fake_complex(1,2,3,4,round=True)...(2+4j)>>>numerics.fake_int(1,20)...11>>>numerics.fake_float(1,20)...3.448023122876366
字符串
>>>fromfakeitimportstrings>>>strings.fake_string(min_length=5,max_length=5)...'CPOcO'>>>fake_string(min_length=5,max_length=5,unique=True)...'qEiwW'>>>fake_string(min_length=5,max_length=5,alphabet="ABCdE")...'EdBdB'>>>fake_strings(5)...<generatorobjectfake_stringsat0x7f67579e4660>>>>foriinfake_strings(5):>>>print(i)>>>...1r3OxTKis20KF......3YN28kOPLuc...DaLQ...j7J9MMJcF2>>>foriinall_combinations_with_replacement_fake_string(min_length=3,max_length=3,alphabet="abc"):>>>print(i)...aaa...aab...aac...abb...abc...acc...bbb...bbc...bcc...ccc
个人
``
>>>fromfakeitimportpersonal>>>personal.names.fake_fullname()...'Justin Hall'>>>personal.names.fake_name()...'Johnny'>>>personal.names.fake_surname()...'Gill'>>>personal.phones.fake_international()...'+67-910-8211582'>>>personal.phones.fake_international(mediator="")...'+974665503991'>>>fake_international(country_code=7,area_code=923)...'+7-923-4915850'>>>personal.emails.fake_email()...'0mfJz0QD@VqujvpRDiuMfuyB.VRQfn'>>>personal.emails.fake_enough_email()...'Henry.Hill@google.cn'>>>personal.fake_person()...<PersonStephenRobertson>(FirstName=Stephen,LastName=Robertson,Email=Stephen.Robertson@whatsapp.net,Phone=+1-990-5674435)
待办事项:
- 地理
- 位置
- 命名(国家、城市等)
- 地址
- 特别的
- Uuids
- 文本数据
- 桌子
- 是吗?
- 单元测试
- sqlalchemy类型转换
- Django型铸造
- 斯芬克斯文件
- ci
- 编译请求