2014-01-27 06:50:38 +00:00
|
|
|
sweeper
|
|
|
|
=======
|
|
|
|
|
|
|
|
Find duplicate files and perform action.
|
|
|
|
|
|
|
|
Usage
|
|
|
|
=====
|
|
|
|
|
|
|
|
Print duplicates
|
2014-01-27 07:04:25 +00:00
|
|
|
|
2014-01-27 07:01:30 +00:00
|
|
|
.. code:: python
|
2014-01-27 07:03:00 +00:00
|
|
|
|
2014-08-09 22:06:32 +00:00
|
|
|
from sweeper import Sweeper
|
|
|
|
swp = Sweeper(['images1', 'images2'])
|
|
|
|
dups = swp.file_dups()
|
2014-01-27 06:50:38 +00:00
|
|
|
print(dups)
|
|
|
|
|
|
|
|
Remove duplicate files
|
2014-01-27 07:04:25 +00:00
|
|
|
|
2014-01-27 07:01:30 +00:00
|
|
|
.. code:: python
|
2014-01-27 07:03:00 +00:00
|
|
|
|
2014-08-09 22:06:32 +00:00
|
|
|
from sweeper import Sweeper
|
|
|
|
swp = Sweeper(['images1', 'images2'])
|
|
|
|
swp.rm()
|
2014-01-27 06:50:38 +00:00
|
|
|
|
|
|
|
Perform custom action
|
2014-01-27 07:04:25 +00:00
|
|
|
|
2014-01-27 07:03:00 +00:00
|
|
|
.. code:: python
|
|
|
|
|
2014-08-09 22:06:32 +00:00
|
|
|
from sweeper import Sweeper
|
|
|
|
swp = Sweeper(['images'])
|
|
|
|
for f, h, dups in swp:
|
2014-02-07 12:04:37 +00:00
|
|
|
print('encountered {} which duplicates with already found duplicate files {} with hash {}'.format(f, dups, h))
|
2014-01-27 06:50:38 +00:00
|
|
|
|
2014-01-27 07:04:25 +00:00
|
|
|
As script::
|
2014-01-27 07:03:00 +00:00
|
|
|
|
2014-08-09 22:06:32 +00:00
|
|
|
python -m sweeper/sweeper --help
|
2014-01-27 06:50:38 +00:00
|
|
|
|
2014-01-27 08:23:37 +00:00
|
|
|
As installed console script::
|
|
|
|
|
|
|
|
sweeper --help
|
|
|
|
|
2014-01-27 06:50:38 +00:00
|
|
|
Installation
|
|
|
|
============
|
|
|
|
|
|
|
|
from source::
|
|
|
|
|
|
|
|
python setup.py install
|
|
|
|
|
|
|
|
or from PyPI::
|
|
|
|
|
|
|
|
pip install sweeper
|
|
|
|
|
|
|
|
Documentation
|
|
|
|
=============
|
|
|
|
|
|
|
|
this README.rst, code itself, docstrings
|
|
|
|
|
|
|
|
sweeper can be found on github.com at:
|
|
|
|
|
|
|
|
https://github.com/darko-poljak/sweeper
|
|
|
|
|
|
|
|
Tested With
|
|
|
|
===========
|
|
|
|
|
2014-08-09 18:59:23 +00:00
|
|
|
Python2.7, Python3
|
2014-01-27 06:50:38 +00:00
|
|
|
|