Skip to main content

CLI to create repos

Project description

qCradle

License: MIT PyPI version Coverage Status ci

qcradle is a command line tool to create repos based on a group of templates.

Creating a repository from the command line

The tool is very similar to the popular Cookiecutter project.

Install gh

Please install GitHub's official command line tool gh. This tool is used to create GitHub repos from the command line.

Verify the existence of the tool and a valid SSH connection with

ssh -T git@github.com
gh --version

A new SSH connection could be established here.

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 instructions here

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 repo-launcher package in a temporary environment.
  • Execute the repo-launcher 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 $4$ standard templates out of the box

  • The document template
  • The experiments template
  • The package template
  • The R template

Standard Templates

We follow the one template, one repository policy. You are encouraged to create your own templates and we give $3$ 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.

The R template

Here we expose R Studio in a devcontainer.

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.

Each template is tested using act, e.g. we render the project template and test the workflows of the created project. This helps to avoid creating projects starting their life in a broken state.

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 repo-launcher) will copy from the last release found in template Git tags, sorted as PEP 440.

: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.1.8.tar.gz (9.1 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.1.8-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for qcradle-0.1.8.tar.gz
Algorithm Hash digest
SHA256 ab6c86e6044d38b6133e7e3c40b1bdfa41c725c90846e195ff993fc996267c5c
MD5 0ae394c642a211755d79423f7ed19d77
BLAKE2b-256 01feb51b114fb9bb19d1df00faaf89191fa26b239198f3d3501a3b7e0fd42ee3

See more details on using hashes here.

Provenance

The following attestation bundles were made for qcradle-0.1.8.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.1.8-py3-none-any.whl.

File metadata

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

File hashes

Hashes for qcradle-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 3ab1c12ad8c6370116c792ad37d301deb9e18cc149c0865426f603c76b904aa6
MD5 63fcc5d65560967d9b92a15052cec55e
BLAKE2b-256 eef4f2f669ffd2f2fe123858c0bcf772867b92f35ed68335e6d7a096b998c155

See more details on using hashes here.

Provenance

The following attestation bundles were made for qcradle-0.1.8-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