Skip to main content

mockdata生产数据

Project description

项目描述

mockdata 是一个 Python 库,用于生成模拟数据。它包含各个行业各种字段,包含地址,个人信息(姓名,性别,职位等),电话,银行相关信息(信用卡,银行信息),货币(汇率、币种等), 汽车(车牌号,汽车识别码)相关信息,公司(公司名称,联系方式)信息,信用卡,经纬度,互联网相关信息,文件,密码,代理信息等等 可以用于测试、演示和开发。

更新日志

1.0.0
    - 首次提交
1.0.1
    - 演示
1.0.2
    - 修复mock_time()方法
    - 优化MockCreditCard()类中mock_credit_card_provider()方法
    - 新增mockdata方法使用示例.doc文件,包含mockdata方法使用示例

安装步骤

  • 从pypi安装
pip install mockdata
  • 从源码安装
https://github.com/Joyamon/mockdata.git
cd mockdata
python setup.py

项目目录说明

mockdata
    ├── __init__.py
    ├── fields
       │   ├── __init__.py
       │   ├── mock_address.py
       │   ├    ......
       └── setup.py
       └── README.md
       └── requirements.txt
    ├── img
      └── image.png
    ├── utils
      └── __init__.py
       └── convert.py    # base64转图片
    ├── bank.json

使用方法


C:\Users\YAFEX>pip show mockdata
Name: mockdata
Version: 1.0.0
Summary: mockdata生产数据
Home-page: https://github.com/Joyamon/mockdata
Author: 半只程序员
Author-email:
License:
Location: C:\Python312\Lib\site-packages
Requires: Faker, Pillow
Required-by:

C:\Users\YAFEX>python
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun  6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
# 地址相关信息
>>> from mockdata.fields.mock_address import MockAddress
>>> MockAddress().mock_address()  
'吉林省阜新县永川谭路L座 836975'
>>> MockAddress().mock_city()
'成都县'
>>> MockAddress().mock_country()
'科特迪瓦'
>>> MockAddress().mock_street_name()
'蔡街'
# 表情emoji
>>> from mockdata.fields.mock_emoji import MockEmoji
>>> MockEmoji().mock_emoji()
'🛠️'
# 电话
>>> from mockdata.fields.mock_phone import MockPhone
>>> MockPhone().mock_phone_number()
'15927727902'
# 个人信息
>>> from mockdata.fields.mock_profile import MockProfile
>>> MockProfile().mock_profile()
{'job': '餐饮服务', 'company': '昂歌信息传媒有限公司', 'ssn': '440802194111247513', 
'residence': '河南省上海市高明沈阳路Z座 596771', 
'current_location': (Decimal('24.971868'), Decimal('84.577041')), 
'blood_group': 'O-', 
'website': ['https://www.shaoxue.cn/', 'https://gj.cn/', 'https://yinmo.cn/'], 
'username': 'laili', 'name': '徐志强', 'sex': 'F', 'address': '辽宁省佳县清河田街S座 185675', 
'mail': 'tzeng@gmail.com', 'birthdate': datetime.date(1920, 2, 25)}

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mockdata-1.0.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

mockdata-1.0.2-py3-none-any.whl (16.0 kB view details)

Uploaded Python 3

File details

Details for the file mockdata-1.0.2.tar.gz.

File metadata

  • Download URL: mockdata-1.0.2.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for mockdata-1.0.2.tar.gz
Algorithm Hash digest
SHA256 81e674a13ab90664c82cdda60c51730220a352941746ec7a0b9f208be32001a4
MD5 c678d643a1f81e05f80b1d6a02a82a19
BLAKE2b-256 6e3f2c6d04bda439e72f439f005d470840d71280b9408fb3aa25bdad9dd3ab96

See more details on using hashes here.

File details

Details for the file mockdata-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: mockdata-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 16.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for mockdata-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ad53c726942335788db57c4be11271145b1ac1e22344cf4fc8225c1b2369632f
MD5 c2d20b7995cf7951967cb0c103823b2a
BLAKE2b-256 2b7ab8d22609229945c9e30f187c507a9a45328609bc05bbff0b390ec5198152

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page