genxcode
genxcode generates boilerplate code from templates.
Use it to create starter code for templates like PyTorch, CUDA, and Hugging Face, then customize the generated project for your use case.
Install
pip install genxcode
CLI Workflow
Run:
genxcode init pytorch
Or omit the template argument and it prompts in the terminal:
Enter the name of template:
Accepted inputs include canonical names and aliases:
pytorchcudahuggingfacehfllm
hf resolves to the Hugging Face template.
If you enter pytorch, genxcode writes genxcode.yaml like this:
# Generated by `genxcode init pytorch`
template: pytorch
name: pytorch
arch: mlp
input_dim: 784
output_dim: 10
hidden:
- 256
- 128
activation: relu
metrics:
- accuracy
- loss
prod: false
lr: 0.001
epochs: 10
batch_size: 32
device: cpu
Edit the values you want, then generate the project:
genxcode apply
This creates a folder named after name and writes the boilerplate inside it. With the default config above, the output lands in ./pytorch/.
Output:
pytorch/
src/
__init__.py
config.py
models.py
data.py
train.py
predict.py
main.py
requirements.txt
Available templates:
pytorch: PyTorch training scaffoldcuda: CUDA kernel scaffoldhuggingface: Hugging Face LLM scaffold
template: is required in genxcode.yaml, so apply always knows which scaffold to render.
To upgrade the installed package in the current environment:
genxcode update
Then run the generated boilerplate:
python main.py
Metadata
Release files for genxcode 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| genxcode-0.1.5.tar.gz | 61.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| genxcode-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 170.3 kB
Release files / genxcode-0.1.5.tar.gz
| Download URL | genxcode-0.1.5.tar.gz |
|---|---|
| Size | 61.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70e1171beb418d6895516defd354fcb75bdab0ab6d6a37448420573ad9ee421e
|
|
BLAKE2b-256 checksum How to use checksums |
0aac967a29f399ea622f2962cdc889c94e5408a7bcd23d348faea43469563308
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.19
|
Release files / genxcode-0.1.5-py3-none-any.whl
| Download URL | genxcode-0.1.5-py3-none-any.whl |
|---|---|
| Size | 108.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
46631f51b700348324be07d928071e11733e4b9ceb0b2f507d58fe7ddcb81894
|
|
BLAKE2b-256 checksum How to use checksums |
740e7060c4f3d4d31d1673b230b9861dc0626d50f229d0dd12b8bdd774a9d644
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.7.19
|