Skip to main content

Python 3.13 Code style: black

PythonLicenseUpdater

Simple tool that updates your python files license headers for the given directories. By default it will skip init.py.

How to use it?

As Docker container

  1. Checkout or clone our repository.

  2. Build the container (with podman or docker):

podman build -t pylicup
  1. Run the container mounting the license and the directories to update at the given locations:
podman run -v path/to/your/license/file:/mnt/license -v path/to/your/directory/to/update:/mnt/update pylicup
  1. If you want to update multiple directories you can do it as:
podman run -v path/to/your/license/file:/mnt/license -v path/to/your/directory/to/update:/mnt/update/dir_1 -v path/to/your/other/directory/to/update:/mnt/update/dir_2  pylicup

[!IMPORTANT] Our docker container does not support (yet) replacing of an old license.

As Python package

Installation.

  1. With pip:
pip install pylicup
  1. With latest version from GitHub:
pip install git+https://github.com/Carsopre/PythonLicenseUpdater.git 
  1. With custom version from GitHub:
pip install git+https://github.com/Deltares/PythonLicenseUpdater.git@v0.0.1

Python usage

The following command should be used.

python pylicup -l <path_to_your_license_file> -d <path_to_directory_with_python_files>
  • <path_to_your_licenses_file> List of licenses, the first one will replace the ones that follow (in case present) or simply added at the top.
  • <path_to_directory_with_python_files> List of arguments representing paths to the directories containing python files.

Examples

Given the following directory hierarchy:

license_manager.py
|-src\
    |-__init__.py
    |-main.py
    |-utils.py
|-test\
    |-__init__.py
    |-test_main.py
    |-test_utils.py
|-setup.py
|-my_license.txt
|-my_newer_license.txt
  1. The following command will update the license for src\main.py and src\utils.py:
python license_manager.py -l my_license.txt -d src
  1. Whereas executing the following command will result in updating the license header for src\main.py, src\utils.py, test\test_main.py and test\test_utils.py:
python license_manager.py -l my_license.txt -d src test
  1. Last, if we want to replace an existing license header with a new one, we would do the following command:
python license_manager.py -l {NEW_LICENSE} {OLD_LICENSE} -d src

Metadata

Release files for pylicup 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylicup 0.3.0
File Size Uploaded
pylicup-0.3.0.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylicup 0.3.0
File Interpreter ABI Platform
pylicup-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.9 kB

Release files / pylicup-0.3.0.tar.gz

Download URL pylicup-0.3.0.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2a578238eb3f72df4ef3a9282d0aa4e6256cf7b64eb4c9f7abecd28b4639700f
BLAKE2b-256 checksum
How to use checksums
59baa81c7a55439e3f58c17059672ea7879900eb26d29e13b3b082816830eaa3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / pylicup-0.3.0-py3-none-any.whl

Download URL pylicup-0.3.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97040e87304de51f872280502d31c6f35ab254673232ba7adf025e356c5fbd8d
BLAKE2b-256 checksum
How to use checksums
711da482c5de043d07e5e3fb794c2b2f6d7c07419e7f437edec39e55783ef71d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page