Skip to main content

SimpleRPC is a simple RPC package for Python, supporting both client and server functions through definition of a single class. To implement a client and server, merely extend the SimpleRPC class and define the RPC functions as methods of this class, decorated with the @remote decorator. (Note that the methods close(), ping(), connect(), listen(), and serve() are reserved, as are the host, port, authkey, mode, and conn instance attributes and the connection_class class attribute.) To run the server, simply call the listen() method, which will loop forever, accepting clients and using eventlet to spawn a thread to serve them (implemented using the serve() method). For the client, simply calling the RPC method is sufficient, but the connection can be explicitly initialized by calling the connect() method. The connection can be closed by calling close(), and a round-trip time can be obtained by using the ping() method. Note that all function arguments and results must be serializable by the Python json package. (RPC methods may raise exceptions, as long as the exception class is available on the client side; if it is not, the exception will turn into an ImportError.)

Note that SimpleRPC is so simple that no effort is made to use a secure connection type, such as SSL. For this reason, the server should be started on 127.0.0.1, to prevent snooping. (Clients do send an “authkey” to the server, which the server uses to authorize the client, but this “authkey” is sent as plain text.) It is possible to use a more secure connection technology, such as SSL, by extending the Connection class and setting the connection_class class attribute of the SimpleRPC subclass to that Connection subclass.

Metadata

Release files for simplerpc 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplerpc 0.1.0
File Size Uploaded
simplerpc-0.1.0.tar.gz 15.0 kB Details

Release files / simplerpc-0.1.0.tar.gz

Download URL simplerpc-0.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
2ef29501e850e0f7e5af9ea2232011157c544d5759d72297d8b901f49b07e493
BLAKE2b-256 checksum
How to use checksums
8c7bc7dc49973e45e3a90d490f46a795415601681e481e887ad5453116b00c13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page