-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
144 lines (95 loc) · 4.04 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
** IMPORTANT: FDB IS NO LONGER SUPPORTED.
PLEASE SWITCH TO FISH, ITS SUCCESSOR, AT YOUR EARLIEST CONVENIENCE. **
** IMPORTANT CHANGE IN VERSION 2.00: SEE TAG CONVENTIONS **
FDB PYTHON LIBRARY
==================
fdb is a primarily a command line tool for providing access to the
Fluidinfo data store (from Fluidinfo (http://fluidinfo.com/.)
There is lots of coverage of the library (and its evolution) at
http://blog.abouttag.com/.
FDB COMMAND LINE ACCESS
=======================
fdb can also be used for command-line access to FluidDB.
See 'USING THE COMMAND LINE', below.
DEPENDENCIES
============
If you're running python 2.6, fdb should just run. With earlier
version of python, you need to get access to simplejson and httplib2.
You can get simplejson from http://pypi.python.org/pypi/simplejson/
and httplib2 from http://code.google.com/p/httplib2/.
CREDENTIALS
===========
For many operations, you also need an account on FluidDB,
and credentials (a username and password). You can get these from
http://fluidinfo.com/accounts/new
The library allows you to give it your credentials in various
different ways, but life is simplest if you stick them in
a 2-line file (preferably with restricted read access) in the format
username
password
On Unix-like operating systems (including Mac OS X), the default location
for this is ~/.fluidDBcredentials.
On windows, the lcoation of the credentials file is specified
by the environment variable FDB_CREDENTIALS_FILE; if that is not
set, the fdb looks for c:\fdb\credentials.txt.
You can also optionally add a line, after password, saying either
unix-style-paths true
or unix-style-paths false
TAG CONVENTIONS
===============
As from version 2.00, fdb uses absolute Fluidinfo-style paths all the time
(i.e. you always specify the namespace and don't use a leading slash).
You can explicitly mandate this also by adding the line
unix-style-paths false
in your credentials file (see above).
If you instead set
unix-style-paths true
on the third line of the credentials file, fdb uses unix-style paths,
meaning that paths are assumed to be relative to the user's namespace
unless they are introduced with a leading slash. Also, the about tag
(fluiddb/about) may be referred to as /about. This affects input and
output.
If you want to overrride this behaviour for a given command,
you can use the -U flag to specify that the command will use
unix-style paths, or -F to indicate that it will use fluidinfo-style
paths.
TESTS
=====
The library includes a set of tests. If you have valid credentials,
and everything is OK, these should run successfully if you just execute
the file fdb.py. For example, at the time of writing this README file
(version 2.03 of the fdb), I get this:
$ fdb test
......................
----------------------------------------------------------------------
Ran 22 tests in 46.311s
OK
USING THE LIBRARY
=================
Four ways of exploring the library are:
1. look at the tests (the ones in the class TestFluidDB)
2. look at the blog (http://abouttag.blogspot.com)
3. read the function documentation, which is...existent.
4. look at and run example.py, which should print DADGAD and 10.
USING THE COMMAND LINE
======================
Commands can be run by giving arguments to fdb.
For a list of commands, use
fdb help
An example command is
python fdb show -a DADGAD rating /fluiddb/about
Obviously, if you want to use fdb as a command from the shell, it will
probably be convenient to use an alias or create a trivial shell script
to run it. I use bash, with the alias
alias fdb='~/python/fluiddb/fdb'
which allows me to type
fdb show -a DADGAD rating /fluiddb/about
You can also put a link to fdb into some directpry (like ~/bin) on your
``PATH``.
DELICIOUS
=========
Also distributed with fdb itself is code for accessing delicious.com
(http://del.icio.us/, as was), and for migrating bookmarks and other
data to FluidDB. This also includes functionality for creating web
homepages from delicious based on a home tag. See the README-DELICIOUS
file for details on this functionality.