Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/njgibbon/file-dir-set-ops
Set Operations on File Directories.
https://github.com/njgibbon/file-dir-set-ops
cli dirs files python sets tools
Last synced: 2 months ago
JSON representation
Set Operations on File Directories.
- Host: GitHub
- URL: https://github.com/njgibbon/file-dir-set-ops
- Owner: njgibbon
- License: mit
- Created: 2021-09-16T20:03:02.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-22T21:34:36.000Z (over 3 years ago)
- Last Synced: 2024-10-11T11:15:36.356Z (3 months ago)
- Topics: cli, dirs, files, python, sets, tools
- Language: Python
- Homepage:
- Size: 483 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Set Operations on File Directories.
Use some basic Set Operations to analyse and compare the file names in 2 or more given directories.
# Background
Several times over the past couple of years I've had to work out the difference between 2 folders in terms of files.Each time it's manually looking > unix utilities > ad-hoc scripts.
This little tool should permanently solve this problem.
# Install
```
pip3 install file-dir-set-ops --upgrade
```# Usage
## Data
![sets](images/sets.gif)## Union
![union](images/union.gif)(In **A** OR **B** OR **C**)
```
file-dir-set-ops --operation union --dir-paths tests/data/a tests/data/b tests/data/ca.txt
b.txt
c.txt
file.txt
```## Intersection
![union](images/intersection.gif)(In **A** AND **B** AND **C**)
```
file-dir-set-ops --operation intersection --dir-paths tests/data/a tests/data/b tests/data/cfile.txt
```## Relative Complement (Set Difference)
![complement](images/complement.gif)(In **A** AND Not in **B** OR **C**)
```
file-dir-set-ops --operation complement --dir-paths tests/data/a tests/data/b tests/data/ca.txt
```# Resources
* Set Theory: https://en.wikipedia.org/wiki/Set_theory
* Union: https://en.wikipedia.org/wiki/Union_(set_theory)
* Intersection: https://en.wikipedia.org/wiki/Intersection_(set_theory)
* (Relative) Complement: https://en.wikipedia.org/wiki/Complement_(set_theory)
* Python Sets: https://realpython.com/python-sets
* https://www.codecogs.com/latex/eqneditor.php