Text Prepender
Created in mind to add Legal Text to the top of code
text-prepender recursively goes through a specified directory/list of files, and adds text to the top of supported filetypes. If there is a filetype that you want to add/know how to add, please make a pull request!
Parameters
Optional parameters:
| Command Line | Input | Description |
|---|---|---|
| -h, --help | Get description of text-prepender | |
| -p, --path | dirpath | The path to the directory which text-prepender will start at (default: '.') |
| -t, --text-file | filepath | The path to the file which text-prepender will start at (default: NOTICE) |
| -i, --extra-ignores | space delimited list | Additional file paths/names to ignore. Ex. (-i file1 path1 path2) |
| -v, --enable-verbose | Flag to turn on verbose logging to list skipped files at the end |
To Run:
# run on all files in current directory
text-prepender
# text-prepender --path path/to different directory
or
# run on a specific set of files
text-prepender file1 path/to/file2
text-prepender --text-file path/to/file
pre-commit
If you'd like text-prepender to be run automatically when making changes to files in your Git repository, you can install pre-commit and add the following text to your repositories' .pre-commit-config.yaml:
repos:
- repo: https://github.com/dontirun/text-prepender
rev: v0.1.0 # The version of text-prepender
hooks:
- id: text-prepender
# args:
# - '--text-file'
# - 'NOTICE'
Manual Build
- Clone the repo
- Build the package
pip install buildpython -m build
- Install the latest version of the package
- whl
pip install dist/text_prepender-x.x.x-py3-none-any.whl
- .tar.gz
pip install dist/text-prepender-x.x.x.tar.gz
- whl
Release files for text-prepender 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| text-prepender-0.1.0.tar.gz | 7.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| text_prepender-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.7 kB
Release files / text-prepender-0.1.0.tar.gz
| Download URL | text-prepender-0.1.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79eb25ea3f2022f6c8a4da36219ee116669c312602dceb429ade8f3b134ce4e5
|
|
BLAKE2b-256 checksum How to use checksums |
ef81b42dc7faa4b05a926d8726e295af940f7e64ee96235fde275bf402c425ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|
Release files / text_prepender-0.1.0-py3-none-any.whl
| Download URL | text_prepender-0.1.0-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e5c18ed34a26200eacd0dc1e934b9f287628a11ccf8f0f986a382a2734d9394f
|
|
BLAKE2b-256 checksum How to use checksums |
90384b8aab2d0b871ce0545d20272752558e60f59bcd306727c2cf99a5b4928a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
|