c9a9f884cac8db39eddc440fba42b501ad7e51f8
David Blume Improve the documentation a...

David Blume authored 7 years ago

1) # Key Value Store
David Blume first commit

David Blume authored 7 years ago

2) 
3) kvs is a rudimentary key/value store written in Python.
4) 
5) # Getting the project
6) 
7) You can get a copy of this project by clicking on the
8) [ZIP](http://git.dlma.com/kvs.git/zipball/master)
9) or [TAR](http://git.dlma.com/kvs.git/tarball/master) buttons
10) near the top right of the GitList web page.
11) 
12) If you're me, and you want to contribute to the repo, then you can clone it like so:
13) 
14)     git clone ssh://USERNAME@dlma.com/~/git/kvs.git
15) 
16) # Building it
17) 
David Blume Improve the documentation a...

David Blume authored 7 years ago

18) 1. Enable Python pages at your web server. See [How to use Python in the web](https://docs.python.org/2/howto/webservers.html#). My configuration is for Apache, hence the .htaccess file.
19) 2. Move auth\_sample.txt to auth.txt, and replace "yourauthorizationhere" with a passcode you choose.
20) 3. Optional: Use secure HTTP. I reccommend getting a free SSL certificate from [Let's Encrypt](https://letsencrypt.org/).
21) 4. If you don't have the YAML module, pip install pyyaml.
David Blume first commit

David Blume authored 7 years ago

22) 
David Blume Improve the documentation a...

David Blume authored 7 years ago

23) # Using it
David Blume first commit

David Blume authored 7 years ago

24) 
David Blume Improve the documentation a...

David Blume authored 7 years ago

25) Here is [a live instance that serves an index page](https://kvs.dlma.com/).  You can send a key to get a value like so:
26) 
27)     https://kvs.dlma.com/?k=1GM35N000010
28) 
29) Special use case, here's how to get the value for the most-recently updated key of a list of keys. The list could contain any number of keys, but only one value will be returned. 
30) 
31)     https://kvs.dlma.com/?k=1GM35N000010,1GU44N010910
David Blume first commit

David Blume authored 7 years ago

32) 
David Blume Improve the documentation a...

David Blume authored 7 years ago

33) Here's the recipe for a cURL command to store a new value for a key: 
David Blume first commit

David Blume authored 7 years ago

34) 
David Blume Improve the documentation a...

David Blume authored 7 years ago

35)     curl --data "key=value&auth={authorization}" https://{url}
36) 
37) Here's [the source code for a Roku channel client of such a service](http://git.dlma.com/roku_ip_tagger.git/). 
38) 
39) # Is it any good?
40) 
41) [Yes](https://news.ycombinator.com/item?id=3067434).