[Developers] fcl - a freebase commandline tool
Nick Thompson
nix at metaweb.com
Sat Jul 11 18:13:01 UTC 2009
Another Hack Day bonus!
If you've installed the freebase-python package, you also have a
command-line tool for talking to the Freebase API. if you haven't
installed yet and have a modern python setup, it's this easy:
easy_install freebase
then you can try:
fcl help
for a list of things you can do with fcl. if that doesn't
work after the easy_install, you may need to add a python
"scripts" directory to your PATH.
my favorites:
- fcl dump /en/whatever
is faster than visiting the explorer view
- fcl ls /
for a list of toplevel domains
- fcl find lets you produce a list of ids that match a MQL query.
"fcl find" accepts queries in RISON, a terse syntax for JSON.
see <http://mjtemplate.org/examples/rison.html>
to show all domains created by /user/nix and their contents:
for id in $(fcl find type:/type/domain,creator:/user/nix) ; do echo
===$id=== ; fcl ls $id ; done
for the brave, you can log in with "fcl login" and enable
all sorts of things, like
- fcl mv
- fcl ls
- fcl ln
which work on namespaces the same way the UNIX equivalents
work on directories.
if you know python, it should be easy to extend fcl with new
subcommands if you want to create your own custom version.
nick
More information about the Developers
mailing list