https://github.com/lukesavefrogs/bash_pymport
Python-like import, which allows to include only specific functions/variables from an external script
https://github.com/lukesavefrogs/bash_pymport
Last synced: 2 months ago
JSON representation
Python-like import, which allows to include only specific functions/variables from an external script
- Host: GitHub
- URL: https://github.com/lukesavefrogs/bash_pymport
- Owner: LukeSavefrogs
- License: apache-2.0
- Created: 2021-08-29T18:12:10.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-07T14:22:14.000Z (about 2 years ago)
- Last Synced: 2025-03-10T14:11:22.819Z (over 1 year ago)
- Language: Shell
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bash_pymport
Python-like import, which allows to include only specific functions/variables from an external script
## Why?
No real reason, just made this side project as a challenge...
## Usage
- **Global** import (same as `source`ing the module). Note that the `*` **MUST** be enclosed in **quotes** to prevent shell globbing expansion:
```Python
from test.lib import "*"
```
- **Selective** import (only a specific subset of variables/functions):
```Python
from test.lib import function_name, variable_name
```
- **Namespaced** import (variables/functions will be available as `MyNamespace.{variable_name/function_name}`):
```Python
from test.lib import function_name, variable_name as MyNamespace
```