Metadata-Version: 2.1
Name: grpcalchemy
Version: 0.2.0.post0
Summary: The Python micro framework for building gPRC application.
Home-page: https://github.com/GuangTianLi/grpcalchemy
Author: GuangTian Li
Author-email: guangtian_li@qq.com
License: MIT license
Keywords: grpcalchemy
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Requires-Python: >=3.6.0
Requires-Dist: grpcio
Requires-Dist: protobuf
Requires-Dist: grpcio-tools
Requires-Dist: jinja2

===========
gRPCAlchemy
===========


.. image:: https://img.shields.io/pypi/v/grpcalchemy.svg
        :target: https://pypi.python.org/pypi/grpcalchemy

.. image:: https://img.shields.io/travis/GuangTianLi/grpcalchemy.svg
        :target: https://travis-ci.org/GuangTianLi/grpcalchemy

.. image:: https://readthedocs.org/projects/grpcalchemy/badge/?version=latest
        :target: https://grpcalchemy.readthedocs.io/en/latest/?badge=latest
        :alt: Documentation Status

.. image:: https://img.shields.io/pypi/pyversions/grpcalchemy.svg
        :target: https://pypi.org/project/grpcalchemy/




The Python micro framework for building gPRC application.


* Free software: MIT license
* Documentation: https://grpcalchemy.readthedocs.io.

Installation
----------------

 | Disclaimer: Still at an early stage of development. Rapidly evolving APIs.

.. code-block:: shell

    $ pipenv install grpcalchemy
    ✨🍰✨

Only **Python 3.6+** is supported.

Example
--------

Server
========

.. code-block:: python

    from grpcalchemy.orm import Message, StringField
    from grpcalchemy import Server, Context

    app = Server('server')

    class HelloMessage(Message):
        __filename__ = 'hello'
        text = StringField()

    @app.register
    def test(request: HelloMessage, context: Context) -> HelloMessage:
        return HelloMessage(text=f"Hello {request.text}")

    if __name__ == '__main__':
        app.run()

Client
========

.. code-block:: python

    from grpcalchemy import Server, Context
    from grpcalchemy.orm import Message, StringField


    class HelloMessage(Message):
        __filename__ = 'hello'
        text = StringField()


    hello = Server("hello")


    @hello.register
    def test(request: HelloMessage, context: Context) -> HelloMessage:
        return HelloMessage(text=f"Hello {request.text}")


    if __name__ == '__main__':
        with Client("localhost:50051") as client:
            client.register(hello)
            response: HelloMessage = client.hello(
                rpc=test, message=HelloMessage(text="world"))
            print(response.text)  # Hello world

Features
----------

* gPRC Service Support
* gRPC Client Support
* gRPC Message Support
    * Scalar Value Types
    * Message Types
    * Repeated Field
    * Maps
* Middleware And Listeners


TODO
-------

* All Types Support

Credits
---------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.2.0 (2019)
------------------

* Change gRPCAlchemy Server register to register_blueprint
* Make gRPCAlchemy Server inherit from Blueprint
* Support Json Format
* Support Inheritance Message

0.1.6 (2019-01-21)
------------------

* Various bug-fixes
* Improve tests
* Change Client API
* Add PreProcess And PostProcess
* Import Config Object
* Add Event Listener
* Change Field Object Into Descriptor

0.1.5 (2018-12-14)
------------------

* Various bug-fixes
* Improve tests
* Add client

0.1.4 (2018-12-11)
------------------

* First release on PyPI.


