Skip to main content

CLI to create repos

Project description

๐Ÿš€ qCradle

License: MIT PyPI version Coverage Status ci CodeFactor Renovate enabled

๐Ÿ› ๏ธ qcradle is a command line tool to create repos based on a group of templates. It has been created to speed up, simplify, and to harmonize the development of experiments and quantitative strategies.

Assuming the presence of uvx you can start the tool with

uvx qcradle

Creating a repository from the command line

qcradle is a tool inspired by Cookiecutter, but more biased towards quants, researchers, and academics.

Whether you're building entire Python packages or financial models, running simulations, or writing academic papers, qcradle helps you hit the ground running with a structured and efficient setup following the most recent standards set in 2025.

We use uv, hatch, marimo and Tectonic. We support Renovate and take full advantage of GitHub Workflows.

Each template comes with curated pre-commit hooks. We collect test reports, API documentation, and notebooks.

Letโ€™s make project setup as rigorous as your research!

๐Ÿ“š Examples

Users can interact with qcradle by either creating templates or by using existing templates to create projects. We would be delighted to list your public work here:

๐Ÿ† User projects

We would like to encourage our users to point to public repositories created with the qcradle. We start with

  • cvxball. We created badges for you

๐Ÿงฉ User templates

Please share your templates with the world!

๐Ÿ”„ Install uv and uvx

๐Ÿš€ uv is a modern, high-performance Python package manager and installer written in Rust. It serves as a drop-in replacement for traditional tools like pip and pipx. For macOS and Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

For Windows follow the official instructions

๐Ÿง  Understanding uvx

๐Ÿ” uvx is a command provided by uv to run tools published as Python packages without installing them permanently. It creates temporary, isolated environments for these tools:

uvx qcradle

This command will:

  • Resolve and install the qcradle package in a temporary environment.
  • Execute the qcradle command.

Note: If you plan to use a tool frequently, consider installing it permanently using uv:

uv tool install qcradle

Once the tool is permanently installed it is enough to start it with

qcradle

๐Ÿ“ Templates

โœจ You could create your own templates and standardize project structures across your team or organization. It's essentially a project scaffolding tool that helps maintain consistency in Python projects.

We currently offer $3$ standard templates out of the box

  • ๐Ÿ“„ The document template
  • ๐Ÿงช The experiments template
  • ๐Ÿ“ฆ The package template

๐ŸŒŸ Standard Templates

We follow the one template, one repository policy. You are encouraged to create your own templates and we give $4$ examples that may serve as inspiration

๐Ÿ“„ The document template

The template supports the fast creation of repositories of LaTeX documents. The repo can compile your LaTeX documents with every commit and put them on a dedicated branch.

๐Ÿงช The experiments template

Here we support the creation of notebooks without the ambition to release software. The repo is not minimalistic but comes with a curated set of pre-commit hooks and follows modern and established guidelines. The notebooks are based on Marimo.

๐Ÿ“ฆ The package template

The package template is most useful when the final goal is the release of software to a registry, e.g. pypi. It offers full uv support and compiles documentation into a Jupyter Book.

๐Ÿ”’ Proprietary templates

๐Ÿ› ๏ธ Creation

You can create your very own templates and we recommend to start with forking the dedicated repo for the job.

Templates rely on Jinja. At the root level the repo needs a 'copier.yml' file and a 'template' folder.

๐Ÿš€ Usage

We essentially expose the copier interface directly with minor modifications, e.g. if the user is not submitting a source template we offer to choose one of the standard templates.

Any cradle template could be used directly as the first 'template' argument

uvx qcradle --template=git@github.com:tschm/paper.git

By default, Copier (and hence the cradle) will copy from the last release found in template Git tags, sorted as PEP 440.

๐Ÿ”„ Update existing projects

Templates are moving targets in most professional setups. It is possible to update projects created with the help of the qcradle by specifying an existing path instead of a template.

uvx qcradle --dst_path=/Users/thomasschmelzer/projects/my_marimo_experiments

The tool expects a full path. Your repo should contain your previous answers in a file '.copier-answers.yml' which serve as default arguments for the questions you have been asked before. All standard templates create the file.

๐Ÿ”„ GitHub Actions

โš™๏ธ This repository provides a collection of reusable GitHub Actions that can be used by other repositories. These actions are defined in the actions directory and can be referenced in your workflows.

๐Ÿ› ๏ธ Available Actions

  • ๐Ÿ“š book: Builds and publishes a Jupyter Book
  • ๐Ÿ“ฆ build: Builds a Python package and uploads artifacts
  • ๐Ÿ“Š coverage: Generates and uploads code coverage reports
  • ๐Ÿ” deptry: Checks for dependency issues using deptry
  • ๐Ÿณ docker: Builds and pushes Docker images
  • ๐Ÿ”ง environment: Sets up Python environment with dependencies
  • ๐Ÿ“„ latex: Compiles LaTeX documents
  • ๐Ÿ“ pdoc: Generates API documentation using pdoc
  • โœ… pre-commit: Runs pre-commit hooks
  • ๐Ÿท๏ธ tag: Bumps version, creates a tag, and publishes a release
  • ๐Ÿงช test: Runs tests with pytest

๐Ÿ“‹ How to Use These Actions

You can use these actions in your GitHub workflows by referencing them with the uses keyword. For example:

jobs:
  tag:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Generate Tag
        uses: tschm/cradle/actions/tag@main
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}

Each action has its own inputs and outputs defined in its action.yml file. You can find more details by examining these files in the repository.

:warning: Private repositories

Using workflows in private repos will eat into your monthly GitHub bill. You may want to restrict the workflow to operate only when merging on the main branch while operating on a different branch or deactivate the flow.

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

qcradle-0.3.6.tar.gz (739.6 kB view details)

Uploaded Source

Built Distribution

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

qcradle-0.3.6-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file qcradle-0.3.6.tar.gz.

File metadata

  • Download URL: qcradle-0.3.6.tar.gz
  • Upload date:
  • Size: 739.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qcradle-0.3.6.tar.gz
Algorithm Hash digest
SHA256 67b6dde2052d4c180c22a97352ad13bf23616b3a6ccea93124ff013194ad2a2b
MD5 c9f5e38e36ae3d56a51422c85108bfa7
BLAKE2b-256 a638cd17ae3fdf0fdf1f37e164feefddeaec59b54af56a3cda48eeafaa56ee71

See more details on using hashes here.

Provenance

The following attestation bundles were made for qcradle-0.3.6.tar.gz:

Publisher: release.yml on tschm/cradle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qcradle-0.3.6-py3-none-any.whl.

File metadata

  • Download URL: qcradle-0.3.6-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qcradle-0.3.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c71ae718686a1e4b0921ab6edc2cef5151aee014a6a036af7ced0821390e1ed8
MD5 fa08fd2bcf0fd5f788efafc6732622d3
BLAKE2b-256 7cd13f2a29d2a816d04d949735b835259e1780195b889ed29af0819e359e4f00

See more details on using hashes here.

Provenance

The following attestation bundles were made for qcradle-0.3.6-py3-none-any.whl:

Publisher: release.yml on tschm/cradle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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