https://github.com/andrewpetrochenkov/mdfind.py
:mag: mdfind wrapper
https://github.com/andrewpetrochenkov/mdfind.py
macos python
Last synced: about 2 months ago
JSON representation
:mag: mdfind wrapper
- Host: GitHub
- URL: https://github.com/andrewpetrochenkov/mdfind.py
- Owner: andrewpetrochenkov
- License: unlicense
- Created: 2018-09-22T22:39:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-12-03T21:10:14.000Z (over 4 years ago)
- Last Synced: 2025-04-06T11:47:29.655Z (2 months ago)
- Topics: macos, python
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://pypi.org/project/mdfind/)
[](https://unlicense.org/)
[](https://github.com/andrewp-as-is/mdfind.py/actions)### Installation
```bash
$ [sudo] pip install mdfind
```#### Examples
```python
>>> import mdfind
>>> mdfind.name('Group Containers')
['/Users/username/Library/Group Containers']
``````python
>>> mdfind.query('kMDItemContentType==public.shell-script')
[...]
``````python
>>> mdfind.count(query='kMDItemContentType==public.mp3')
42
>>> mdfind.count(name='Group Containers')
1
``````python
>>> mdfind.mdfind(['-count','-onlyin','/usr','kMDItemContentType==public.shell-script'])
42
```#### Links
+ [File Metadata Query Expression Syntax](https://developer.apple.com/library/archive/documentation/Carbon/Conceptual/SpotlightQuery/Concepts/QueryFormat.html)