CodeGenLoader
CodeGenLoader is a Python import hook that transparently runs a code generator at import time, allowing the use of generated code without a separate compilation step. The package includes an extensible base class as well as implementations for the Protocol Buffer and Thrift code generators.
Installation
pip install codegenloader
Prerequisites
CodeGenLoader runs on Python 2 (2.5+) and 3, including pypy and jython. The base class does not have any external dependencies, but to use the Thrift or Protocol Buffer subclasses you will need the thrift or protobuf packages installed. Note that protobuf 3.0.0 (currently in alpha) is required to use protobuf on Python 3.
Example
Add the following two lines to mypackage/proto/__init__.py:
import codegenloader.protobuf __path__ = codegenloader.protobuf.make_path(__name__, ".")
Now, assuming foo.proto exists in in mypackage/proto/, you can do:
from mypackage.proto.foo_pb2 import Foo
More info
The source code is hosted at https://github.com/bdarnell/codegenloader Detailed documentation can be found at http://codegenloader.readthedocs.org
Metadata
Release files for codegenloader 0.2
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 |
|---|---|---|---|---|
| codegenloader-0.2.tar.gz | 5.0 kB | Without provenance | Details for codegenloader-0.2.tar.gz |
Release files / codegenloader-0.2.tar.gz
| Download URL | codegenloader-0.2.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d437babb803a1345b34177826493d49e12526f789c9c789f6774f937fc7de627
|
|
BLAKE2b-256 checksum How to use checksums |
b8c642b46543610ca9576753d269d316a4da9fcd1274f6e8188f216449e56fbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for codegenloader 0.2
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.