qdb protocal.
Project description
# os-qdb-protocal
[](https://www.travis-ci.org/cfhamlet/os-qdb-protocal)
[](https://codecov.io/gh/cfhamlet/os-qdb-protocal)
[](https://pypi.python.org/pypi/os-qdb-protocal)
[](https://pypi.python.org/pypi/os-qdb-protocal)
qdb protocal.
Support qdb commands: ``get``, ``test``
# Install
`pip install os-qdb-protocal`
# Usage
* create a protocal object from cmd and key
```
from os_qdb_protocal import create_protocal
proto = create_protocal('get', b'test-key')
```
* use upstream method to generate data to be send
```
# s is something which used to write data to, like socket, file, etc.
for data in proto.upstream():
s.send(data)
```
* use downstream method to parse data and get size will be recived
```
downstream = proto.downstream()
read_size = next(downstream)
while read_size >= 0:
# s is something which used to recieve data from, like socket, file, etc.
data = s.read(read_size)
read_size = downstream.send(data)
```
* access key and value
```
proto.key
proto.value
```
# Unit Tests
`$ tox`
# License
MIT licensed.
[](https://www.travis-ci.org/cfhamlet/os-qdb-protocal)
[](https://codecov.io/gh/cfhamlet/os-qdb-protocal)
[](https://pypi.python.org/pypi/os-qdb-protocal)
[](https://pypi.python.org/pypi/os-qdb-protocal)
qdb protocal.
Support qdb commands: ``get``, ``test``
# Install
`pip install os-qdb-protocal`
# Usage
* create a protocal object from cmd and key
```
from os_qdb_protocal import create_protocal
proto = create_protocal('get', b'test-key')
```
* use upstream method to generate data to be send
```
# s is something which used to write data to, like socket, file, etc.
for data in proto.upstream():
s.send(data)
```
* use downstream method to parse data and get size will be recived
```
downstream = proto.downstream()
read_size = next(downstream)
while read_size >= 0:
# s is something which used to recieve data from, like socket, file, etc.
data = s.read(read_size)
read_size = downstream.send(data)
```
* access key and value
```
proto.key
proto.value
```
# Unit Tests
`$ tox`
# License
MIT licensed.
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
os-qdb-protocal-0.2.1.tar.gz
(4.3 kB
view details)
File details
Details for the file os-qdb-protocal-0.2.1.tar.gz.
File metadata
- Download URL: os-qdb-protocal-0.2.1.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57f4c710ca889b9105d900417d5b3af22f8e0bbde9cf46e324eef1fb5d151cd0
|
|
| MD5 |
7c54ccd3c3d9c81e21456b8ba694c525
|
|
| BLAKE2b-256 |
ae61ea9631844bd89cb40f3ebec18b322eaf85bdcc72487a646311606c2895fa
|