Sibling Link for python packages.
Project description
siblink - a Python sibling package linker
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
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file siblink-1.2.2.tar.gz.
File metadata
- Download URL: siblink-1.2.2.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc4e4c11908564f7991a8e872c289cfdc647bb8fd775eac1529d9188bbf54ecc
|
|
| MD5 |
860fda9d384fa3b0afc438e2511d00d4
|
|
| BLAKE2b-256 |
7e42d279c40a9ba7cc9ad9108e57997515e5b696214a711eb2fb1f94062ea97c
|
Provenance
The following attestation bundles were made for siblink-1.2.2.tar.gz:
Publisher:
pip.yml on TreltaSev/siblink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
siblink-1.2.2.tar.gz -
Subject digest:
bc4e4c11908564f7991a8e872c289cfdc647bb8fd775eac1529d9188bbf54ecc - Sigstore transparency entry: 364724106
- Sigstore integration time:
-
Permalink:
TreltaSev/siblink@b73cb19e1d122661d4fbd919a3e581bfcc6dc325 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/TreltaSev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pip.yml@b73cb19e1d122661d4fbd919a3e581bfcc6dc325 -
Trigger Event:
release
-
Statement type:
File details
Details for the file siblink-1.2.2-py3-none-any.whl.
File metadata
- Download URL: siblink-1.2.2-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e8ca374ba00b6cc72cd4e5d5b824a45da80f00ee9ea194d310b842217bae9694
|
|
| MD5 |
34e1acf3ba3814a4e367470496561091
|
|
| BLAKE2b-256 |
09e1f2eeff4ee56ed65fb42f0766c32c6da182c43914f1b816899c1912e70642
|
Provenance
The following attestation bundles were made for siblink-1.2.2-py3-none-any.whl:
Publisher:
pip.yml on TreltaSev/siblink
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
siblink-1.2.2-py3-none-any.whl -
Subject digest:
e8ca374ba00b6cc72cd4e5d5b824a45da80f00ee9ea194d310b842217bae9694 - Sigstore transparency entry: 364724156
- Sigstore integration time:
-
Permalink:
TreltaSev/siblink@b73cb19e1d122661d4fbd919a3e581bfcc6dc325 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/TreltaSev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pip.yml@b73cb19e1d122661d4fbd919a3e581bfcc6dc325 -
Trigger Event:
release
-
Statement type: