Skip to main content

Make custom protocols

Project description

Description

mproto is a python package for making custom protocols

Installation

pip

pip install mproto

Usage

import mproto
import urllib.request as urlreq

class MyCustomProtocol(mproto.BaseProtoHandler)
  def protocolname_open(self,req): #name must be protocol name + _open
    # do stuff with req
    return req.get_full_url()

mproto.install(MyCustomProtocol)
print(urlreq.urlopen('protocolname://abc')) #should print "protocolname://abc"

Other

docs

Project details


Download files

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

Source Distribution

mproto-0.0.2.tar.gz (2.1 kB view hashes)

Uploaded Source

Built Distribution

mproto-0.0.2-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page