Import from other languages
Project description
libimportx-python
Python implementation of libimportx
Usage
this is a very simple library. there are many functions and classes but you are
supposed to use these two: importx and exportx. everything else is used
under the hood to make it seamless.
exportx
Call this function AFTER all your functions are defined but BEFORE the logic
that you want to run when the function is not importx'ed. This function will
allow the file to be importx'ed. If the file isnt being importx'ed the
function will return False and execution continues as normal. But if it is,
the function blocks and does not return (it exits when the thing importing this
exits or throws an error).
importx
Use this function to import a file that calls exportx. It takes in the
filepath as an argument. To run the file, it tries these in order:
- If there is an optional
cmdargument, it uses that, replacing$INwith the path to the file and$OUTwith the path to a temporary file. - It checks the
LIBIMPORTX_DEFAULT_CMD_<extension>(uppercase) env variable for a command replacing$IN$OUT. - If the first line of the file starts with
#!or//!, it uses the rest of the line as the command and appends the filename as an argument (without replacing$INor$OUT). - If the first line of the file starts with
##!or///!, it uses the rest of the line as a command and replaces$IN$OUT - It checks the file extension and looks for a default command.
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 libimportx-1.0.2.tar.gz.
File metadata
- Download URL: libimportx-1.0.2.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c45334729e839c3c13389fabd4aff7eb9d9114bb1e29976384773d0bec22187
|
|
| MD5 |
09063904e3c5efc5705cc20a661b3b50
|
|
| BLAKE2b-256 |
32c5d574df3e631da4285af2b5bc00fafcfde9b7458b7c339030f36049488378
|
File details
Details for the file libimportx-1.0.2-py3-none-any.whl.
File metadata
- Download URL: libimportx-1.0.2-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f50bfdb9fee632d2b8445387069973a8c17e5517d481c5cb1d442afd84b5e914
|
|
| MD5 |
7ea2e9097c5040798f5c7a35485a5177
|
|
| BLAKE2b-256 |
b874b1fefb32952fc5cddf8b5c7a99582e84192064ca8233d3eacab1094c7b00
|