https://github.com/ninjamar/mproto
Python library for making custom protocols
https://github.com/ninjamar/mproto
Last synced: 12 months ago
JSON representation
Python library for making custom protocols
- Host: GitHub
- URL: https://github.com/ninjamar/mproto
- Owner: ninjamar
- License: mit
- Created: 2021-05-18T01:13:52.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-19T21:19:19.000Z (about 5 years ago)
- Last Synced: 2025-05-18T08:37:48.912Z (about 1 year ago)
- Language: Python
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Description
mproto is a python package for making custom protocols
## Installation
### pip
```bash
pip install mproto
```
## Usage
```python
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](https://ninjamar.repl.co/mproto/docs)
[usefull stuff](https://scratch.mit.edu/discuss/topic/515027/)