A nifty tool for renaming or cloning your KiCad project.
Project description
rename-kicad-project
rename-kicad-project is a nifty tool for renaming or cloning your KiCad (v4, v5) project.
Install
python3 -m pip install --user rename-kicad-project
Or with pipx,
pipx install rename-kicad-project
Usage
# 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
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.
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;
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.
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
.
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;
- In the given source directory, glob
*.pro
files and based on the first found one, determine the current project name. (${PROJECT_NAME}.pro
) - Determine target files with globbing
${PROJECT_NAME}.*
and including some special files likefp-lib-table
. - 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rename-kicad-project-1.0.0rc2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd3f81e67beea4a3a13a10c28ac1afe17be51592075623fa57655f2252a43fe0 |
|
MD5 | c50b3b8fd8385ecd5fea439c49c25ba6 |
|
BLAKE2b-256 | 8dbb6d963a0de9673b922342c0d798cc15ac58cf79a96eaf86ad8c5eb85aeb20 |
Hashes for rename_kicad_project-1.0.0rc2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff381530619e37ff4f949b5ba1428f6ea99edb21ddcf41a4977c48cb8ac9c72b |
|
MD5 | 903d6e57f3a0de719c84dad75900488a |
|
BLAKE2b-256 | 8ab28bb275dc6d377696072b1b18a9d15df054f74bc336e75d5e047f7d1fbcff |