Death to DS_Store
Python package to patch all the internal functions to ignore .DS_Store file in Mac
- Free software: MIT license
- Documentation: Usage mentioned below
Features
- Patches pathlib internal functions to ignore .DS_Store file
Install
pip install dtd
Examples
Before
>>> import pathlib
>>> list(pathlib.Path('./tests').iterdir())
[PosixPath('tests/.DS_Store'), PosixPath('tests/__init__.py'), PosixPath('tests/__pycache__'), PosixPath('tests/test_dtd.py'), PosixPath('tests/test_pathlib.py')]
After
>>> import pathlib
>>> import dtd
>>> dtd.patch_all()
>>> list(pathlib.Path('./tests').iterdir())
[PosixPath('tests/__init__.py'), PosixPath('tests/__pycache__'), PosixPath('tests/test_dtd.py'), PosixPath('tests/test_pathlib.py')]
Quick usage by just importing autopatch
>>> import pathlib
>>> from dtd import autopatch
>>> list(pathlib.Path('./tests').iterdir())
[PosixPath('tests/__init__.py'), PosixPath('tests/__pycache__'), PosixPath('tests/test_dtd.py'), PosixPath('tests/test_pathlib.py')]
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.