# rename-kicad-project
[![PyPI version](https://badge.fury.io/py/rename-kicad-project.svg)](https://badge.fury.io/py/rename-kicad-project)
[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/rename-kicad-project.svg)](https://pypi.python.org/pypi/rename-kicad-project/)
[![CI](https://github.com/likeablob/rename-kicad-project/actions/workflows/ci.yml/badge.svg)](https://github.com/likeablob/rename-kicad-project/actions/workflows/ci.yml)
[![codecov](https://codecov.io/gh/likeablob/rename-kicad-project/branch/main/graph/badge.svg)](https://codecov.io/gh/likeablob/rename-kicad-project)
**rename-kicad-project** is a nifty tool for renaming or cloning your KiCad (v4, v5) project.
## NOTE: From KiCad v6, renaming/cloning has been officially supported. Try `File -> Save As...`.
## Install
```sh
python3 -m pip install --user rename-kicad-project
```
Or with [pipx](https://github.com/pypa/pipx),
```sh
pipx install rename-kicad-project
```
## Usage
```sh
# Show helps
rename-kicad-project --help
# Show helps of `rename` sub-command (see below)
rename-kicad-project rename --help
```
Or you can invoke this tool by
```sh
python3 -m rename_kicad_project --help
```
## `rename`
In the following example, `../foo/old_project_name{.pro, .sch, ...}` will be renamed as `../foo/new_project_name.pro`, ..., respectively.
```sh
rename-kicad-project rename ../foo new_project_name
# ls ../foo
# new_project_name.pro new_project_name.sch, ...
```
You may want to run the command above with `--dry-run` (`-n`) beforehand;
```sh
rename-kicad-project -n rename ../foo new_project_name
# Renaming: /path/to/old_project_name.kicad_pcb as new_project_name.kicad_pcb
# ...
```
## `clone`
In the following example, `./foo/old_project_name{.pro, .sch, ...}` will be cloned into `/tmp/bar/new_project_name.pro`, ..., respectively.
```sh
rename-kicad-project clone ./foo /tmp/bar -p new_project_name
# ls /tmp/bar
# new_project_name.pro new_project_name.sch, ...
```
You can omit `-p` to let the tool infer the new project name like `/tmp/bar/bar.pro`.
```sh
rename-kicad-project clone ./foo /tmp/bar
# ls /tmp/bar
# bar.pro bar.sch, ...
```
Note that `/tmp/bar` will be automatically created if it doesn't exist.
And as you expected, `--dry-run` also works with `clone`.
## How it works
For the folks who wouldn't want to rely on someone's script, here is a basic explanation of how this tool works;
1. In the given source directory, glob `*.pro` files and based on the first found one, determine the current project name. (`${PROJECT_NAME}.pro`)
2. Determine target files with globbing `${PROJECT_NAME}.*` and including some special files like `fp-lib-table`.
3. Rename the target files in place (`rename`) or copy the files into the specified destination (`clone`). That' it!
## License
MIT
## Alternatives
- https://github.com/bobc/KiRename
- As of 2021-12, it only runs on Python 2.
Raw data
{
"_id": null,
"home_page": "https://github.com/likeablob/rename-kicad-project",
"name": "rename-kicad-project",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "kicad",
"author": "likeablob",
"author_email": "46628917+likeablob@users.noreply.github.com",
"download_url": "https://files.pythonhosted.org/packages/8a/7f/3374fe28f1843f94e5200f9470c44e56f7c3daf00a7baf005775c542ebd3/rename_kicad_project-1.1.0.tar.gz",
"platform": null,
"description": "# rename-kicad-project\n[![PyPI version](https://badge.fury.io/py/rename-kicad-project.svg)](https://badge.fury.io/py/rename-kicad-project)\n[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/rename-kicad-project.svg)](https://pypi.python.org/pypi/rename-kicad-project/)\n[![CI](https://github.com/likeablob/rename-kicad-project/actions/workflows/ci.yml/badge.svg)](https://github.com/likeablob/rename-kicad-project/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/likeablob/rename-kicad-project/branch/main/graph/badge.svg)](https://codecov.io/gh/likeablob/rename-kicad-project)\n\n**rename-kicad-project** is a nifty tool for renaming or cloning your KiCad (v4, v5) project.\n\n## NOTE: From KiCad v6, renaming/cloning has been officially supported. Try `File -> Save As...`.\n\n## Install\n```sh\npython3 -m pip install --user rename-kicad-project\n```\nOr with [pipx](https://github.com/pypa/pipx),\n```sh\npipx install rename-kicad-project\n```\n\n## Usage\n```sh\n# Show helps\nrename-kicad-project --help\n\n# Show helps of `rename` sub-command (see below)\nrename-kicad-project rename --help\n```\nOr you can invoke this tool by \n```sh\npython3 -m rename_kicad_project --help\n```\n\n## `rename`\nIn the following example, `../foo/old_project_name{.pro, .sch, ...}` will be renamed as `../foo/new_project_name.pro`, ..., respectively.\n```sh\nrename-kicad-project rename ../foo new_project_name\n\n# ls ../foo\n# new_project_name.pro new_project_name.sch, ...\n```\nYou may want to run the command above with `--dry-run` (`-n`) beforehand;\n```sh\nrename-kicad-project -n rename ../foo new_project_name\n# Renaming: /path/to/old_project_name.kicad_pcb as new_project_name.kicad_pcb\n# ...\n```\n\n## `clone`\nIn the following example, `./foo/old_project_name{.pro, .sch, ...}` will be cloned into `/tmp/bar/new_project_name.pro`, ..., respectively.\n```sh\nrename-kicad-project clone ./foo /tmp/bar -p new_project_name\n\n# ls /tmp/bar\n# new_project_name.pro new_project_name.sch, ...\n```\nYou can omit `-p` to let the tool infer the new project name like `/tmp/bar/bar.pro`.\n```sh\nrename-kicad-project clone ./foo /tmp/bar\n\n# ls /tmp/bar\n# bar.pro bar.sch, ...\n```\nNote that `/tmp/bar` will be automatically created if it doesn't exist. \nAnd as you expected, `--dry-run` also works with `clone`.\n\n## How it works\nFor the folks who wouldn't want to rely on someone's script, here is a basic explanation of how this tool works;\n1. In the given source directory, glob `*.pro` files and based on the first found one, determine the current project name. (`${PROJECT_NAME}.pro`)\n2. Determine target files with globbing `${PROJECT_NAME}.*` and including some special files like `fp-lib-table`.\n3. Rename the target files in place (`rename`) or copy the files into the specified destination (`clone`). That' it!\n\n## License\nMIT\n\n## Alternatives\n- https://github.com/bobc/KiRename\n - As of 2021-12, it only runs on Python 2.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A nifty tool for renaming or cloning your KiCad project.",
"version": "1.1.0",
"split_keywords": [
"kicad"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6da82de534f7faedd4532460f722025771c1e96557745f30e3f35db295e2c581",
"md5": "867c049212af4131b7ba2d2c0f2a0ff0",
"sha256": "89b48ef05965efa26f6ebb0419c3c73c6eaafef744dda2801ad74efb80018ec7"
},
"downloads": -1,
"filename": "rename_kicad_project-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "867c049212af4131b7ba2d2c0f2a0ff0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 6345,
"upload_time": "2023-02-11T17:19:00",
"upload_time_iso_8601": "2023-02-11T17:19:00.765324Z",
"url": "https://files.pythonhosted.org/packages/6d/a8/2de534f7faedd4532460f722025771c1e96557745f30e3f35db295e2c581/rename_kicad_project-1.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8a7f3374fe28f1843f94e5200f9470c44e56f7c3daf00a7baf005775c542ebd3",
"md5": "14517f0625d0878523c77b86e5af3f70",
"sha256": "f0d925f8fb8b7097b889f709e7fbbe6953278e34addbccaeb15f7faa71b30188"
},
"downloads": -1,
"filename": "rename_kicad_project-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "14517f0625d0878523c77b86e5af3f70",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 5694,
"upload_time": "2023-02-11T17:19:02",
"upload_time_iso_8601": "2023-02-11T17:19:02.438379Z",
"url": "https://files.pythonhosted.org/packages/8a/7f/3374fe28f1843f94e5200f9470c44e56f7c3daf00a7baf005775c542ebd3/rename_kicad_project-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-11 17:19:02",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "likeablob",
"github_project": "rename-kicad-project",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "rename-kicad-project"
}