<commit_before>Sample Data
===========

.. image:: https://travis-ci.org/jespino/sampledata.png?branch=master
    :target: https://travis-ci.org/jespino/sampledata

.. image:: https://coveralls.io/repos/jespino/sampledata/badge.png?branch=master
    :target: https://coveralls.io/r/jespino/sampledata?branch=master

.. image:: https://pypip.in/v/sampledata/badge.png
    :target: https://crate.io/packages/sampledata

.. image:: https://pypip.in/d/sampledata/badge.png
    :target: https://crate.io/packages/sampledata

App to automatically populate django database.

Install
=======

Install using pip, including any pillow if you want image genetion...:

.. code:: bash

  pip install sampledata
  pip install pillow  # For image generation


Quick start
===========

You can build any kind of object using the :code:`SampleData` class.

.. code:: python
  def generate_random_users(instances):
      sd = SampleData(seed=123)

      users = []
      for x in range(instances):
          data = {
              "slug": sd.slug(2, 3),
              "name": sd.name(2, 3),
              "claim": sd.sentence(),
              "description": sd.paragraph(),
              "email": sd.email(),
              "photo": sd.image_stream(64, 64),
              "is_active": sd.boolean(),
              "birth_date": sd.past_date(),
              "expected_death_date": sd.future_date(),
          }
          users.append(instance)
      return users


Documentation<commit_msg>Fixed readme example<commit_after>Sample Data
===========

.. image:: https://travis-ci.org/jespino/sampledata.png?branch=master
    :target: https://travis-ci.org/jespino/sampledata

.. image:: https://coveralls.io/repos/jespino/sampledata/badge.png?branch=master
    :target: https://coveralls.io/r/jespino/sampledata?branch=master

.. image:: https://pypip.in/v/sampledata/badge.png
    :target: https://crate.io/packages/sampledata

.. image:: https://pypip.in/d/sampledata/badge.png
    :target: https://crate.io/packages/sampledata

App to automatically populate django database.

Install
=======

Install using pip, including any pillow if you want image genetion...:

.. code:: bash

  pip install sampledata
  pip install pillow  # For image generation


Quick start
===========

You can build any kind of object using the :code:`SampleData` class.

.. code:: python

  def generate_random_users(instances):
      sd = SampleData(seed=123)

      users = []
      for x in range(instances):
          data = {
              "slug": sd.slug(2, 3),
              "name": sd.name(2, 3),
              "claim": sd.sentence(),
              "description": sd.paragraph(),
              "email": sd.email(),
              "photo": sd.image_stream(64, 64),
              "is_active": sd.boolean(),
              "birth_date": sd.past_date(),
              "expected_death_date": sd.future_date(),
          }
          users.append(instance)
      return users


Documentation
{'fraction_non_alphanumeric': 0.15332428765264586, 'fraction_numerical': 0.007462686567164179, 'mean_word_length': 2.5875912408759123, 'pattern_counts': {'":': 18, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6829262', 'n_tokens_mistral': 943, 'n_tokens_neox': 909, 'n_words': 195}