# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['fistro']

package_data = \
{'': ['*']}

setup_kwargs = {
    'name': 'fistro',
    'version': '0.3.0',
    'description': 'A fixture generator based on type annotations.',
    'long_description': 'Fistro\n======\n\n![pypi](https://img.shields.io/pypi/v/fistro)\n[![codecov](https://codecov.io/gh/headsrooms/fistro/branch/master/graph/badge.svg?token=7lhLh5bRD5)](https://codecov.io/gh/headsrooms/fistro)\n    \n\nA fixture generator based on type annotations.\n\nExamples\n--------\n\n```python\nfrom dataclasses import dataclass\nfrom datetime import datetime, date\nfrom typing import List\n\nfrom fistro.fistro import generate\n\n\n@dataclass\nclass Employee:\n   id: int\n   birthday: date\n   last_access: datetime\n   password: str\n   number_plates: List[int]\n   name: str = \'Carlos Sánchez\'\n\nemployee = generate(Employee)()\nprint(employee)\n ```\n\nIt will show something like this:\n\n```python\nEmployee(id=5809893100, birthday=datetime.date(559, 3, 6), last_access=datetime.datetime(1053, 8, 29, 19, 11, 14), password="iFZ>?)V0\'", number_plates=[85863115, 3528889142, 2818728907, 6043092538, 4985672707], name=\'Carlos Sánchez\')\n```\n\n\n`generate` function can be called with `to_json` or `to_dict`\nboolean pararameters to return json or dict\nrepresentation respectively:\n\n```python\nclass AreaOfCompany(BaseModel):                     \n    enable: bool                                    \n    riskOwner: str                                  \n    description: str                                \n    name: str                                       \n    code: str\n    \nprint(fistro.generate(AreaOfCompany, as_dict=True))\n```\n\n    >>> {\'enable\': True, \'riskOwner\': \'LqPqS\\x0c{kZ\', \'description\': \'k1917GvOV\', \'name\': \'`;ORxzQ7i\', \'code\': \'w2 |P\\rEps\'}\n\n```python\nprint(fistro.generate(AreaOfCompany, as_json=True))\n```\n\n    >>> {"enable": true, "riskOwner": "h@Ij34u?H", "description": ",R,G%0<y#", "name": "K4.\\u000b:lK!}", "code": "fvitVYrk3"}\n\nAnother useful functions are `generate_from_json` and `get_class_body_from_annotations`:\n\n```python\nfrom json import loads\n\nfrom fistro.fistro import generate_from_json, get_class_body_from_annotations\n\nspecific_str = """{\n            "_id": "5ae09b3947467b00111e7bf6",\n            "localExposure": 0,\n            "answer": "mitigate",\n            "idRisk": "5ae09b3947467b00111e7bf6",\n            "version": 4,\n            "country": "BR",\n            "company": "0185",\n            "currency": "BRL",\n            "zone": "DIRT8",\n            "internalRef": "RSP-BR-0185-DIRT8-105",\n            "creationDate": "2017-12-13T23:00:00.000Z",\n            "title": "Tributário: Contribuições Previdenciárias sobre Plano de Stock Options",\n            "riskCategory": {\n                "es": "22. Contingencias tributarias",\n                "en": "22. Tax contingencies",\n                "pt": "22. Contingências Fiscais"\n            },\n            "evaluationType": "quantitative",\n            "basicRef": "26376309-2cc2-4a0d-9c6a-373e0a7d9043",\n            "localQUANTITATIVENetCASHFLOW": 0,\n            "euroQUANTITATIVENetCASHFLOW": 0,\n            "localQUANTITATIVEGrossCASHFLOW": 241000000,\n            "euroQUANTITATIVEGrossCASHFLOW": 57324742,\n            "probability": "veryPossible",\n            "status": "open",\n            "commissionApproval": false,\n            "companyRegistry": true,\n            "companyCode": "0185",\n            "IDNotification": "0aa0370e-e6d6-405c-a619-a47da0602dee",\n            "localQUANTITATIVEGrossOIBDA": 241000000,\n            "localQUANTITATIVEGrossCAPEX": 0,\n            "localQUANTITATIVENetOIBDA": 0,\n            "localQUANTITATIVENetCAPEX": 0,\n            "euroQUANTITATIVEGrossOIBDA": 57324742,\n            "euroQUANTITATIVEGrossCAPEX": 0,\n            "euroQUANTITATIVENetOIBDA": 0,\n            "euroQUANTITATIVENetCAPEX": 0,\n            "hierarchy": "principal",\n            "hierarchySubsidiaries": [],\n            "owner": "Vasco Gruber"\n        }"""\n\nspecific_json = loads(specific_str)\n\nthe_class = generate_from_json(specific_json)\nprint(get_class_body_from_annotations(the_class.__annotations__))\n```\n\n\nIt will print:\n\n```python\n_id: str\nlocalExposure: int\nanswer: str\nidRisk: str\nversion: int\ncountry: str\ncompany: str\ncurrency: str\nzone: str\ninternalRef: str\ncreationDate: str\ntitle: str\nriskCategory: typing.Dict[str, str]\nevaluationType: str\nbasicRef: str\nlocalQUANTITATIVENetCASHFLOW: int\neuroQUANTITATIVENetCASHFLOW: int\nlocalQUANTITATIVEGrossCASHFLOW: int\neuroQUANTITATIVEGrossCASHFLOW: int\nprobability: str\nstatus: str\ncommissionApproval: bool\ncompanyRegistry: bool\ncompanyCode: str\nIDNotification: str\nlocalQUANTITATIVEGrossOIBDA: int\nlocalQUANTITATIVEGrossCAPEX: int\nlocalQUANTITATIVENetOIBDA: int\nlocalQUANTITATIVENetCAPEX: int\neuroQUANTITATIVEGrossOIBDA: int\neuroQUANTITATIVEGrossCAPEX: int\neuroQUANTITATIVENetOIBDA: int\neuroQUANTITATIVENetCAPEX: int\nhierarchy: str\nhierarchySubsidiaries: typing.List[typing.Any]\nowner: str\n```\n\n\nInstallation\n------------\n\n    pip install fistro\n\n\nCredits\n--------\nIn memoriam of [Chiquito de la Calzada](https://es.wikipedia.org/wiki/Chiquito_de_la_Calzada).\n',
    'author': 'Pablo Cabezas',
    'author_email': 'headsrooms@gmail.com',
    'maintainer': None,
    'maintainer_email': None,
    'url': 'https://github.com/headsrooms/fistro',
    'packages': packages,
    'package_data': package_data,
    'python_requires': '>=3.10,<4.0',
}


setup(**setup_kwargs)
