Skip to main content

rcmt

pypi python docs

rcmt automates refactorings across many repositories.

Write Python code to define how the content of files should look like. Then let rcmt apply the changes across repositories and create pull requests.

Features

  • Mass Refactoring - create, update or delete files across many repositories.
  • Automation - automatic creation of merge requests in repositories; optionally merge them automatically if approved and all checks have passed.
  • Flexibility - call third-party APIs or integrate libraries.

The Task file

A Task file tells rcmt which repositories to modify. It is written in Python.

from rcmt import Task, Context, register_task


# Replace with your repository.
REPOSITORY = "github.com/wndhydrnt/rcmt-example"

# A Task bundles the code that determines which repositories to modify and how to modify
# them. It is a regular Python class that extends the base class `Task`.
class HelloWorld(Task):
    name = "hello-world"
    pr_title = "rcmt Hello World"
    pr_body = """This pull request has been created as part of the how-to guide:

https://rcmt.readthedocs.io/get-started/create-a-task/
"""

    # The `filter` method determines which repositories to modify. It is called by rcmt
    # for each repository.
    def filter(self, ctx: Context) -> bool:
        return ctx.repo.full_name == REPOSITORY

    # The `apply` method contains the code that modifies files in a repository. In this
    # example, the `own` function creates the file `hello-world.txt` with the content
    # `Hello World` in the root of the repository. `target` is not an absolute path
    # because rcmt automatically sets the current working directory (`cwd`) to the
    # checkout of the repository.
    def apply(self, ctx: Context) -> None:
        with open("hello-world.txt", "w+") as f:
            f.write("Hello World")


# Register the task with rcmt so rcmt knows about it.
register_task(HelloWorld())

What's next

Contributing

Learn how to contribute code to rcmt

Metadata

Release files for rcmt 0.30.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rcmt 0.30.0
File Size Uploaded
rcmt-0.30.0.tar.gz 36.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rcmt 0.30.0
File Interpreter ABI Platform
rcmt-0.30.0-py3-none-any.whl Python 3 none any Details

Total release size: 85.4 kB

Release files / rcmt-0.30.0.tar.gz

Download URL rcmt-0.30.0.tar.gz
Size 36.5 kB
Tags Source
SHA-256 checksum
How to use checksums
fdab03f5269abc84b255fb737fe7fb8d75f635f44497efd500ae39f575ea662a
BLAKE2b-256 checksum
How to use checksums
b45df205ce64e23d02c619d03aad7a707b0af15381d169350fd6281379375ebc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure

Release files / rcmt-0.30.0-py3-none-any.whl

Download URL rcmt-0.30.0-py3-none-any.whl
Size 48.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65b0e8f633b072be42582baa985cbbe84b666338174fbec3d20cdd105afaccb4
BLAKE2b-256 checksum
How to use checksums
0f7892a688dc1d0c6f9bd4c6f90a3d4f742465415f9d4d33d487fb5bf909a26b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.7 Linux/6.2.0-1018-azure

Release history Release notifications | RSS feed

This release

0.30.0 This release

2 release files

0.29.0

2 release files

0.28.0

2 release files

0.27.2

2 release files

0.27.1

2 release files

0.26.0

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.1

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.21.1

2 release files

0.20.1

2 release files

0.20.0

2 release files

0.19.1

2 release files

0.19.0

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.15.3

2 release files

0.15.2

2 release files

0.15.1

2 release files

0.15.0

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.2

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page