Giter Club home page Giter Club logo

puredis's Introduction

Puredis

Redis external for Pure Data.

Build

wget https://github.com/lp/puredis/tarball/master
PUREDIS_SRC=`find . -name lp-puredis-* -print`
tar xzf $PUREDIS_SRC
cd ${PUREDIS_SRC:0:20}
# *** edit the Makefile top portion with proper system settings ***
make

Dependencies

The build process will take care of fetching, compiling and linking to Hiredis and libcsv. The core and purpose of this external, Redis, is not bundled herein and must be installed separately. The only mandatory Redis configuration (redis.conf) option for Puredis is “timeout 0” (meaning no timeout), unless your use of Puredis is limited to short time spans.

Usage:

SET: symbol OK
GET: symbol BAR
LPUSH: 1
LPUSH: 2
LPUSH: 3
LPOP: symbol VALUE3
LRANGE: list VALUE2 VALUE1
HMSET: symbol OK
HGET: symbol value2
HMGET: list value1 value3
HVALS: list value1 value2 value3
SADD: 1
SADD: 1
SADD: 1
SADD: 1
SADD: 1
SINTER: symbol C
SUNION: list C A B
ZADD: 1
ZADD: 1
ZADD: 1
ZADD: 1
ZADD: 1
ZINCRBY: symbol 4
ZRANGEBYSCORE: list D 10 E 100
ZRANGE: list A 1 B 2 C 4

Async Puredis: apuredis

right: 1
bang: bang
right: 1
bang: bang
...
left: symbol BAR
right: 0

Pub/Sub Puredis: spuredis

subscriber: list subscribe X 1
subscriber: list subscribe NORTH 2
subscriber: list subscribe CHANNEL_Z 3
subscriber: list unsubscribe X 2
publisher: 1
subscriber: list message CHANNEL_Z BEEEZZZZ
publisher: 1
subscriber: list message NORTH HOHOHO
publisher: 0

Loading datasets from .csv files

It is also possible to load datasets from csv files in a puredis object. The puredis object won’t output anything while loading except for Redis error messages to the pd console. A status message is sent when loading completes.

For csv loading, your files will need to be formatted in a way puredis can understand. (Lines preceded by # are ignored).

CSV Strings:

# KEY, VALUE
KEY1, VALUE1
KEY2, VALUE2
KEY3, VALUE3

CSV Lists:

# LIST,ITEM1,ITEM2,...
MYLIST,A,B,C,D,E
MYLIST2,F,G,H,I,J

CSV Hashes:

PERSON,AGE,CITY
ANNA,26,Vancouver
PIETER,32,Dublin
SERGEI,41,Moscow

CSV Sets:

# SET,ITEM1,ITEM2,...
MYSET1,A,B,C,D,E
MYSET2,F,G,H,I,J

CSV Sorted Sets:

# ZSET, SCORE1, VALUE1, SCORE2, VALUE2, ...
MYZSET1,1,A,2,B,3,C,4,D,5,E
MYZSET2,1,F,2,G,3,H,4,I,5,J

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.