Python implementation of fastrpc protocol
Project description
Pyfrpc
Pyfrpc is a Python implementation of FastRPC protocol/library ( @github or @sourceforge ). The original library contains Python bindings, but:
- I prefer python packages without dependencies on debian packages.
- 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.
- 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.
- 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
Aside from distribution as a python package, it's also possible to download single-file amalgamated distribution: pyfrpc.py.
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'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pyfrpc-0.2.2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24e2d6577e3377a50a05490b3188057d5b3d763e08a90f3e4432dfac63dab27c |
|
MD5 | 3f659da1926494440c6e3ee6b7086e1d |
|
BLAKE2b-256 | 1b8e4e784072a9c4125d989a288e91abe23ce7e766c0ddf9dead7cd8a4e87c87 |
Hashes for pyfrpc-0.2.2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24bd91fc1589548cb63c7cf635df5ee6e90a950a6c8e26cf718370ed2d7f6147 |
|
MD5 | 37129fa2e7bea2fdbd16de790f0859d2 |
|
BLAKE2b-256 | 438245364d58abda574d024ec7fdcdc7fc37523e6af840e9bbf14f838ca12f92 |
Hashes for pyfrpc-0.2.2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff2fe6af35ff09ef300220164741ae3247f2f0e056e79c494d42fe9aafa7d951 |
|
MD5 | 98079a5e7a662784cd0bce40eb10fc85 |
|
BLAKE2b-256 | 2d51fe0d4b8f6d7d7e2ded249df90983837b673c8acd19f7b51cf4119358c366 |
Hashes for pyfrpc-0.2.2-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e51315f72c0308a6105291dfa9dda707cd4e85bd176b25320fc497ddf5788e65 |
|
MD5 | 9fc76a83c31e4aa89ae548b9204cc268 |
|
BLAKE2b-256 | 31d9400d52cfc9b63d6f42f553f1f14894c8643d98311ea1dcf3746af96c4272 |