{"id":16654959,"url":"https://github.com/argmaster/autocopyright","last_synced_at":"2025-10-14T07:09:29.903Z","repository":{"id":65934068,"uuid":"602763726","full_name":"Argmaster/autocopyright","owner":"Argmaster","description":"Automatically add copyright headers at the top of source files.","archived":false,"fork":false,"pushed_at":"2024-11-22T22:24:08.000Z","size":696,"stargazers_count":1,"open_issues_count":6,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T02:55:45.633Z","etag":null,"topics":["copyright","python","python3","tools","utility"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/autocopyright/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Argmaster.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-02-16T22:21:47.000Z","updated_at":"2024-10-17T14:57:32.000Z","dependencies_parsed_at":"2024-09-07T12:27:18.474Z","dependency_job_id":"d1708623-a3f4-402d-a015-2650aee4da79","html_url":"https://github.com/Argmaster/autocopyright","commit_stats":{"total_commits":25,"total_committers":2,"mean_commits":12.5,"dds":"0.31999999999999995","last_synced_commit":"7e4602bfe5f0813c5a8bbbf4531ee2e913032289"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/Argmaster/autocopyright","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fautocopyright","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fautocopyright/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fautocopyright/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fautocopyright/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Argmaster","download_url":"https://codeload.github.com/Argmaster/autocopyright/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Argmaster%2Fautocopyright/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018206,"owners_count":26086303,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["copyright","python","python3","tools","utility"],"created_at":"2024-10-12T09:51:36.801Z","updated_at":"2025-10-14T07:09:29.877Z","avatar_url":"https://github.com/Argmaster.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# autocopyright\n\nAutocopyright is a script which was designed to automatically add copyright notices at\nthe top of source files. It uses jinja2 templates which can be automatically filled with\nvalues pulled from `pyproject.toml` and other files.\n\n## Example\n\nTo run autocopyright you must specify comment sign, directory to traverse, glob patterns\nof files to modify and path to license template.\n\n```\nautocopyright -s \"#\" -d autocopyright -g \"*.py\" -g \"*.pyi\" -l \"./templates/MIT.md.jinja2\"\n```\n\n## Templates\n\nAutocopyright uses Jinja2 templates to determine content of copyright header. Such\ntemplate is loaded from predefined destination and rendered with few special variables\navailable. Those variables are listed below:\n\n- `now` - `datetime.datetime` object holding current time (determined once, at the\n  beginning of script execution)\n\n- `pyproject` - dictionary-like object holding loaded content of `pyproject.toml` file\n  loaded from current working directory of script.\n\nTemplate for **LGPL-3.0** license could look like this:\n\n```jinja\nCopyright {{ now.year }} {{ pyproject.tool.poetry.authors[0] }}\n\nThis file is part of {{ pyproject.tool.poetry[\"name\"] }}.\n{{ pyproject.tool.poetry.repository }}\n\n{{ pyproject.tool.poetry[\"name\"] }} is free software: you can redistribute it and/or modify it under\nthe terms of the GNU Lesser General Public License as published by the Free\nSoftware Foundation, either version 3 of the License, or (at your option)\nany later version.\n\n{{ pyproject.tool.poetry[\"name\"] }} is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\nFOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more\ndetails.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with {{ pyproject.tool.poetry[\"name\"] }}. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n```\n\n## Pre-commit hook\n\nTo add this script as pre commit hook, create `.pre-commit-config.yaml` file, or append\nto existing one, following lines:\n\n```yaml\nrepos:\n  - repo: https://github.com/Argmaster/autocopyright\n    rev: \"v1.1.0\"\n    hooks:\n      - id: autocopyright\n        args:\n          [\n            -s,\n            \"#\",\n            -d,\n            \u003cyour-project-source-dir-name\u003e,\n            -g,\n            \"*.py\",\n            -l,\n            \u003cpath-to-license-template\u003e,\n          ]\n```\n\nReplace `\u003cyour-project-source-dir-name\u003e` with valid name of your project source\ndirectory, for example `source` or `src`.\n\nReplace `\u003cpath-to-license-template\u003e` with path to jinja2 template file containing\nlicense note, eg. `\"./templates/LGPL3.md.jinja2\"`. See **Templates** section for example\nof template content.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargmaster%2Fautocopyright","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fargmaster%2Fautocopyright","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fargmaster%2Fautocopyright/lists"}