Dataclass Bakery
================
Dataclass Bakery offers you a smart way to create objects based on dataclasses for testing in Python.
Inspired in model bakery module for Django.
Install
~~~~~~~
``pip install dataclass_bakery``
Usage and Info
~~~~~~~~~~~~~~
Basic usage
^^^^^^^^^^^
::
from dataclasses import dataclass
from dataclass_bakery import baker
@dataclass
class Customer:
id: int
name: str
spent_money: float
baker.make(Customer)
baker.make(Customer, _quantity=3)
"""
Customer(id=25, name='vzWoIfgoZM', spent_money=16.36)
[Customer(id=27, name='OYvyWakmUX', spent_money=84.98), Customer(id=41, name='AiancdsmLg', spent_money=57.57), Customer(id=92, name='feTxLyuSus', spent_money=26.06)]
"""
For more information: https://dataclass-bakery.readthedocs.io/
Types available:
^^^^^^^^^^^^^^^^
- int
- str
- float
- bool
- complex
- range
- list
- tuple
- dict
- set
- List (from typing import List)
- Tuple (from typing import Tuple)
- Dict (from typing import Dict)
- Union (from typing import Union)
- Optional (from typing import Optional)
- Path (from pathlib import Path)
- Decimal (from decimal import Decimal)
- UUID (from uuid import UUID)
Raw data
{
"_id": null,
"home_page": "https://github.com/miguelFLG13/dataclass-bakery",
"name": "dataclass-bakery",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "testing dataclass bakery",
"author": "Miguel Jim\u00e9nez",
"author_email": "miguelflg13@gmx.com",
"download_url": "https://files.pythonhosted.org/packages/40/db/aaee5df9c3b593553e22277adabe4288b37b5197376e3f720c92d187d61a/dataclass-bakery-0.0.7.tar.gz",
"platform": null,
"description": "Dataclass Bakery\n================\n\nDataclass Bakery offers you a smart way to create objects based on dataclasses for testing in Python.\nInspired in model bakery module for Django.\n\nInstall\n~~~~~~~\n\n``pip install dataclass_bakery``\n\nUsage and Info\n~~~~~~~~~~~~~~\n\nBasic usage\n^^^^^^^^^^^\n\n::\n\n from dataclasses import dataclass\n\n from dataclass_bakery import baker\n\n\n @dataclass\n class Customer:\n id: int\n name: str\n spent_money: float\n \n \n baker.make(Customer)\n baker.make(Customer, _quantity=3)\n\n \"\"\"\n Customer(id=25, name='vzWoIfgoZM', spent_money=16.36)\n\n [Customer(id=27, name='OYvyWakmUX', spent_money=84.98), Customer(id=41, name='AiancdsmLg', spent_money=57.57), Customer(id=92, name='feTxLyuSus', spent_money=26.06)]\n \"\"\"\n\nFor more information: https://dataclass-bakery.readthedocs.io/\n\nTypes available:\n^^^^^^^^^^^^^^^^\n\n- int\n- str\n- float\n- bool\n- complex\n- range\n- list\n- tuple\n- dict\n- set\n- List (from typing import List)\n- Tuple (from typing import Tuple)\n- Dict (from typing import Dict)\n- Union (from typing import Union)\n- Optional (from typing import Optional)\n- Path (from pathlib import Path)\n- Decimal (from decimal import Decimal)\n- UUID (from uuid import UUID)\n\n\n\n",
"bugtrack_url": null,
"license": "",
"summary": "Dataclass Bakery offers you a smart way to create objects based on dataclasses for testing in Python",
"version": "0.0.7",
"project_urls": {
"Download": "https://github.com/miguelFLG13/dataclass-bakery/tarball/0.0.7",
"Homepage": "https://github.com/miguelFLG13/dataclass-bakery"
},
"split_keywords": [
"testing",
"dataclass",
"bakery"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "534b291d3194e519f396bdd59d39d105347c497fd86ca6943900d2889feb898a",
"md5": "f7e3a2aa07190bdd27fc323a8367bd6f",
"sha256": "1e3c05d791e67b68469fa23daa709c75f4656ca43d97619d671cdba8c83a445c"
},
"downloads": -1,
"filename": "dataclass_bakery-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f7e3a2aa07190bdd27fc323a8367bd6f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 30129,
"upload_time": "2024-02-22T12:39:20",
"upload_time_iso_8601": "2024-02-22T12:39:20.122505Z",
"url": "https://files.pythonhosted.org/packages/53/4b/291d3194e519f396bdd59d39d105347c497fd86ca6943900d2889feb898a/dataclass_bakery-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "40dbaaee5df9c3b593553e22277adabe4288b37b5197376e3f720c92d187d61a",
"md5": "74ac73e8e9734a42c623240b815b595b",
"sha256": "de776bee47ce4de208b929b1fdb38b275d90340d4cc3dde0a99cf8ed12bb57a3"
},
"downloads": -1,
"filename": "dataclass-bakery-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "74ac73e8e9734a42c623240b815b595b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 15368,
"upload_time": "2024-02-22T12:40:13",
"upload_time_iso_8601": "2024-02-22T12:40:13.716795Z",
"url": "https://files.pythonhosted.org/packages/40/db/aaee5df9c3b593553e22277adabe4288b37b5197376e3f720c92d187d61a/dataclass-bakery-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 12:40:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "miguelFLG13",
"github_project": "dataclass-bakery",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "dataclass-bakery"
}