Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

A JSONRPC-like client and server with additions to enable authenticated requests

Project description

This package provides a service based on JSONRPC with some small additions to the standard in order to enable authenticated requests. The WSGI specification is used for data communication. The package is broken down into two halves - a client and a server. For security, the server is best run over HTTPS, although this is not enforced.

This package depends on WebOb 1.2 (or above). This is automatically installed if you have an internet connection and use pip, otherwise download and install from

Example Usage (Server):

import hashlib
from wsgiref import simple_server
from AuthRPC.server import AuthRPCApp

def myauth(username, password, useragent):
    return username  == 'myuser' and \
           password  == hashlib.md5('secret'.encode()).hexdigest() and \
           useragent == 'myprogram'

class api(object):
    def do_something(self, myvar):
        """Your code placed here"""
        return 'Something', myvar

application = AuthRPCApp(api(), auth=myauth, filepath='/home/myapp/datadir')
server = simple_server.make_server('localhost', 1234, application)

Example Usage (Client):

from AuthRPC.client import ServerProxy, BatchCall

client = ServerProxy('http://localhost:1234/',
retval = client.do_something('test')

# get a file and save local copy
file_contents_generator = client.__getfile__('myfile.pdf')
with open('myfile_downloaded.pdf', 'wb') as f:
    for data in file_contents_generator:

batch = BatchCall(client)
batch.do_something('call 1')
batch.do_something('call 2')

Change Log


  • Remove dependency on distribute
  • Tidy up pypi package contents


  • Use generator with __getfile__ (uses much less memory)
  • Fixed security issue with __getfile__ - do not allow access to whole disk!
  • Handle exceptions in auth function
  • Fixed encrypting of no password
  • Changed README code examples


  • Changed/renamed exceptions that are generated (client)


  • Added __getfile__ mechanism


  • Added batch requests
  • Added Python 3 support for server


  • First version

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for AuthRPC, version 0.3.2a
Filename, size File type Python version Upload date Hashes
Filename, size AuthRPC-0.3.2a.tar.gz (9.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page