Code Monkey home page Code Monkey logo

pyfakers's Introduction

py-fake-rs

A fake data generator (a faker) for Python, extended with Rust. The reason for this library is performance. When you're generating large amounts of fake data, this library will serve you well.

This module contains bindings to fake-rs,

Example API

from pyfakers import Name

print(Name.first_name())
print(Name.last_name())

Installation

Install from pypi:

    pip install pyfakers

Building from source

Install libffi, python3 headers, setuptools and wheel. The following command will install these on Ubuntu

    apt-get install libffi-dev python3-dev python3-setuptools python3-wheel

Check out the repository

    git clone [email protected]/pyfakers.git
    cd pyfakers

In order to compile the Rust code, you'll need to have Rust nightly toolchain installed and enabled.

Use rustup to set this up, find installation instructions for rustup at https://www.rustup.rs/

To use Rust nightly, run the following commands (from the project root)

    rustup update nightly
    rustup override add nightly

Install the pipenv utility from pypi

	pip install pipenv

Install dependencies (from the project root)

	pipenv install

Launch a virtual environment (from the project root)

	pipenv shell

Now you can build the package

    python3 setup.py bdist_wheel

Install the wheel

	pip install dist/<wheel file name>

Full API

from pyfakers import Name, Internet, Company, Address, PhoneNumber

print(Name.first_name())
print(Name.last_name())
print(Name.full_name())
print(Name.title_descriptor())
print(Name.title_level())
print(Name.title_job())
print(Name.title())

print(Internet.free_email_provider())
print(Internet.domain_suffix())
print(Internet.user_name())
print(Internet.free_email())
print(Internet.safe_email())

print(Company.suffix())
print(Company.name())
print(Company.buzzword())
print(Company.catch_phrase())
print(Company.bs())
print(Company.profession())
print(Company.industry())

print(Address.time_zone())
print(Address.city_prefix())
print(Address.city_suffix())
print(Address.street_suffix())
print(Address.state())
print(Address.state_abbr())
print(Address.city())
print(Address.street_name())
print(Address.building_number())
print(Address.street_address())
print(Address.secondary_address())
print(Address.postal_code())
print(Address.latitude())
print(Address.longitude())

print(PhoneNumber.phone_number())

pyfakers's People

Contributors

dowwie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

teddybear

pyfakers's Issues

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.