Skip to main content

mdfind wrapper

Project description

Install

$ [sudo] pip install mdfind

Functions

function description
mdfind.count(query=None, name=None, onlyin=None) return search results count
mdfind.mdfind(args) execute mdfind with arguments
mdfind.name(name, onlyin=None) mdfind -name name search by name
mdfind.query(query, onlyin=None) search by Spotlight query

Examples

>>> import mdfind
>>> mdfind.name('Group Containers')
['/Users/username/Library/Group Containers']
>>> mdfind.query('kMDItemContentType==public.shell-script')
[...]
>>> mdfind.count(query='kMDItemContentType==public.mp3')
42
>>> mdfind.count(name='Group Containers')
1
>>> mdfind.mdfind(['-count','-onlyin','/usr','kMDItemContentType==public.shell-script'])
42

Links

readme-md - README.md generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdfind-2018.11.20.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

mdfind-2018.11.20-py2.py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page