Welcome to copyright-claim’s documentation!¶
Indices and tables¶
The copyright_claim module¶
It has two functions add_claim and remove_claim that are wrapped together by the third and last function main. This last one is called when the file copyright_claim.py is executed by python and allows terminal interaction with the module. Use the –help flag to get details on this terminal aspect.
The same script is made available through the terminal command:
copyright-claim
upon installation of the package copyright-claim with pip.
Functions:
|
Add a copyright claim to a file. |
|
Remove a copyright claim previously added by add_claim. |
|
Wraps everything to form a terminal command. |
- copyright_claim.add_claim(file_path, claim_path, comment_symbol='# ', start_string='COPYRIGHT CLAIM', end_string='END OF COPYRIGHT CLAIM')[source]¶
Add a copyright claim to a file.
- Parameters:
file_path (str) – The path to the file to be treated.
claim_path (str) – The path to a file containing the claim text string.
start_string (str, optional) – A string to mark the beginning of the copyright claim block. Defaults to “COPYRIGHT CLAIM”.
end_string (str, optional) – A string to mark the end of the copyright claim block. Defaults to “END OF COPYRIGHT CLAIM”.
comment_symbol (str, optional) – The symbol that marks comment lines in the treated files. Defaults to “# “.
- copyright_claim.remove_claim(file_path, comment_symbol='# ', start_string='COPYRIGHT CLAIM', end_string='END OF COPYRIGHT CLAIM')[source]¶
Remove a copyright claim previously added by add_claim.
- Parameters:
file_path (str) – The path to the file to be treated.
start_string (str, optional) – The start_string used by add_claim when inserting the claim. Defaults to “COPYRIGHT CLAIM”.
end_string (str, optional) – The end_string used by add_claim when inserting the claim. Defaults to “END OF COPYRIGHT CLAIM”.
comment_symbol (str, optional) – The comment_symbol used by add_claim when inserting the claim. Defaults to “# “.