Skip to main content

dot.py is a minimalist python script for managing dotfiles via symbolic links.

Project description

dot.py

dot.py is a minimalist one-file 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.10+.

Quick Start

  1. Install and run with dot.py below

    pip install dot.py
    

    or use uv

    uvx --python 3.10 --from dot-py dot.py -h
    

    or download the script directly and run with ~/dot.py below

    wget https://raw.githubusercontent.com/vincentqb/dot.py/main/dot.py -O ~/dot.py && chmod u+x ~/dot.py
    
  2. Create your initial profile. For example, you can create a directory called default.

    mkdir default
    
  3. Add any files you would like linked into your home when this profile is linked.

    mv ~/.bashrc default/bashrc
    
  4. 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
    
  5. You can safely re-run 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.

  1. Append .template to any files which should be rendered. For example, assume you have a file default/bashrc.template containing:

    export SECRET_KEY=$ENV_SECRET_KEY
    
  2. 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 value ENV_SECRET_KEY when linking the default profile.

    env ENV_SECRET_KEY=test1234 dot.py link default
    
  3. 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 file default/bashrc.rendered being created and linked to ~/.bashrc with the below contents.

    export SECRET_KEY=test1234
    
  4. 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.

Test

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

dot_py-1.6.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dot_py-1.6.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file dot_py-1.6.0.tar.gz.

File metadata

  • Download URL: dot_py-1.6.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dot_py-1.6.0.tar.gz
Algorithm Hash digest
SHA256 09788f712418f42cc6c0df61d9e597bef8fd5dc50c0d92ac7cd0d33c0a631b5e
MD5 f2d80e566f3a58450303506b68b5a7ab
BLAKE2b-256 6707863eb6ce23f2ca98ff0a44a73086bc0521e23f1bde90642ac920840c81c2

See more details on using hashes here.

File details

Details for the file dot_py-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: dot_py-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.12 {"installer":{"name":"uv","version":"0.11.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for dot_py-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1df009656c0569700d981e51960f2eff5439f2598b0a3651015a66f1911eb2fe
MD5 a59f2562dd008493d2dbb7945162da1a
BLAKE2b-256 f3b2414aa7a406b4c169b45a3e06851d209da83b9e7d8c628ef3e2f11ff263db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page