Skip to main content

CLI tool to automate the creation of symbolic links in a destination directory.

Project description

pylnlst

CLI tool to automate the creation of symbolic links in a destination directory.

Why pylnlst?

Many times I find myself creating multiple symbolic links manually using Nautilus (or similar) and feeling that the process could be automated. When tried to approach such automation using bash I've failed miserably because it's very difficult to deal with file names containing spaces, brackets, or exclamation marks because escaping such characters is required.

This tool has been created to address those problems.

The idea is:

  • User creates a file with a list of absolute or relative paths, one per file/folder.
  • User invokes the tool with two arguments: the location of the file list, and the target (base) location where symbolic links will be created.
  • The tool reads the entries from the file, one by one, and creates a symbolic link in the specified target location, pointing to the original file.
  • If a file with the same name already exists, a suffix is added so that there is no name clash. A warning is displayed.

The simplest usage is as follows:

pylnlst --list-file fILELIST --dst-dir DST_DIR

You can find all the options running:

pylnlst --help

Dev notes

Most of the script functionality relies on the Typer framework. Project management relies on uv, and linting/formatting is done with Ruff.

There are currently no tests.

To check that the packaged script works as expected type:

# you must be in the directory that contains pylnlst package, not
# within pylnlst
$ uv run --directory pylnlst pylnlst --version

The application can be built with uv build and published with uv publish.

To publish to TestPyPI, adjust the version to a release candidate (e.g., x.y.z.rc)

$ rm -rf dist
$ uv build
$ uv publish \
 --publish-url https://test.pypi.org/legacy/ \
 --token <test-pypi-token-with-sufficient-scope>
NOTE:
Some of the tokens are defined on a per-project basis. Those won't work for new projects.

You will be able to test that it works by simply doing:

$ mkdir pylnlst-test
$ cd pylnlst-test
$ python -m venv .venv --upgrade-deps
$ source .venv/bin/activate
(.venv) $ pip install pylnlst==0.1.1 --extra-index-url https://test.pypi.org/simple/
(.venv) $ pylnlst --version
pylnlst 0.1.1

To publish to PyPI:

$ rm -rf dist
$ uv build
$ uv publish --token <pypi-token>

And you can test it works by doing:

You will be able to test that it works by simply doing:

$ mkdir pylnlst
$ cd pylnlst
$ python -m venv .venv --upgrade-deps
$ source .venv/bin/activate
(.venv) $ pip install pylnlst
(.venv) $ pylnlst --version
pylnlst 0.1.1

To update a dependency to a particular version:

uv add 'typer>=0.14.0' --upgrade-package typer

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

pylnlst-0.2.0.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

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

pylnlst-0.2.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pylnlst-0.2.0.tar.gz.

File metadata

  • Download URL: pylnlst-0.2.0.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.5

File hashes

Hashes for pylnlst-0.2.0.tar.gz
Algorithm Hash digest
SHA256 eef43b6b362cfb1e4b81be4b152ebe4e43fd043bf17429a7e48535f52ac21a07
MD5 19c813ee6f925da8294c117a6d0d71ca
BLAKE2b-256 07e5aaa9955f5635208eecf05cec36ed8be98b752fd7f25dca3f482e07e206c4

See more details on using hashes here.

File details

Details for the file pylnlst-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pylnlst-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.5

File hashes

Hashes for pylnlst-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1dada304443391c6be3cbf31d9415fe8a3aba9b3d64fd4a7c23b64a44f984a22
MD5 f42c8cba582e50cb8cad965f7663fa82
BLAKE2b-256 5e4098aa418330e5770f06dc5dbd047890f1a260757a29698c45accb9a13b951

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