Coder Social home page Coder Social logo

senthilnayagam / elizabeth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lk-geimfari/mimesis

1.0 3.0 0.0 3.57 MB

Elizabeth is a fast and easier to use Python library for generating dummy data, which are very useful when you need to bootstrap the database in the testing phase of your software.

Home Page: http://lk-geimfari.github.io/elizabeth/

License: MIT License

Python 99.85% Shell 0.15%

elizabeth's Introduction

Elizabeth

Build Status codecov Documentation Status PyPI version Python Version Codacy Badge


Elizabeth is a fast and easier to use Python library for generating dummy data. These data are very useful when you need to bootstrap the database in the testing phase of your software. A great example of how you can use the library are web applications on Flask or Django which need a data, such as users (email, username, name, surname etc.), posts (tags, text, title, publishing date and etc.) and so forth. The library uses the JSON files as a datastore and doesn’t have any dependencies. The library offers more than 18 different data providers (from personal ones to transport and more).

Documentation

Elizabeth is a pretty simple library and all you need to start is the small documentation. See Elizabeth's Sphinx-generated documentation here: http://elizabeth.readthedocs.io/en/latest/

Locales

At this moment a library has 16 supported locales:

Flag Code Name Native name
1 🇩🇰 da Danish Dansk
2 🇩🇪 de German Deutsch
3 🇺🇸 en English English
4 🇪🇸 es Spanish Español
5 🇮🇷 fa Farsi فارسی
6 🇫🇮 fi Finnish Suomi
7 🇫🇷 fr French Français
8 🇮🇸 is Icelandic Íslenska
9 🇮🇹 it Italian Italiano
10 🇳🇱 nl Dutch Nederlands
11 🇳🇴 no Norwegian Norsk
12 🇵🇱 pl Polish Polski
13 🇵🇹 pt Portuguese Português
14 🇧🇷 pt-br Brazilian Portuguese Português Brasileiro
15 🇷🇺 ru Russian Русский
16 🇸🇪 sv Swedish Svenska

Installation

~ pip install elizabeth

Testing

~ git clone https://github.com/lk-geimfari/elizabeth.git
➜  ~ cd elizabeth/
➜  ~ python3 -m unittest discover tests

Examples

How to generate user data:

from elizabeth import Personal

personal = Personal('en')

for _ in range(0, 15):
    print(personal.full_name(gender='female'))

Output:

Sixta Cantu
Antonetta Garrison
Caroll Mcgee
Helaine Mendoza
Taneka Dickerson
Jackelyn Stafford
Tashia Olsen
Reiko Lynn
Roberto Baxter
Rachal Hartman
Susann Hogan
Natashia Klein
Delora Conrad
Britteny Valdez
Sunni Strickland

For other locales, exactly the same way (Icelandic) :

personal = Personal('is')

for _ in range(0, 15):
    print(personal.full_name(gender='male'))

Output:

Karl Brynjúlfsson
Þórgrímur Garibaldason
Rögnvald Eiðsson
Zóphanías Bergfinnsson
Vésteinn Ríkharðsson
Friðleifur Granason
Fjarki Arngarðsson
Hafsteinn Þrymsson
Hallvarður Valgarðsson
Baltasar Hlégestsson
Sívar Kakalason
Sigurjón Tómasson
Grímnir Unason
Gýmir Þórðsson

How to work with datetime:

from elizabeth import Datetime

dt = Datetime('no') # Norwegian

for _ in range(0, 10):
    print(dt.birthday())

Output:

Mai 17, 1982
August 13, 1984
September 6, 1999
Februar 8, 1998
April 8, 1985
August 5, 1990
Mai 23, 1997
April 25, 1987
November 5, 1980
Mars 27, 1990

When you use only one locale you can use the Generic , that provides all providers at one class.

from elizabeth import Generic

g = Generic('ru')

for _ in range(0, 5):
    name = g.personal.full_name()
    birthday = g.datetime.birthday(readable=True)
    print(name, '-', birthday)

Output:

Гера Исакова - Май 31, 1981
Лидия Воронцова - Апрель 11, 1990
Пелагея Исаева - Август 7, 1983
Евфросинья Ермакова - Март 12, 1992
Веселина Зыкова - Октябрь 18, 1996

Data providers

Elizabeth support more than 18 data providers, such as Personal, Datetime, Internet and another.

Contributing

Your contributions are always welcome! Please take a look at the contribution guidelines first. Here you can look a list of contributors

Disclaimer

The author does not assume any responsibility for how you will use this library and how you will use data generated with this library. This library is designed only for developers and only with good intentions. Do not use the data generated with Elizabeth for illegal purposes.

Licence

Elizabeth is licensed under the MIT License. See LICENSE for the full license text.

elizabeth's People

Contributors

aminalaee avatar auyer avatar battleroid avatar bderusha avatar costava avatar crayxt avatar fliegendewurst avatar jeromechrist avatar lk-geimfari avatar martini97 avatar mrcrilly avatar offermann avatar ranwise avatar sambuddhabasu avatar sobolevn avatar yn-coder avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.