Skip to content

sourcepirate/pylocated

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyLocated

Build Status

A Locatedb interface for python

Installing

  pip install pylocated

Usage

from pylocated import locatedb

#if you want to use default locatedb path you
#can use the class methods for it.

buffer = locatedb.find('sample.py', limit=20, ignore_case=False, regex=None)
files = buffer.getvalue()
print files

#if you want to setup you own path to locatedb

locate_db = locatedb(db_path='/var/lib/app.db')
buffers = locate_db.find("sample.py", limit=20, ignore_case=False, regex=None)
print buffers.getvalue()

API

locatedb.find or instance.find(): [name, limit=None, ignore_case=False, regex=None]

used to find the particular files in system. where pattern inside regex find the matches of path.

locatedb.count or instance.count: [name]

used find the number of occurences for that particular word. equivalent to locate -c

locatedb.statistics or instance.statistics : [name]

used to give the disk statistics equivalent to locate -S

locatedb.version:

return the version of locatedb you are using.

License:

MIT © 2015 plasmashadow aka sourcepirate plasmashadowx@gmail.com

About

Python Locatedb interface

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages