Skip to main content

mimesis_factory

Build Status Coverage PyPI version wemake-python-styleguide

Description

Mimesis integration for factory_boy.

Installation

➜  pip install mimesis_factory

Usage

Look at the example below and you’ll understand how it works:

class Account(object):
    def __init__(self, username, email, name, surname, age):
        self.username = username
        self.email = email
        self.name = name
        self.surname = surname
        self.age = age

Now, use the MimesisField class from mimesis_factory to define how fake data is generated:

import factory
from mimesis_factory import MimesisField

from account import Account


class AccountFactory(factory.Factory):
    class Meta(object):
        model = Account

    username = MimesisField('username', template='l_d')
    name = MimesisField('name', gender='female')
    surname = MimesisField('surname', gender='female')
    age = MimesisField('age', minimum=18, maximum=90)
    email = factory.LazyAttribute(
        lambda instance: '{0}@example.org'.format(instance.username)
    )
    access_token = MimesisField('token', entropy=32)

pytest

We also recommend to use pytest-factoryboy. This way it will be possible to integrate your factories into pytest fixtures.

License

mimesis_factory is released under the MIT License.

Metadata

Release files for mimesis-factory 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mimesis-factory 1.2.0
File Size Uploaded Provenance Actions
mimesis_factory-1.2.0.tar.gz 4.2 kB Without provenance Details for mimesis_factory-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mimesis-factory 1.2.0
File Interpreter ABI Platform Actions
mimesis_factory-1.2.0-py3-none-any.whl Python 3 none any Details for mimesis_factory-1.2.0-py3-none-any.whl

Total release size: 8.1 kB

Release files / mimesis_factory-1.2.0.tar.gz

Download URL mimesis_factory-1.2.0.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7fb05e85c3a9abd23f8cbc7f8ec43e26ccb703130f63b3f0ee609fd2a15aa0f1
BLAKE2b-256 checksum
How to use checksums
342e392b366d45ee16523f6e751a40f7e4050f19ab2c6a6572827d3baecb60f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.7.7 Darwin/18.7.0

Release files / mimesis_factory-1.2.0-py3-none-any.whl

Download URL mimesis_factory-1.2.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2905f2e90f0e7038877a1878e017bc6882ff46b4036e075e03677a63f16bb4cd
BLAKE2b-256 checksum
How to use checksums
c2b2120d930d60529f32402f617936f4bc3a4011125aa30abd208bab99bd89c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.10 CPython/3.7.7 Darwin/18.7.0

Security for mimesis-factory 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page