You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added features:
* By default, ignore hidden files and directories
* By default, send output to stdout to work like a Unix command
* Add `--include-hidden` option to include hidden files and directories (everything mode)
* Add `--ignore-file` option to specify a file with patterns to ignore, works like .gitignore
* Add `--algorithm` option to specify the hash algorithm to use, default to md5
* For `--output-file` option (instead of stdout), add message to prevent accidental overwrite of existing files
* Add detailed usage examples to README and `examples/` directory
* Expose `get_checksums`, `gather_file_paths`, and `checksum_file` functions for use in Python
If only a target directory is passed, the default settings are to ignore hidden files and directories (those that begin with a `.`), use the `md5` algorithm, and print output to `stdout`, which can be piped (`|`).
119
+
120
+
To include all files and directories, including hidden ones, use the `--include-hidden` (or `-H`) option.
121
+
122
+
To ignore files based on patterns, use the `--ignore-file` (or `-i`) option with the path to a file containing patterns to ignore. The `--ignore-file` works identically to how `git` handles a `.gitignore` file using the implementation from [pathspec](https://github.com/cpburnz/python-pathspec).
123
+
124
+
You may explore the filtering capabilities of the `--ignore-file` option by using the provided example files under `examples/` and pointing at `examples/example_content`. The expected CSV output files are provided in `examples/expected_outputs/`.
125
+
126
+
The `bash` script, `examples/run_examples` will run all the examples; it was used to generate the `expected_outputs`.
30
127
31
128
### Python Package Usage
129
+
We expose three functions to be used in your Python code:
130
+
- `get_checksums`: Works like the CLI.
131
+
- `gather_file_paths`: Returns a list of file paths according to ignore patterns.
132
+
- `checksum_file`: Returns the checksum of a single file.
133
+
32
134
```python
33
-
from sumbuddy import get_checksums
135
+
from sumbuddy import get_checksums, gather_file_paths, checksum_file
0 commit comments