Git Product home page Git Product logo

pyredis's Introduction

PyRedis

  • Basic implementation of Redis in Python.
  • Works using gevent for non blocking IO
  • Handles RESP compliant commands

ENV

  • python==3.6.5
  • gevent==1.3.5
  • greenlet==0.4.13

Structure

pyredis
├── Dockerfile
├── README.md
├── pyredis
├── requirements.txt
├── setup.py
├── src
│   ├── __init__.py
│   ├── command_handler.py
│   ├── command_parser.py
│   ├── daemon.py
│   ├── memory.py
│   ├── pyredis.py
│   └── server.py
└── tests
    ├── __init__.py
    ├── test_command_handler.py
    └── test_command_parser.py

Step 0

$ Install dependencies with pip install -r requirements.txt

Step 1

$ python -m unittest discover -s tests/ -p 'test_*.py'

Step 2

You can now control daemon with:

$ python src/pyredis.py start

$ python src/pyredis.py stop

$ python src/pyredis.py restart

Step 3

Install as a PIP package

  1. python install wheel
  2. First build a wheel python setup.py bdist_wheel
  3. Install the wheel python setup.py install...now pyredis start/stop/restart is available on your path

To do a daemon install (after you have installed the pip package)

  • 1.Copy the init.d script to /etc/init.d
  • 2.Run sudo service start pyredis

Step 4

Build/run as a docker container

  • 1.$ docker build -t redis
  • 2.$ docker run -dit --name redis -p 6379:6379 redis

For any install or run method you should be able to run redis-cli on the host machine and it will connect to 127.0.0.1:6379 where you can issue commands

pyredis's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.