pyfrpc


Namepyfrpc JSON
Version 0.2.10 PyPI version JSON
download
home_pageNone
SummaryPython implementation of fastrpc protocol
upload_time2024-05-17 13:50:11
maintainerNone
docs_urlNone
authorVladimir Burian
requires_pythonNone
licenseNone
keywords frpc fastrpc
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pyfrpc

Pyfrpc is a Python implementation of FastRPC protocol/library (
[@github](https://seznam.github.io/frpc/) or
[@sourceforge](http://fastrpc.sourceforge.net/)
). The original library contains Python bindings, but:

1. I prefer python packages without dependencies on debian packages.
2. Its flexibility is limited in some points. E.g. the library provides its own 
implementation of HTTP server and client, which is nice to have in C++, but not 
in Python I would say as there are already full-featured and more mature 
libraries available for those tasks.
3. In my opinion it's not worth to wrap such a library for python anyway (at 
least not from today's perspective). The original binding itself is 3500 lines 
of code. So this is an alternative aproach.
4. And I want to use it as a showcase for cython as well.

This library provides FastRPC encoding/decoding functions, FastRPC client 
(based on 'requests') and an interactive FastRPC client/terminal 'pyfrpc' (an 
alternative to 'fastrpc-netcat' based on 'IPython'). API mostly differs and is 
not meant to be a drop-in replacement.

It is compatible with protocol versions 1.0, 2.0, 2.1 and 3.0.

Package provides both cython (C extencion) and pure python implementations. 
Cython implementation is faster but requires C toolchain (or available python 
wheels). To use pure python implementation set env variable `PYFRPC_NOEXT=1` 
during installation.

Some features missing are:

- handling of base64 encoded FastRPC
- helper to build a server


## Interactive client

Interactive client opens na ipython session with varible `client` initialized to 
FastFRPC connection. It supports tab-based completion of remote procedures' 
names as well as shownig their documentation using question mark notation as is 
usual in ipython.

```
$ pyfrpc --help

usage: pyfrpc [-h] [--insecure] URL

FRPC netcat for interactive connection to FRPC server

positional arguments:
  URL         URL of FRPC server to connect to

optional arguments:
  -h, --help  show this help message and exit
  --insecure  Do not check server's cert
```

```
$ pyfrpc http://my-avesome-server

In [1]: client.greeting?
...
Docstring:   Prints greeting.

In [2]: client.greeting()
Out[2]: 
'hello from server'
```


## Benchmark

2020-12-02, Python3.7 @ debian buster:
```
+------------------------+----------+----------+----------+
| description            | encoding | decoding | total    |
+------------------------+----------+----------+----------+
| pyfrpc                 |    1.6ms |    3.6ms |    5.3ms |
| ujson                  |    5.1ms |    4.7ms |    9.9ms |
| fastrpc                |    3.2ms |    7.0ms |   10.2ms |
| json                   |    7.0ms |    5.2ms |   12.3ms |
| pyfastrpc              |   59.2ms |   77.2ms |  136.3ms |
+------------------------+----------+----------+----------+
```

2017-12-29, benchmarks during library development:
```
+------------------------+----------+----------+----------+
| description            | encoding | decoding | total    |
+========================+==========+==========+==========+
| fastrpc (original lib) |   1.7 ms |   5.7 ms |   7.5 ms |
+------------------------+----------+----------+----------+
| python                 |  35.1 ms |  25.8 ms |  60.8 ms |
+------------------------+----------+----------+----------+
| pypy                   |  12.6 ms |   5.2 ms |  17.8 ms |
+------------------------+----------+----------+----------+
| cython (naive)         |  17.9 ms |  43.1 ms |  61.0 ms |
| cython (cdef)          |  11.9 ms |  22.6 ms |  34.4 ms |
| cython (static typing) |   2.2 ms |   3.7 ms |   5.9 ms |
| cython (low level api) |   1.3 ms |   3.7 ms |   4.9 ms |
+------------------------+----------+----------+----------+
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "pyfrpc",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "frpc, fastrpc",
    "author": "Vladimir Burian",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/99/ae/df9051d4eadb805636472b39cfbe250a14892abbe845eb286c5e49508125/pyfrpc-0.2.10.tar.gz",
    "platform": null,
    "description": "# Pyfrpc\n\nPyfrpc is a Python implementation of FastRPC protocol/library (\n[@github](https://seznam.github.io/frpc/) or\n[@sourceforge](http://fastrpc.sourceforge.net/)\n). The original library contains Python bindings, but:\n\n1. I prefer python packages without dependencies on debian packages.\n2. Its flexibility is limited in some points. E.g. the library provides its own \nimplementation of HTTP server and client, which is nice to have in C++, but not \nin Python I would say as there are already full-featured and more mature \nlibraries available for those tasks.\n3. In my opinion it's not worth to wrap such a library for python anyway (at \nleast not from today's perspective). The original binding itself is 3500 lines \nof code. So this is an alternative aproach.\n4. And I want to use it as a showcase for cython as well.\n\nThis library provides FastRPC encoding/decoding functions, FastRPC client \n(based on 'requests') and an interactive FastRPC client/terminal 'pyfrpc' (an \nalternative to 'fastrpc-netcat' based on 'IPython'). API mostly differs and is \nnot meant to be a drop-in replacement.\n\nIt is compatible with protocol versions 1.0, 2.0, 2.1 and 3.0.\n\nPackage provides both cython (C extencion) and pure python implementations. \nCython implementation is faster but requires C toolchain (or available python \nwheels). To use pure python implementation set env variable `PYFRPC_NOEXT=1` \nduring installation.\n\nSome features missing are:\n\n- handling of base64 encoded FastRPC\n- helper to build a server\n\n\n## Interactive client\n\nInteractive client opens na ipython session with varible `client` initialized to \nFastFRPC connection. It supports tab-based completion of remote procedures' \nnames as well as shownig their documentation using question mark notation as is \nusual in ipython.\n\n```\n$ pyfrpc --help\n\nusage: pyfrpc [-h] [--insecure] URL\n\nFRPC netcat for interactive connection to FRPC server\n\npositional arguments:\n  URL         URL of FRPC server to connect to\n\noptional arguments:\n  -h, --help  show this help message and exit\n  --insecure  Do not check server's cert\n```\n\n```\n$ pyfrpc http://my-avesome-server\n\nIn [1]: client.greeting?\n...\nDocstring:   Prints greeting.\n\nIn [2]: client.greeting()\nOut[2]: \n'hello from server'\n```\n\n\n## Benchmark\n\n2020-12-02, Python3.7 @ debian buster:\n```\n+------------------------+----------+----------+----------+\n| description            | encoding | decoding | total    |\n+------------------------+----------+----------+----------+\n| pyfrpc                 |    1.6ms |    3.6ms |    5.3ms |\n| ujson                  |    5.1ms |    4.7ms |    9.9ms |\n| fastrpc                |    3.2ms |    7.0ms |   10.2ms |\n| json                   |    7.0ms |    5.2ms |   12.3ms |\n| pyfastrpc              |   59.2ms |   77.2ms |  136.3ms |\n+------------------------+----------+----------+----------+\n```\n\n2017-12-29, benchmarks during library development:\n```\n+------------------------+----------+----------+----------+\n| description            | encoding | decoding | total    |\n+========================+==========+==========+==========+\n| fastrpc (original lib) |   1.7 ms |   5.7 ms |   7.5 ms |\n+------------------------+----------+----------+----------+\n| python                 |  35.1 ms |  25.8 ms |  60.8 ms |\n+------------------------+----------+----------+----------+\n| pypy                   |  12.6 ms |   5.2 ms |  17.8 ms |\n+------------------------+----------+----------+----------+\n| cython (naive)         |  17.9 ms |  43.1 ms |  61.0 ms |\n| cython (cdef)          |  11.9 ms |  22.6 ms |  34.4 ms |\n| cython (static typing) |   2.2 ms |   3.7 ms |   5.9 ms |\n| cython (low level api) |   1.3 ms |   3.7 ms |   4.9 ms |\n+------------------------+----------+----------+----------+\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python implementation of fastrpc protocol",
    "version": "0.2.10",
    "project_urls": {
        "Homepage": "https://gitlab.com/vladaburian/pyfrpc"
    },
    "split_keywords": [
        "frpc",
        " fastrpc"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7cdeb79329bdff7fb297729c88fbd0f017b1f65a192da2454b7a060647074793",
                "md5": "f131259adad672960cc99b3c6e8e96d7",
                "sha256": "8b743abf2a5e5ae7dc52a7b3e8b887069f0e9da2fb97c24b4cb491ed63159572"
            },
            "downloads": -1,
            "filename": "pyfrpc-0.2.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f131259adad672960cc99b3c6e8e96d7",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": null,
            "size": 290215,
            "upload_time": "2024-05-17T13:50:00",
            "upload_time_iso_8601": "2024-05-17T13:50:00.717180Z",
            "url": "https://files.pythonhosted.org/packages/7c/de/b79329bdff7fb297729c88fbd0f017b1f65a192da2454b7a060647074793/pyfrpc-0.2.10-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d9e447d43d7e333b45694955b19bc737daa543486470733d0d1ff4e24cb6fd68",
                "md5": "6813a0059d76c074744d0506b38f3fdf",
                "sha256": "c2a931f7081733df3c7d7d6a9c3f520ad9a03368166ad1d80e22a1d3bee95919"
            },
            "downloads": -1,
            "filename": "pyfrpc-0.2.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "6813a0059d76c074744d0506b38f3fdf",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": null,
            "size": 306147,
            "upload_time": "2024-05-17T13:50:03",
            "upload_time_iso_8601": "2024-05-17T13:50:03.363971Z",
            "url": "https://files.pythonhosted.org/packages/d9/e4/47d43d7e333b45694955b19bc737daa543486470733d0d1ff4e24cb6fd68/pyfrpc-0.2.10-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cddb9fbd1697b20e770df5f0dfbf44fbf144b24a3d690a453fe59152d1a2d625",
                "md5": "e88a7aaaf891efb4f0c9ff48a6fbba5e",
                "sha256": "db48ccecbd5965a5ffadad6f2b792417571c49855172607767018bc2b3c77ed9"
            },
            "downloads": -1,
            "filename": "pyfrpc-0.2.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "e88a7aaaf891efb4f0c9ff48a6fbba5e",
            "packagetype": "bdist_wheel",
            "python_version": "cp312",
            "requires_python": null,
            "size": 309948,
            "upload_time": "2024-05-17T13:50:05",
            "upload_time_iso_8601": "2024-05-17T13:50:05.111540Z",
            "url": "https://files.pythonhosted.org/packages/cd/db/9fbd1697b20e770df5f0dfbf44fbf144b24a3d690a453fe59152d1a2d625/pyfrpc-0.2.10-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "718c21014c6b9a7b878e474e432b26bbc0aff9f98652404306c9bd9bfcbb3110",
                "md5": "cbb301981804a3cc044ec0d1c4253e67",
                "sha256": "7805dfb3e0ff7d80e987659013ce479cc3e8c2e9ebcb22ae5f821ade8ad81b62"
            },
            "downloads": -1,
            "filename": "pyfrpc-0.2.10-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "cbb301981804a3cc044ec0d1c4253e67",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": null,
            "size": 273459,
            "upload_time": "2024-05-17T13:50:06",
            "upload_time_iso_8601": "2024-05-17T13:50:06.330075Z",
            "url": "https://files.pythonhosted.org/packages/71/8c/21014c6b9a7b878e474e432b26bbc0aff9f98652404306c9bd9bfcbb3110/pyfrpc-0.2.10-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7fe5e4fd9b32bcbd63bab13eb349eb916929ecd8c0bc5122a09153dee9c2cf53",
                "md5": "a0364dab4f2971242a1747e1896351ab",
                "sha256": "48e5bc1c67ae6755f0aa070e2144d1c26616e2c313c785354cae4152053feeac"
            },
            "downloads": -1,
            "filename": "pyfrpc-0.2.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "a0364dab4f2971242a1747e1896351ab",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": null,
            "size": 292642,
            "upload_time": "2024-05-17T13:50:08",
            "upload_time_iso_8601": "2024-05-17T13:50:08.067992Z",
            "url": "https://files.pythonhosted.org/packages/7f/e5/e4fd9b32bcbd63bab13eb349eb916929ecd8c0bc5122a09153dee9c2cf53/pyfrpc-0.2.10-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b84efa8992efac12847890605bd307406b698e5d0947a84e00dc001ca2320318",
                "md5": "24831a0a56c1810bd1bcf73712185b22",
                "sha256": "28a7f205768f597c50a0becbaf8634829a7604bbd1d7fdf129406594ff929cbe"
            },
            "downloads": -1,
            "filename": "pyfrpc-0.2.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "24831a0a56c1810bd1bcf73712185b22",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": null,
            "size": 288918,
            "upload_time": "2024-05-17T13:50:09",
            "upload_time_iso_8601": "2024-05-17T13:50:09.944008Z",
            "url": "https://files.pythonhosted.org/packages/b8/4e/fa8992efac12847890605bd307406b698e5d0947a84e00dc001ca2320318/pyfrpc-0.2.10-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99aedf9051d4eadb805636472b39cfbe250a14892abbe845eb286c5e49508125",
                "md5": "ef3135b7ebf27ff825cbdf4ef44574d8",
                "sha256": "ac3a40df48088deeb63af5218b8b5c75742e25044963130928946cbea5b88564"
            },
            "downloads": -1,
            "filename": "pyfrpc-0.2.10.tar.gz",
            "has_sig": false,
            "md5_digest": "ef3135b7ebf27ff825cbdf4ef44574d8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 17633,
            "upload_time": "2024-05-17T13:50:11",
            "upload_time_iso_8601": "2024-05-17T13:50:11.080184Z",
            "url": "https://files.pythonhosted.org/packages/99/ae/df9051d4eadb805636472b39cfbe250a14892abbe845eb286c5e49508125/pyfrpc-0.2.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-17 13:50:11",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "vladaburian",
    "gitlab_project": "pyfrpc",
    "lcname": "pyfrpc"
}
        
Elapsed time: 0.31113s