Skip to main content

Generates boilerplate code from templates.

Project description

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:

  • pytorch
  • cuda
  • huggingface
  • hf
  • llm

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 scaffold
  • cuda: CUDA kernel scaffold
  • huggingface: 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

genxcode-0.1.5.tar.gz (61.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

genxcode-0.1.5-py3-none-any.whl (108.7 kB view details)

Uploaded Python 3

File details

Details for the file genxcode-0.1.5.tar.gz.

File metadata

  • Download URL: genxcode-0.1.5.tar.gz
  • Upload date:
  • Size: 61.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for genxcode-0.1.5.tar.gz
Algorithm Hash digest
SHA256 70e1171beb418d6895516defd354fcb75bdab0ab6d6a37448420573ad9ee421e
MD5 c5bd648ffb7e0ad577a7ef66b548cede
BLAKE2b-256 0aac967a29f399ea622f2962cdc889c94e5408a7bcd23d348faea43469563308

See more details on using hashes here.

File details

Details for the file genxcode-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: genxcode-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 108.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for genxcode-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 46631f51b700348324be07d928071e11733e4b9ceb0b2f507d58fe7ddcb81894
MD5 93b8ef8ab102d315b8fc18ec6f278280
BLAKE2b-256 740e7060c4f3d4d31d1673b230b9861dc0626d50f229d0dd12b8bdd774a9d644

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page