Run python scripts from inside a package without relative import error.
Project description
Insider Scripts
Purpose
Run python scripts from inside a package without relative import error.
Installation
pip install insider_scripts
Usage
Import the function define script from the insider_scripts and call it with either the depth of the script in the package, or the path of the package root.
Example layout
your_package/
|-- A_folder/
| ├── A.py
| └── script.py
|-- B_folder/
| └── B.py
Example script:\n"
from pathlib import Path
from insider_scripts import define_script
define_script(1) # or define_script(Path(__file__).parent.parent) or define_script(-1)
from .A import A
from ..B_folder.B import B
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 insider_scripts-1.0.0.tar.gz.
File metadata
- Download URL: insider_scripts-1.0.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e11a594ea3390e3f4a283ed3fcf2d659428553077c5ec91bd1d2b2fb70a0862f
|
|
| MD5 |
d237e1c5bd881f91640bc8f3658019bc
|
|
| BLAKE2b-256 |
d74f7dba43138d6b6128ce759091e09413fec616cb2196b3fdc9df9b2445b543
|
File details
Details for the file insider_scripts-1.0.0-py3-none-any.whl.
File metadata
- Download URL: insider_scripts-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd944a4fbe72f28eac04951cb8d8e870fcfcedf9ff35b513b86b2005812accfc
|
|
| MD5 |
9de085225a56c4e877b3877903f25cce
|
|
| BLAKE2b-256 |
d0cb207c44f2b556c29c3dad6b34aea94dd5498905e9d35459081770b6248129
|