Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!


FsQuass, file system querying library

Much more info on Read the Docs.


This library is a syntactic sugar of os.path and fnmatch, and can do smart searches of files, using such techniques as

  • space-separated ancestor & descendant like in CSS, /home fsquass/fsquass
  • bash-like subpatterns, /{home,tmp}/user
  • CSS-like pseudo-classes, :file, :dir, :ignorecase


Command line interface:

$ fsquass ". *.py"

$ fsquass "/home/*/.bashrc"

This is similar to unix find. What new does FsQuass offer? Here are cool things hard to do with find: find all folders that are legitimate Pytohn packages, i.e. have a in them:

$ fsquass ". *:dir/"

Now if I want to do something with them, I use xargs. I can list those directories:

$ fsquass ". *:dir/" | xargs ls

Or copy them:

$ fsquass ". *:dir/" | xargs -I '{}' cp -R {} /tmp

You can import fsquass and use it in Python:

from fsquass import Fs
repair_photos = Fs('~/Pictures/{2010,2011}/*repair *.jp?g:ignorecase:file')

packages_with_setup = Fs('.').parents()
# and so on


Install the package with or with your python package manager:

python install

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.