stringimporter
stringimporter lets you import raw string as real Python modules
How to use
You can read the tests (in tests directory) or copy the following code.
import stringimporter
module_from_thin_air = """
def multiply_by_2():
return lambda x: 2*x"""
loader, mymodule = stringimporter.import_str('yihaaa', module_from_thin_air)
hello_2 = mymodule.multiply_by_2()("hello ")
Dependances
None
Compatibility
Python 3. I don’t know (yet?) how to emulate importlib.abc.SourceLoader on Python 2.7.
Metadata
Release files for stringimporter 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stringimporter-0.1.4.tar.gz | 1.8 kB | Without provenance | Details for stringimporter-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stringimporter-0.1.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for stringimporter-0.1.4-py2.py3-none-any.whl |
Total release size: 4.5 kB
Release files / stringimporter-0.1.4.tar.gz
| Download URL | stringimporter-0.1.4.tar.gz |
|---|---|
| Size | 1.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
339306b012ac77046c93b7dcfd93ce84dc3f47cfce645dec87fd7316f32e75a7
|
|
BLAKE2b-256 checksum How to use checksums |
07de27ef935a2b63c68755c22acc463a50b9cea6c500cc8d20a3fe7e46a441bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / stringimporter-0.1.4-py2.py3-none-any.whl
| Download URL | stringimporter-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 2.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
1a0e6f54ba3e334d733776f0f7fb1d24c449fb56514fe0690cb211150a124706
|
|
BLAKE2b-256 checksum How to use checksums |
b382f8b6e0f54fa086bd22edebff32b5262aa43436dd3f3616bb72e5c7543535
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for stringimporter 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.