This repository has been archived by the owner on Apr 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
README
216 lines (141 loc) · 6.16 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
tagfs - tag file system
1) Introduction
2) Requirements
3) Installation
4) Tagging Files
5) Usage
6) Configuration
6.1) Options
6.1.1) tagFileName
6.1.2) enableValueFilters
6.1.3) enableRootItemLinks
7) Freebase Integration
8) Bugs
9) Further Reading
10) Contact
---------------------------------------------------------------------
Introduction
tagfs is used to organize your files using tags.
This document contains basic usage instructions for users. To develop or debug
tagfs see the README.dev file.
---------------------------------------------------------------------
Requirements
* python 2.5, 2.6, 2.7
* Linux kernel with fuse enabled
* python-fuse installed
* python-matplotlib
---------------------------------------------------------------------
Installation
To install tagfs into your home directory type the following:
$ python setup.py test e2e_test install --home ~/.local
If you haven't already extended your local python path then add the following
to your environment configuration script. For example to your ~/.bashrc:
$ export PYTHONPATH=~/.local/lib/python:$PYTHONPATH
You may also need to add ~/.local/bin to your PATH environment variable:
$ export PATH=~/.local/bin:$PATH
---------------------------------------------------------------------
Tagging Files
Before you can filter anything using tagfs you need to tag your items. An item
is a directory which contains a file called .tag. All items must be below one
directory.
Let's create a simple item structure.
First we create the root directory for all items:
$ mkdir items
Then we create our first item:
$ mkdir items/Ted
We tag the 'Ted' item as movie:
$ echo movie >> items/Ted/.tag
We also tag 'Ted' as genre comedy:
$ echo 'genre: comedy' >> items/Ted/.tag
Then we add a second item:
$ mkdir items/banana
$ echo fruit >> items/banana/.tag
$ echo 'genre: delicious' >> items/banana/.tag
Modifying .tag files using echo, grep, sed may be a little hard sometimes.
There are some convenience scripts available through the tagfs-utils project.
See https://github.com/marook/tagfs-utils for details.
---------------------------------------------------------------------
Usage
After installation tagfs can be started the following way.
Mount a tagged directory:
$ tagfs -i /path/to/my/items/directory /path/to/my/mount/point
Unmount a tagged directory:
$ fusermount -u /path/to/my/mount/point
Right now tagfs reads the taggings only when it's getting mounted. So if you
modify the tags after mounting you will not see any changes in the tagfs file
system.
In general tagfs will try to reduce the number of filter directories below the
virtual file system. That's why you may not see some filters which would not
reduce the number of selected items.
---------------------------------------------------------------------
Configuration
tagfs can be configured through configuration files. Configuration files are
searched in different locations by tagfs. The following locations are used.
Locations with higher priority come first:
- <items directory>/.tagfs/tagfs.conf
- ~/.tagfs/tagfs.conf
- /etc/tagfs/tagfs.conf
Right now the following configuration options are supported.
---------------------------------------------------------------------
Configuration - Options - tagFileName
Through this option the name of the parsed tag files can be specified. The
default value is '.tag'.
Example:
[global]
tagFileName = ABOUT
---------------------------------------------------------------------
Configuration - Options - enableValueFilters
You can enable or disable value filters. If you enable value filters you will
see filter directories for each tag value. For value filters the tag's
context can be anyone. The default value is 'false'.
Example:
[global]
enableValueFilters = true
---------------------------------------------------------------------
Configuration - Options - enableRootItemLinks
To show links to all items in the tagfs '/' directory enable this option. The
default value is 'false'.
Example:
[global]
enableRootItemLinks = true
---------------------------------------------------------------------
Freebase Integration
Freebase is an open graph of people, places and things. See
http://www.freebase.com/ for details. tagfs allows you to extend your own
taggings with data directly from the freebase graph.
WARNING! Freebase support is currently experimental. It is very likely that the
freebase syntax within the .tag files will change in future releases of tagfs.
In order to use freebase you need to install the freebase-python bindings. They
are available via https://code.google.com/p/freebase-python/
To extend an item's taggings with freebase data you have to add a freebase query
to the item's .tag file. Here's an example:
_freebase: {"id": "/m/0clpml", "type": "/fictional_universe/fictional_character", "name": null, "occupation": null}
tagfs uses the freebase MQL query format which is described below the following
link http://wiki.freebase.com/wiki/MQL
The query properties with null values are added as context/tag pairs to the
.tag file's item.
Generic freebase mappings for all items can be specified in the file
'<items directory>/.tagfs/freebase'. Every line is one freebase query. You can
reference tagged values via the '$' operator. Here's an example MQL query with
some demo .tag files:
<items directory>/.tagfs/freebase:
{"type": "/film/film", "name": "$name", "genre": null, "directed_by": null}
<items directory>/Ted/.tag:
name: Ted
<items directory>/Family Guy/.tag:
name: Family Guy
When mounting this example the genre and director will be fetched from freebase
and made available as filtering directories.
---------------------------------------------------------------------
Bugs
Viewing existing and reporting new bugs can be done via the github issue
tracker:
https://github.com/marook/tagfs/issues
---------------------------------------------------------------------
Further Reading
Using a file system for my bank account (Markus Pielmeier)
http://pielmeier.blogspot.com/2010/08/using-file-system-for-my-bank-account.html
---------------------------------------------------------------------
Contact
* homepage: http://wiki.github.com/marook/tagfs
* author: Markus Peröbner <markus.peroebner@gmail.com>