CKAN as a filesystem. Not a particularly great idea... but fun.
I wanted to know what it would be like if you could mount a CKAN instance into a local folder, /tmp/ckan in the examples below.
Once mounted, each organisation in CKAN shows up as a folder, within which are shown each dataset as another folder. Each dataset then contains one file entry for each resource, the contents of which should be the contents of the resource's URL.
Currently this relies on the requests_cache library to avoid making too many requests to the CKAN instance. Particularly when reading resource (urls), getting the dataset/resource and remote URL happens several times so needs optimising to remember state.
This needs a lot of cleaning up, and for now, is a bit of a manual task.
On OSX, you will need to install OSXFuse which you can download or install via Homebrew.
git clone git@github.com:rossjones/ckanfs.git
- Make a virtualenv using your preferred method
python setup.py develop
mkdir /tmp/ckan
ckanfs https://myckanhost /tmp/ckan
If it gets in a tizz, you may need for force unmount the folder, which is either
umount -f /tmp/ckan
for linux, or diskutil unmount /tmp/ckan
for osx.