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 usage is as follows:

pylnlst --file-list fILELIST --dst DST_DIR

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:

$ 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>

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.1.1.tar.gz (6.6 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.1.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pylnlst-0.1.1.tar.gz
Algorithm Hash digest
SHA256 62223de85476abb2904de1fb88c92df390223c598fcc2f352172315591a8b10c
MD5 b62df0a457204cb082b2512b823bfd57
BLAKE2b-256 57b2afe35cc2145af4b17497c98e64a9fd4217a888fc25b02cf6c90f5062a296

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pylnlst-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a068e9c31ff5281ecd2deb5a4dbba97932ffff6137a65d13b2653cce1b093fd2
MD5 c02fba584d738efeeeb1adfae4f72ac2
BLAKE2b-256 d18b6d958d65865368ea2fa86b06dadd6ac9a63264eaae1ec73626e36abedc73

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