dot.py is a minimalist python script for managing dotfiles via symbolic links.
Project description
dot.py
dot.py is a minimalist python script for managing dotfiles via symbolic links. Inspired by bashdot, it supports multiple profiles and customizable file templates with variables. No external dependencies, just python 3.6+.
Install and Help
pip install dot.py
dot.py --help
Quick Start
-
Create your initial profile. For example, you can create a directory called
default
.mkdir default
-
Add any files you would like linked into your home when this profile is linked.
mv ~/.bashrc default/bashrc
-
Link the profile. When you link, dot.py prepends a dot, in front of the original file name, to the linked file. Below,
default/bashrc
will be linked to~/.bashrc
.dot.py link default
-
You can safely re-run the link command to link newly added files. Store this profile in a cloud drive or source control. Repeat for additional profiles.
Templates
Values which need to be set in a file when dot.py is run can be placed in a template.
-
Append
.template
to any files which should be rendered. For example, assume you have a filedefault/bashrc.template
containing:export SECRET_KEY=$ENV_SECRET_KEY
-
The rendered files will be created in the same directory, and have
.template
replaced with.rendered
. In the example, you can run the following to set the valueENV_SECRET_KEY
when linking the default profile. (A leading space tells the fish shell to drop the line from its history.)env ENV_SECRET_KEY=test1234 dot.py link default
-
The rendered file will be linked into the home with the
.rendered
suffix removed and a dot prepended. In the example, this will result in the rendered filedefault/bashrc.rendered
being created and linked to~/.bashrc
with the below contents.export SECRET_KEY=test1234
-
Be sure to include
**/*.rendered
in.gitignore
if you put your dotfiles into a git repository.
Development
For linting, building and testing, see the workflow.
Project details
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
File details
Details for the file dot_py-1.3.0.tar.gz
.
File metadata
- Download URL: dot_py-1.3.0.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 754d8c14605b3424bfcd1e5110704595d9a6b9745e5469c2bbc8292f02209608 |
|
MD5 | 5a5c478b728a822a88aa911c79bbd722 |
|
BLAKE2b-256 | 0677a389dc0e378c3d8cdf49d076eed189c4ece31029e1936025d1435637a6d1 |
File details
Details for the file dot_py-1.3.0-py3-none-any.whl
.
File metadata
- Download URL: dot_py-1.3.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aaf897b94ff790a7d50f2257b46bda1c3fdc92b2463921b3da411823ef630f72 |
|
MD5 | 2da3eb7a59605c1c7ca62ba43589ab6e |
|
BLAKE2b-256 | a91249c7b67a0cc2f55b3a2bdb1a85c6bc17588664c30fc38950213e52a8c2af |