Home

Awesome

Tyrannosaurus

Version status Version on PyPi Version on GitHub Version on Docker Hub Version on Conda-Forge
Build (Actions) Documentation status Coverage (coveralls) Coverage (codecov)
Maintainability (Code Climate) Scrutinizer Code Quality CodeFactor License DOI Created with Tyrannosaurus

An opinionated, forwards-looking Python template for 2021+.

Generate elegant, ready-to-use Python projects that have excellent continuous integration and deployment (CI/CD). Integrated with Docker Hub, the GitHub Container Registry, Azure, Conda-Forge, and an array of linting, static analysis, security testing, documentation, dependency management, and CI/CD tools, including an optional custom tool to keep all duplicate project metadata synchronized to pyproject.toml.

🎨 Design / generating a new project

This is a modern template built with Poetry, GitHub Actions, and no legacy files or tools. See below for a comparison to other tools. Also see Tyrannosaurus’s little sister science-notebook-template 🧪 for scientific publication repos.

Don’t make 55 commits trying to configure CI/CD workflows. After creating an empty GitHub repo called myproject:

pip install tyrannosaurus
tyrannosaurus new myproject --track
# if on a GitHub organization, pass --user my-org-name

After initializing your project, Tyrannosaurus will list manual steps like adding API keys. Just delete files you don’t want. Or pass --extras to include extra files like azure-pipelines config and codemeta.json.

💡 Main behavior / features

Generated projects are integrated with various tools (from PyPi) and external CI/CD/code-quality systems. GitHub Actions are used by default, but config files for Travis and Azure Pipelines are also provided. You can swap out, modify, or disable anything as you see fit. See the docs 📚 for more information.

Here’s how your new project will behave when first set up:

🎁 Full features / integrations

<details>

Temporary issue in safety ‡ This feature is experimental and does not yet support all intended sync targets.

</details>

✏️ Syncing to pyproject.toml

<details>

Note: This feature is only partly complete.

Tyrannosaurus has an optional sync command that synchronizes metadata from pyproject.toml to other files, so that all of your metadata is in pyproject.toml. There are 16 available target files, including docs/conf.py, tox.ini, .pre-commit-config.yaml, readthedocs.yml, .travis.yml, and __init__.py. Settings like dev dependencies, project version, license headers, and preferred line length can be listed exactly once, in pyproject.toml.

Tyrannosaurus itself can be included as a dependency (but is not by default). Running tyrannosaurus build will run poetry lock, synchronize project metadata (via sync), build, run tests, install, and clean up. Target files can be disabled in [tool.tyrannosaurus.targets].

</details>

🔨 Building your project locally

<details>

You can test your project locally. Install Poetry and Tox (pip install tox). Then just type tox to build artifacts and run tests. You can install locally with poetry install . or just pip install .. To create an initial Anaconda recipe or environment file, run tyrannosaurus recipe or tyrannosaurus env. After that, you can use sync to keep them up-to-date with pyproject.toml.

</details>

🎯 Similar templates and tools

There are various other templates based on cookiecutter and copier. See which best suits your needs and style.

I designed Tyrannosaurus to solve issues with existing tools. Here are features that other tools lack:

🏁 Feature table

ToolMain techsCD kickoffN int.†modern‡DockerCondasyncany-OS
TyranosaurusActions, Poetry, Toxgit, GitHub30✔️✔️✔️✔️✔️
hypermodern-pythonActions, Poetry, Noxgit, Poetry20✔️✔️
copier-poetryActions, Poetry, Makegit, manual15✔️✔️
python-package-templateActions, Poetry, Tox, Makegit, Make20✔️✔️
pyscaffoldsetuptools, ToxGitlab, manual10✔️
wemake-python-packageActions, Poetry, Makegit, Poetry10✔️
best-practicesActions, pipenvgit, pipenv10✔️✔️
python-blueprintActions, setuptools, Toxgit, manual5✔️✔️
cookiecutter-pypackageTravis, setuptools, Toxgit, manual10
cookiecutter-pylibraryTravis, setuptools, Toxgit, manual20
cookiecutter-djangoActions, setuptools, Toxgit, manual15✔️✔️
django-initActions, setuptools, Makegit, manual15✔️✔️
docker-scienceMake, Docker, setuptoolsno CI/CD15✔️
science-notebook-templateCondano CI/CD5✔️✔️

Notes:

<details>

N int.: Approximate number of built-in integrations with tools and standards. What counts is very roughly defined. Modern: Lacks legacy files and tools. I’m including Make, setuptools, pipenv, and some others. Note: copier syncs with a remote template. It’s a neat idea that Tyrannosaurus lacks.

Some of the packages in the table above need more explanation:

</details>

✨ Projects made with Tyrannosaurus

<details>

These are some example projects that were generated with Tyrannosaurus:

</details>

🍁 Contributing

New issues and pull requests are welcome. Please refer to the contributing guide and security policy. Generated with tyrannosaurus: tyrannosaurus new tyrannosaurus

                                              .++++++++++++.
                                           .++HHHHHHH^^HHH+.
                                          .HHHHHHHHHH++-+-++.
                                         .HHHHHHHHHHH:t~~~~~
                                        .+HHHHHHHHHHjjjjjjjj.
                                       .+NNNNNNNNN/++/:--..
                              ........+NNNNNNNNNN.
                          .++++BBBBBBBBBBBBBBB.
 .tttttttt:..           .++BBBBBBBBBBBBBBBBBBB.
+tt+.      ``         .+BBBBBBBBBBBBBBBBBBBBB+++cccc.
ttt.               .-++BBBBBBBBBBBBBBBBBBBBBB++.ccc.
+ttt++++:::::++++++BBBBBBBBBBBBBBBBBBBBBBB+..++.
.+TTTTTTTTTTTTTBBBBBBBBBBBBBBBBBBBBBBBBB+.    .ccc.
  .++TTTTTTTTTTBBBBBBBBBBBBBBBBBBBBBBBB+.      .cc.
    ..:++++++++++++++++++BBBBBB++++BBBB.
           .......      -LLLLL+. -LLLLL.
                        -LLLL+.   -LLLL+.
                        +LLL+       +LLL+
                        +LL+         +ff+
                        +ff++         +++:
                        ++++: