Menu

Tree [39b91f] default tip /
 History

Read Only access


File Date Author Commit
 QUICK START 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 README 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 changes-version-1.00.txt 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 example.py 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 gpl-3.0.txt 2012-01-03 Robert Beverly Robert Beverly [c1db8b] add license document
 ndexr-config.json 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 ndexr.py 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 recursive_example.py 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 setup.py 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes
 test-README 2012-01-03 Robert Beverly Robert Beverly [8675a4] initial commit, version tested on OS X 10.6.3 -...
 test-config-2.json 2012-01-03 Robert Beverly Robert Beverly [8675a4] initial commit, version tested on OS X 10.6.3 -...
 test-config.json 2012-01-03 Robert Beverly Robert Beverly [8675a4] initial commit, version tested on OS X 10.6.3 -...
 test-ndexr.py 2012-01-05 Robert Beverly Robert Beverly [39b91f] see changes-version-1.00 for changes

Read Me

README

SUMMARY

ndexr -- Tool to use from Python interactive interpreter or script. Use it to make JSON indexes 
of all files in a directory, or files of a certain type. Could be used to observe activity in a 
server directory and save logs elsewhere for an administrator or another script to use. Or to 
generate JSON to send to clients searching remotely. Or to keep an index of files in a directory 
when the user of that directory does not have permission to probe the files system for files 
without knowing their names. Uses a configuration file, or optionally you can pass configuration 
information as keyword arguments.

INSTALLATION (optional):

cd /path/to/ndexr
python setup.py install

USEAGE

from python interpreter...
>>> import ndexr, os
>>> myindexer = ndexr.Ndexr()
>>> myindexer.write_index(cfg="ndexr-config.json")
wrote 2 filenames to /Users/rab/Desktop/_test_index_few.json
>>> myindexer.write_index(cfg="ndexr-some-other-config.json")
wrote 10 filenames to /Users/rab/Desktop/_test_index.json

or from file (edit the config files first)…
cd /path/to/module/
python example.py

Recursive example:
>>> import ndexr
>>> myindexer = ndexr.Ndexr()
>>> for root, dirs, files in os.walk('/Users/rab/code/monster_corona/parts/'):
. . .    myindexer.write_index(in_directory=root, out_file=root + "/_index.json")
. . . <Enter>
wrote 1 filenames to /Users/rab/code/monster_corona/parts//_index.json
wrote 5 filenames to /Users/rab/code/monster_corona/parts/body/_index.json
wrote 7 filenames to /Users/rab/code/monster_corona/parts/head/_index.json
<et cetera>

(see also recursive_example.py)

PURPOSE

Developer tool to index files such as art sources so that an application can find them. Some 
environments don't allow probing the file system, so you must know the names of all files in the 
directory. Having an index file with a known filename solves this problem. The same tool can be 
adapted to allow users to index a group of files, then drop them into a directory with the index. 
That solves the problem of users adding files without using your application, when your 
application can not probe for files without knowing their names. 

OTHER USES

Maybe it would be handy for returning a JSON representation of a directory to clients as part of 
a web service. Or for posting an index of your music?
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.