Redis Protocol
===============================
.. image:: https://badge.fury.io/py/redis_protocol.png
:target: http://badge.fury.io/py/redis_protocol
.. image:: https://travis-ci.org/youngking/redis_protocol.png?branch=master
:target: https://travis-ci.org/youngking/redis_protocol
.. image:: https://pypip.in/d/redis_protocol/badge.png
:target: https://crate.io/packages/redis_protocol?version=latest
Redis Protocol implemented by python
* Free software: BSD license
* Documentation: http://redis_protocol.rtfd.org.
Usage
--------
This is the protocol implemented followed by `redis protocol specification <http://redis.io/topics/protocol>`_.
I had used it in my `redis_proxy <https://github.com/youngking/redis_proxy>`_ project.
::
>>> from redis_protocol import decode, encode
>>> encode("ping") # encode a request
... '*1\r\n$4\r\nping\r\n'
>>> decode('*1\r\n$4\r\nping\r\n') # decode a request body
... ["ping"]
>>> decode("$6\r\nfoobar\r\n") # decode a response
... "foobar"
parse redis protocol stream
------
parse redis protocol stream to redis commands,such as redis pipeline requests or raw responses.
::
>>> from redis_protocol import parse_stream
>>> data = '*3\r\n$3\r\nSET\r\n$15\r\nmemtier-8232902\r\n$2\r\nxx\r\n' \
'*3\r\n$3\r\nSET\r\n$15\r\nmemtier-8232902\r\n$2\r\nxx\r\n' \
'*3\r\n$3\r\nSET\r\n$15\r\nmemtier-7630684\r\n$3\r\nAAA\r\n'
>>> print(parse_stream(data))
... ['SET memtier-8232902 xx', 'SET memtier-8232902 xx', 'SET memtier-7630684 AAA']
History
-------
0.0.1 (2013-08-11)
++++++++++++++++++
* First release on PyPI.
Metadata
Release files for redis_protocol 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| redis_protocol-0.0.2.tar.gz | 5.3 kB | Without provenance | Details |
Release files / redis_protocol-0.0.2.tar.gz
| Download URL | redis_protocol-0.0.2.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
860ade1797b5a5899dc124ace3f4ad79bada8c8fcc170b8eba06a4d708719d1d
|
|
BLAKE2b-256 checksum How to use checksums |
232d9e490987f382a00a140e0e220a1628a071e8bcc916bd113b22b0d60bfe3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for redis_protocol 0.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.