Skip to main content

siblink - a Python sibling package linker

Version Badge

Installation

pip install siblink

OR

git clone git@github.com:TreltaSev/siblink.git
cd ./siblink
pip install .

Usage

**siblink** has some commands that you should familiarize yourself with, since siblink is built over with the click package, after installation, you can run

siblink --help

Usage

A package in pythons eyes is just a folder containing a __init__.py file, it makes variables easily discoverable between "packages". The way python knows what files it should make discoverable to you is through its built-in sys.path variable. **siblink** just adds a few more directories, the one behind your current directory, as well as every directory between the .py file and your working directory, which in turn, adds your current directories' siblings together.

Say you had two directories within the same directory.

parent
├───package_a
│       __init__.py
│
└───package_b
        main.py

the __init__.py file contains some_variable, you want to get that variable from main.py, if you attempt to run main.py normally, this would be your result.

python ./parent/package_b/main.py

Traceback (most recent call last):
  File ".\parent\package_b\main.py", line 1, in <module>
    import package_a
ModuleNotFoundError: No module named 'package_a'

You could always mutate the sys.path variable yourself but I've found that its annoying to do that if you have hundreds of files.

**siblink** automatically does this for you, now if you were to run main.py with **siblink**, this is your result.

siblink run ./parent/package_b/main.py

10

Metadata

Release files for siblink 1.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for siblink 1.2.2
File Size Uploaded
siblink-1.2.2.tar.gz 10.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for siblink 1.2.2
File Interpreter ABI Platform
siblink-1.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 22.6 kB

Release history Release notifications | RSS feed

This release

1.2.2 This release

2 release files

1.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page