Git Product home page Git Product logo

redis-load's Introduction

redis-load

Utility for managing data structures in Redis, allowing lists, sets, etc to be populated by loading data from flat files and JSON. Data structures can also be saved out to local files.

The rationale here was to provide an easy way to persist the results of data manipulations from Redis in common formats. Similarly, I also wanted to load data structures from files for use in Redis, but where the original data has been created separately, e.g. by a map-reduce job.

Author


Leigh Dodds ([email protected])

Download

http://github.com/ldodds/redis-load

Installation

redis-load is available as a gem:

sudo gem install redis-load

It has dependencies on the ruby redis library, json/pure and siren

If you grab a copy from github then there's an install target in the Rakefile that will build and install the gem

Usage

The command-line app is called redis-load. You need to provide it with a filename and generally a key to be populated.

Load the contents of a json file as entries into a server:

redis-load load-json --file myfile.json

Load the contents of a file as key-value pairs. (Must be key,value):

redis-load load-keys --file mykeys.txt

Load the contents of a file into a list. Each line is a list entry:

redis-load load-list --key mylist --file mylist.txt

Load the contents of a file into a set. Each line is a set entry:

redis-load load-set --key myset --file myset.txt

Load the contents of a file into a sort set. Each line is a key-value pair of entry,score:

redis-load load-zset --key myzset --file myzset.txt

Save json for some or all keys into a file:

redis-load save-json --file mydata.json
redis-load save-json --keys foo* --file mydata.json

Save a list into a file:

redis-load save-list --key mylist --file mylist.txt

Save a set into a file:

redis-load save-set --key myset --file myset.txt

Save a sorted set into a file:

redis-load save-zset --key myzset --file myzset.txt

Note that when saving a file any existing file will automatically be over-written.

License

redis-load is free and unencumbered public domain software. For more information, see http://unlicense.org/ or the accompanying UNLICENSE file.

redis-load's People

Contributors

ldodds avatar maxbrunsfeld avatar

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.