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](https://gitlab.com/vladaburian/pyfrpc/-/jobs/artifacts/master/raw/ dist/pyfrpc.py?job=archive).
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.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0dc7b37d8e7be699d48a22bfa0442a458b64a814b12333889cdf578f39ea75d |
|
MD5 | f519165d573b1796f56bf954ad9090ad |
|
BLAKE2b-256 | 1b6baba185b03ee13e1e99bc76b35243d0e5f61196d3f55c99da53549597f785 |
Hashes for pyfrpc-0.2.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c98029918f3b56175cfd4ae7ded2d31f75fbffdeba4c08b2e1a99dac887892a3 |
|
MD5 | dcf4afd207a97f25d4747b53232dbf12 |
|
BLAKE2b-256 | 11d891afbd1bebf893f3896e91ce548c3844d8ddaa8d09f128eb1860ea92b136 |
Hashes for pyfrpc-0.2.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f56438f44aa0f273c0d38c2839933df0df54e9944109ce72d2c0b9ac7ede3fb |
|
MD5 | bced86e5e5e128535bfcb86e2b561110 |
|
BLAKE2b-256 | b81d2685a9b32b08730decea51367fb572f2b30750636cc09b1780e91f3e4b44 |
Hashes for pyfrpc-0.2.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 863fedba953f2cfcdcb3b3354f8a58d1ca405de54f45dd0c4f3e6eb54c302380 |
|
MD5 | 88980a322c0840e25194f96ec8b266ec |
|
BLAKE2b-256 | 347b3831f12beaa7fe4e8f69b1187a49de597e81a63580da37f9eeec9db7bf01 |