{ "info": { "author": "Aleksei Maslakov", "author_email": "lesha.maslakov@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Software Development :: Code Generators" ], "description": "========\nOverview\n========\n\n.. start-badges\n\n.. image:: https://travis-ci.org/unmade/thrift-pyi.svg?branch=master\n :alt: Travis-CI Build Status\n :target: https://travis-ci.org/unmade/thrift-pyi\n\n.. image:: https://codecov.io/github/unmade/thrift-pyi/coverage.svg?branch=master\n :alt: Coverage Status\n :target: https://codecov.io/github/unmade/thrift-pyi\n\n.. image:: https://api.codacy.com/project/badge/Grade/487480f045594e148309e8b7f1f71351\n :alt: Codacy Badge\n :target: https://app.codacy.com/app/unmade/thrift-pyi\n\n.. image:: https://requires.io/github/unmade/thrift-pyi/requirements.svg?branch=master\n :alt: Requirements Status\n :target: https://requires.io/github/unmade/thrift-pyi/requirements/?branch=master\n\n.. image:: https://img.shields.io/pypi/v/thrift-pyi.svg\n :alt: PyPI Package latest release\n :target: https://pypi.org/project/thrift-pyi\n\n.. image:: https://img.shields.io/pypi/wheel/thrift-pyi.svg\n :alt: PyPI Wheel\n :target: https://pypi.org/project/thrift-pyi\n\n.. image:: https://img.shields.io/pypi/pyversions/thrift-pyi.svg\n :alt: Supported versions\n :target: https://pypi.org/project/thrift-pyi\n\n.. image:: https://img.shields.io/badge/License-MIT-purple.svg\n :alt: MIT License\n :target: https://github.com/unmade/thrift-pyi/blob/master/LICENSE\n\n.. end-badges\n\nThis is simple `.pyi` stubs generator from thrift interfaces.\nMotivation for this project is to have autocomplete and type checking\nfor dynamically loaded thrift interfaces\n\nInstallation\n============\n\n.. code-block:: bash\n\n pip install thrift-pyi\n\nQuickstart\n==========\n\nSample usage:\n\n.. code-block:: bash\n\n $ thriftpyi example/interfaces --output example/app/interfaces\n\nAdditionally to generated stubs you might want to create `__init__.py` that will load thrift interfaces, for example:\n\n.. code-block:: python\n\n from pathlib import Path\n from types import ModuleType\n from typing import Dict\n\n import thriftpy2\n\n _interfaces_path = Path(\"example/interfaces\")\n _interfaces: Dict[str, ModuleType] = {}\n\n\n def __getattr__(name):\n try:\n return _interfaces[name]\n except KeyError:\n interface = thriftpy2.load(str(_interfaces_path.joinpath(f\"{name}.thrift\")))\n _interfaces[name] = interface\n return interface\n\n\nTo see more detailed example of usage refer to `example app `_\n\n--strict-optional\n-----------------\n\nPython and thrift are very different at argument handling.\nFor example in thrift the following will be correct declaration:\n\n.. code-block:: thrift\n\n struct TodoItem {\n 1: required i32 id\n 3: optional i32 type = 1\n 2: required string text\n }\n\nIn python attributes without a default cannot follow attributes with one.\nTherefore by default all fields are optional with default to None. This is compliant\nto `thriftpy2 `_.\n\nHowever, if you want more strict behaviour you can specify `--strict-optional` option.\nFor the case above, the following stubs will be generated:\n\n.. code-block:: python\n\n from dataclasses import dataclass\n\n @dataclass\n class TodoItem:\n id: int\n type: int = 1\n text: str\n\nDevelopment\n===========\n\nTo install pre-commit hooks::\n\n pre-commit install\n\nTo run the all tests run::\n\n tox\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/unmade/thrift-pyi", "keywords": "", "license": "MIT", "maintainer": "Aleksei Maslakov", "maintainer_email": "lesha.maslakov@gmail.com", "name": "thrift-pyi", "package_url": "https://pypi.org/project/thrift-pyi/", "platform": "", "project_url": "https://pypi.org/project/thrift-pyi/", "project_urls": { "Homepage": "https://github.com/unmade/thrift-pyi", "Repository": "https://github.com/unmade/thrift-pyi" }, "release_url": "https://pypi.org/project/thrift-pyi/0.1.0/", "requires_dist": [ "click (>=7.0,<8.0)", "jinja2 (>=2.10,<3.0)", "black (>=19.3b0,<20.0)", "thriftpy2 (>=0.4.2,<0.5.0)", "autoflake (>=1.3,<2.0)" ], "requires_python": ">=3.7,<4.0", "summary": "This is simple `.pyi` stubs generator from thrift interfaces", "version": "0.1.0" }, "last_serial": 5328847, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d433027ecd15395388b05b7973ab48bb", "sha256": "98468c8545b5a87aa33c3cb451a8dc04b45dfb99c40979fbe54748343c65ece1" }, "downloads": -1, "filename": "thrift_pyi-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d433027ecd15395388b05b7973ab48bb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 9557, "upload_time": "2019-05-28T20:15:44", "url": "https://files.pythonhosted.org/packages/30/57/cc3e7463e5fdeba2be9cec83c26638eafc977ec479b74c3bb4d13f3f9b30/thrift_pyi-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5bcbd69184ad1881d26a51828cf2fc36", "sha256": "86c031681a9a2c317ac73e2903b7dabd7712c2c10fa2ece656690b097e0412e5" }, "downloads": -1, "filename": "thrift-pyi-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5bcbd69184ad1881d26a51828cf2fc36", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 8467, "upload_time": "2019-05-28T20:15:42", "url": "https://files.pythonhosted.org/packages/dc/98/7b34c51e2d0a628651a609ea94a3d091672ee47c52e26de59ca4067e9d18/thrift-pyi-0.1.0.tar.gz" } ], "0.1.0b1": [ { "comment_text": "", "digests": { "md5": "5dfc3577acfeb0879f6812c798df1f66", "sha256": "b7df799644aa5fd1cb67d2b64d3617b831dc24e4150cba1eaa5f8182707d2c53" }, "downloads": -1, "filename": "thrift_pyi-0.1.0b1-py3-none-any.whl", "has_sig": false, "md5_digest": "5dfc3577acfeb0879f6812c798df1f66", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 9119, "upload_time": "2019-05-23T17:35:51", "url": "https://files.pythonhosted.org/packages/18/fd/bba55c133078e9bdca9db7dfd9e1b0bc143c4087bb3ced16e0d37afffdf1/thrift_pyi-0.1.0b1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5bb25b7372a058b40cb1892c74bae5d3", "sha256": "eff3972c38e34c185cd1c40997cbf66490b12d4923055598ce14930105aef19c" }, "downloads": -1, "filename": "thrift-pyi-0.1.0b1.tar.gz", "has_sig": false, "md5_digest": "5bb25b7372a058b40cb1892c74bae5d3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 8180, "upload_time": "2019-05-23T17:35:49", "url": "https://files.pythonhosted.org/packages/83/02/251e97a5ebf29bdfad80f04f14cc426c9f4e23cd6e555effa3f231fa4070/thrift-pyi-0.1.0b1.tar.gz" } ], "0.1.0b2": [ { "comment_text": "", "digests": { "md5": "d5050af326f1081427bf189f9c895316", "sha256": "5450b4b7e02cabc523f0bde417fde1e27a8164cbaabeacad8378198025aeb579" }, "downloads": -1, "filename": "thrift_pyi-0.1.0b2-py3-none-any.whl", "has_sig": false, "md5_digest": "d5050af326f1081427bf189f9c895316", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 9118, "upload_time": "2019-05-23T17:53:22", "url": "https://files.pythonhosted.org/packages/de/8c/f0d0d158be8070d96c3b12aa486fb38d2e8ba45d00b69376a27283287554/thrift_pyi-0.1.0b2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9e6300d3bd4dbd5bc6a1c848bfb6580d", "sha256": "532cfdc72eccd66ad63841103e45531058ff4c3efedd7548d83cbddbce921585" }, "downloads": -1, "filename": "thrift-pyi-0.1.0b2.tar.gz", "has_sig": false, "md5_digest": "9e6300d3bd4dbd5bc6a1c848bfb6580d", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 8178, "upload_time": "2019-05-23T17:53:21", "url": "https://files.pythonhosted.org/packages/28/4e/d81115589fc15660f9b6965f768d6b0d926fd51fbf099c9388a458a5e7fe/thrift-pyi-0.1.0b2.tar.gz" } ], "0.1.0b3": [ { "comment_text": "", "digests": { "md5": "875fffcfbb927f72a9fde5eea05d1fa6", "sha256": "66c36858146e8563dad8aeb23f9a604d35b07f00247f7bf4a26d2bdbacc447be" }, "downloads": -1, "filename": "thrift_pyi-0.1.0b3-py3-none-any.whl", "has_sig": false, "md5_digest": "875fffcfbb927f72a9fde5eea05d1fa6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 9339, "upload_time": "2019-05-25T12:20:29", "url": "https://files.pythonhosted.org/packages/8d/d8/98d4cf3cb47b5f0214071e225bbb28c9712af2c744290628204ff7bd4311/thrift_pyi-0.1.0b3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "33eb4fdc08fdc3714eb97584ab414d01", "sha256": "29466945bc5f109fa222277b0f512e5c9a704806f1a376188687b53d15027b1f" }, "downloads": -1, "filename": "thrift-pyi-0.1.0b3.tar.gz", "has_sig": false, "md5_digest": "33eb4fdc08fdc3714eb97584ab414d01", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 8153, "upload_time": "2019-05-25T12:20:27", "url": "https://files.pythonhosted.org/packages/e1/d9/ed5dc580a38ffb1ccf8ce4b85d7ad4eb2386097115ead2a7c46e1eeea3ad/thrift-pyi-0.1.0b3.tar.gz" } ], "0.1.0b4": [ { "comment_text": "", "digests": { "md5": "2b8f70b3f5444d1db82f312b05f664d4", "sha256": "73ecb9c338cd64202710845fbb79280c07c3aa90ac50fb954624f3b6f3512521" }, "downloads": -1, "filename": "thrift_pyi-0.1.0b4-py3-none-any.whl", "has_sig": false, "md5_digest": "2b8f70b3f5444d1db82f312b05f664d4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 9580, "upload_time": "2019-05-28T06:59:40", "url": "https://files.pythonhosted.org/packages/af/f3/38e6b884bfe2103fd6ad6e393ea28d458504b70c144c13fcf25e366d5976/thrift_pyi-0.1.0b4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "03078ae2b09633757ba5d16e5fa66611", "sha256": "0bf98980e850e7685e434a40eae03e2566fdaea5cd488af8c95dc8f2fe6e605a" }, "downloads": -1, "filename": "thrift-pyi-0.1.0b4.tar.gz", "has_sig": false, "md5_digest": "03078ae2b09633757ba5d16e5fa66611", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 8480, "upload_time": "2019-05-28T06:59:38", "url": "https://files.pythonhosted.org/packages/dc/fd/532555f407fad8cda18f6b41abf9acf45fa4e108c1f7142713b8f7d5252d/thrift-pyi-0.1.0b4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "d433027ecd15395388b05b7973ab48bb", "sha256": "98468c8545b5a87aa33c3cb451a8dc04b45dfb99c40979fbe54748343c65ece1" }, "downloads": -1, "filename": "thrift_pyi-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "d433027ecd15395388b05b7973ab48bb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.7,<4.0", "size": 9557, "upload_time": "2019-05-28T20:15:44", "url": "https://files.pythonhosted.org/packages/30/57/cc3e7463e5fdeba2be9cec83c26638eafc977ec479b74c3bb4d13f3f9b30/thrift_pyi-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5bcbd69184ad1881d26a51828cf2fc36", "sha256": "86c031681a9a2c317ac73e2903b7dabd7712c2c10fa2ece656690b097e0412e5" }, "downloads": -1, "filename": "thrift-pyi-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5bcbd69184ad1881d26a51828cf2fc36", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.7,<4.0", "size": 8467, "upload_time": "2019-05-28T20:15:42", "url": "https://files.pythonhosted.org/packages/dc/98/7b34c51e2d0a628651a609ea94a3d091672ee47c52e26de59ca4067e9d18/thrift-pyi-0.1.0.tar.gz" } ] }