repocutter


Namerepocutter JSON
Version 0.6.1 PyPI version JSON
download
home_pagehttps://pypi.org/project/repocutter/
SummaryCheckout repos to current cookiecutter config
upload_time2023-01-24 07:30:37
maintainerjshwi
docs_urlNone
authorjshwi
requires_python>=3.8,<4.0
licenseMIT
keywords config cookiecutter jinja2 repo template
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            repocutter
==========
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
    :target: https://opensource.org/licenses/MIT
    :alt: License
.. image:: https://img.shields.io/pypi/v/repocutter
    :target: https://pypi.org/project/repocutter/
    :alt: PyPI
.. image:: https://github.com/jshwi/repocutter/actions/workflows/ci.yml/badge.svg
    :target: https://github.com/jshwi/repocutter/actions/workflows/ci.yml
    :alt: CI
.. image:: https://results.pre-commit.ci/badge/github/jshwi/repocutter/master.svg
   :target: https://results.pre-commit.ci/latest/github/jshwi/repocutter/master
   :alt: pre-commit.ci status
.. image:: https://github.com/jshwi/repocutter/actions/workflows/codeql-analysis.yml/badge.svg
    :target: https://github.com/jshwi/repocutter/actions/workflows/codeql-analysis.yml
    :alt: CodeQL
.. image:: https://codecov.io/gh/jshwi/repocutter/branch/master/graph/badge.svg
    :target: https://codecov.io/gh/jshwi/repocutter
    :alt: codecov.io
.. image:: https://readthedocs.org/projects/repocutter/badge/?version=latest
    :target: https://repocutter.readthedocs.io/en/latest/?badge=latest
    :alt: readthedocs.org
.. image:: https://img.shields.io/badge/python-3.8-blue.svg
    :target: https://www.python.org/downloads/release/python-380
    :alt: python3.8
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black
    :alt: Black
.. image:: https://img.shields.io/badge/linting-pylint-yellowgreen
    :target: https://github.com/PyCQA/pylint
    :alt: pylint
.. image:: https://snyk.io/test/github/jshwi/repocutter/badge.svg
    :target: https://snyk.io/test/github/jshwi/repocutter/badge.svg
    :alt: Known Vulnerabilities

Checkout repos to current cookiecutter config
---------------------------------------------

Checkout one or more repos to current `cookiecutter <https://github.com/cookiecutter/cookiecutter>`_ config

This will make changes to local repositories, hopefully preserving their history

Ideally only the working tree will change

Ignored files should be backed up

Use with caution

Usage
-----

.. code-block:: console

    usage: repocutter [-h] [-v] [-a] [-c] [-b REV,NEW] [-i LIST] PATH [REPOS [REPOS ...]]

    Checkout repos to current cookiecutter config

    positional arguments:
      PATH                          path to cookiecutter template dir
      REPOS                         repos to run cookiecutter over

    optional arguments:
      -h, --help                    show this help message and exit
      -v, --version                 show program's version number and exit
      -a, --accept-hooks            accept pre/post hooks
      -c, --gc                      clean up backups from previous runs
      -b REV,NEW, --branch REV,NEW  checkout new branch from existing revision
      -i LIST, --ignore LIST        comma separated list of paths to ignore, cookiecutter vars are allowed

Configuration
-------------

Currently only written for a configuration exactly like below

Technically a repo would not need to be a `poetry <https://github.com/python-poetry/poetry>`_ project if the below section exists within its pyproject.toml file

This is the only use case at this time (If there are any other configurations you would like added please leave an `issue <https://github.com/jshwi/repocutter/issues>`_)

Each repository's pyproject.toml file will be parsed for data to recreate its working tree

A ``poetry`` section in the project's pyproject.toml file that looks like the following...

.. code-block:: toml

    [tool.poetry]
    description = "Checkout repos to current cookiecutter config"
    keywords = [
      "config",
      "cookiecutter",
      "jinja2",
      "repo",
      "template"
    ]
    name = "repocutter"
    version = "0.2.0"

...will temporarily write to the ``cookiecutter`` project's cookiecutter.json file until the repo is created

.. code-block:: json

    {
      "project_name": "repocutter",
      "project_version": "0.2.0",
      "project_description": "Checkout repos to current cookiecutter config",
      "project_keywords": "config,cookiecutter,jinja2,repo,template",
    }

The above configuration will reduce the diff, but it will still work if your config is not exactly the same

Why?
----
As time goes on, and you use ``cookiecutter`` for new projects, you will make more and more changes to your ``cookiecutter`` repo

You will find these new project layouts are preferable to your older, more outdated, projects

If you have a project layout configured with ``cookiecutter`` then it's likely you will want this layout for all your projects

Configuring your existing projects manually is even more tedious than configuring a new project manually, especially if you have a lot of them

By checking out your projects to your configured ``cookiecutter`` layout, you can use whatever diff tool you use to rollback any undesired changes

            

Raw data

            {
    "_id": null,
    "home_page": "https://pypi.org/project/repocutter/",
    "name": "repocutter",
    "maintainer": "jshwi",
    "docs_url": null,
    "requires_python": ">=3.8,<4.0",
    "maintainer_email": "stephen@jshwisolutions.com",
    "keywords": "config,cookiecutter,jinja2,repo,template",
    "author": "jshwi",
    "author_email": "stephen@jshwisolutions.com",
    "download_url": "https://files.pythonhosted.org/packages/3c/b2/64c6a925feb537a18642e989a447d780904c5a0f7fc4955118019a9761c1/repocutter-0.6.1.tar.gz",
    "platform": null,
    "description": "repocutter\n==========\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg\n    :target: https://opensource.org/licenses/MIT\n    :alt: License\n.. image:: https://img.shields.io/pypi/v/repocutter\n    :target: https://pypi.org/project/repocutter/\n    :alt: PyPI\n.. image:: https://github.com/jshwi/repocutter/actions/workflows/ci.yml/badge.svg\n    :target: https://github.com/jshwi/repocutter/actions/workflows/ci.yml\n    :alt: CI\n.. image:: https://results.pre-commit.ci/badge/github/jshwi/repocutter/master.svg\n   :target: https://results.pre-commit.ci/latest/github/jshwi/repocutter/master\n   :alt: pre-commit.ci status\n.. image:: https://github.com/jshwi/repocutter/actions/workflows/codeql-analysis.yml/badge.svg\n    :target: https://github.com/jshwi/repocutter/actions/workflows/codeql-analysis.yml\n    :alt: CodeQL\n.. image:: https://codecov.io/gh/jshwi/repocutter/branch/master/graph/badge.svg\n    :target: https://codecov.io/gh/jshwi/repocutter\n    :alt: codecov.io\n.. image:: https://readthedocs.org/projects/repocutter/badge/?version=latest\n    :target: https://repocutter.readthedocs.io/en/latest/?badge=latest\n    :alt: readthedocs.org\n.. image:: https://img.shields.io/badge/python-3.8-blue.svg\n    :target: https://www.python.org/downloads/release/python-380\n    :alt: python3.8\n.. image:: https://img.shields.io/badge/code%20style-black-000000.svg\n    :target: https://github.com/psf/black\n    :alt: Black\n.. image:: https://img.shields.io/badge/linting-pylint-yellowgreen\n    :target: https://github.com/PyCQA/pylint\n    :alt: pylint\n.. image:: https://snyk.io/test/github/jshwi/repocutter/badge.svg\n    :target: https://snyk.io/test/github/jshwi/repocutter/badge.svg\n    :alt: Known Vulnerabilities\n\nCheckout repos to current cookiecutter config\n---------------------------------------------\n\nCheckout one or more repos to current `cookiecutter <https://github.com/cookiecutter/cookiecutter>`_ config\n\nThis will make changes to local repositories, hopefully preserving their history\n\nIdeally only the working tree will change\n\nIgnored files should be backed up\n\nUse with caution\n\nUsage\n-----\n\n.. code-block:: console\n\n    usage: repocutter [-h] [-v] [-a] [-c] [-b REV,NEW] [-i LIST] PATH [REPOS [REPOS ...]]\n\n    Checkout repos to current cookiecutter config\n\n    positional arguments:\n      PATH                          path to cookiecutter template dir\n      REPOS                         repos to run cookiecutter over\n\n    optional arguments:\n      -h, --help                    show this help message and exit\n      -v, --version                 show program's version number and exit\n      -a, --accept-hooks            accept pre/post hooks\n      -c, --gc                      clean up backups from previous runs\n      -b REV,NEW, --branch REV,NEW  checkout new branch from existing revision\n      -i LIST, --ignore LIST        comma separated list of paths to ignore, cookiecutter vars are allowed\n\nConfiguration\n-------------\n\nCurrently only written for a configuration exactly like below\n\nTechnically a repo would not need to be a `poetry <https://github.com/python-poetry/poetry>`_ project if the below section exists within its pyproject.toml file\n\nThis is the only use case at this time (If there are any other configurations you would like added please leave an `issue <https://github.com/jshwi/repocutter/issues>`_)\n\nEach repository's pyproject.toml file will be parsed for data to recreate its working tree\n\nA ``poetry`` section in the project's pyproject.toml file that looks like the following...\n\n.. code-block:: toml\n\n    [tool.poetry]\n    description = \"Checkout repos to current cookiecutter config\"\n    keywords = [\n      \"config\",\n      \"cookiecutter\",\n      \"jinja2\",\n      \"repo\",\n      \"template\"\n    ]\n    name = \"repocutter\"\n    version = \"0.2.0\"\n\n...will temporarily write to the ``cookiecutter`` project's cookiecutter.json file until the repo is created\n\n.. code-block:: json\n\n    {\n      \"project_name\": \"repocutter\",\n      \"project_version\": \"0.2.0\",\n      \"project_description\": \"Checkout repos to current cookiecutter config\",\n      \"project_keywords\": \"config,cookiecutter,jinja2,repo,template\",\n    }\n\nThe above configuration will reduce the diff, but it will still work if your config is not exactly the same\n\nWhy?\n----\nAs time goes on, and you use ``cookiecutter`` for new projects, you will make more and more changes to your ``cookiecutter`` repo\n\nYou will find these new project layouts are preferable to your older, more outdated, projects\n\nIf you have a project layout configured with ``cookiecutter`` then it's likely you will want this layout for all your projects\n\nConfiguring your existing projects manually is even more tedious than configuring a new project manually, especially if you have a lot of them\n\nBy checking out your projects to your configured ``cookiecutter`` layout, you can use whatever diff tool you use to rollback any undesired changes\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Checkout repos to current cookiecutter config",
    "version": "0.6.1",
    "split_keywords": [
        "config",
        "cookiecutter",
        "jinja2",
        "repo",
        "template"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "825795ee1746b77730302fb8992f57890f1edbf039cd3571eda1993c289c7521",
                "md5": "dca4a255757184d86eeb34c8549947be",
                "sha256": "3b7ad690944bc3a3462d89affc623fcfa9f67bc65c58c3311c9f47a4bf84ee0e"
            },
            "downloads": -1,
            "filename": "repocutter-0.6.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dca4a255757184d86eeb34c8549947be",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<4.0",
            "size": 7984,
            "upload_time": "2023-01-24T07:30:35",
            "upload_time_iso_8601": "2023-01-24T07:30:35.724049Z",
            "url": "https://files.pythonhosted.org/packages/82/57/95ee1746b77730302fb8992f57890f1edbf039cd3571eda1993c289c7521/repocutter-0.6.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3cb264c6a925feb537a18642e989a447d780904c5a0f7fc4955118019a9761c1",
                "md5": "a9018497a3ffd0997d18f412ddd3e7f7",
                "sha256": "35c9ac06485a2e0a29353cbba69b37fefaefc46aea277e634997e01c77ea63da"
            },
            "downloads": -1,
            "filename": "repocutter-0.6.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a9018497a3ffd0997d18f412ddd3e7f7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<4.0",
            "size": 8420,
            "upload_time": "2023-01-24T07:30:37",
            "upload_time_iso_8601": "2023-01-24T07:30:37.741220Z",
            "url": "https://files.pythonhosted.org/packages/3c/b2/64c6a925feb537a18642e989a447d780904c5a0f7fc4955118019a9761c1/repocutter-0.6.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-24 07:30:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "repocutter"
}
        
Elapsed time: 0.04143s