{"id":17216339,"url":"https://github.com/exhuma/rearr","last_synced_at":"2025-03-25T13:43:00.020Z","repository":{"id":66736628,"uuid":"363650904","full_name":"exhuma/rearr","owner":"exhuma","description":"Rearrange code inside Python source files","archived":false,"fork":false,"pushed_at":"2021-08-18T14:02:18.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T12:32:45.217Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exhuma.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-02T12:55:05.000Z","updated_at":"2021-08-18T14:00:49.000Z","dependencies_parsed_at":"2023-03-22T15:18:04.775Z","dependency_job_id":null,"html_url":"https://github.com/exhuma/rearr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exhuma%2Frearr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exhuma%2Frearr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exhuma%2Frearr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exhuma%2Frearr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exhuma","download_url":"https://codeload.github.com/exhuma/rearr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245473664,"owners_count":20621274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T03:27:32.394Z","updated_at":"2025-03-25T13:43:00.010Z","avatar_url":"https://github.com/exhuma.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"rearr\n=====\n\nrearr will rearrage Python modules and classed by type and alphabetically.\n\nThis will **very likely** break the code, so use at your own risk. This has not\nyet been battle tested and should not be assumed \"production ready\". Make sure\nyou have backups or revision control before applying it to any file.\n\nAs of version 0.2.0, rearranging *only* takes place for files or classes\ncontaining the ``# rearr: enable`` top-evel comment. This makes it \"opt-in\" to\navoid completely nuking the code-base.\n\nAdditionally, it now only checks if something *would* be done by default. To\noverwrite files, the ``-w`` argument must be supplied. It will also\nautomatically keep backups of original files.\n\nThe backups can be disabled using ``--no-backup`` which might make sense in\nprojects using revision control.\n\n\nExample\n=======\n\nBefore\n------\n\n::\n\n    \"\"\"\n    Hello\n    \"\"\"\n    from functools import lru_cache\n\n\n    def foo(f):\n        return f\n\n\n    def myfun3():\n        pass\n\n\n    def _myprifun():\n        pass\n\n\n    def __morepriv():\n        pass\n\n\n    class ClsWithoutDocString:\n        def foo(self):\n            pass\n\n\n    class ClsWithParent(ClsWithoutDocString):\n        pass\n\n\n    # Comment above \"MyClass\"\n    # second line of comment above \"MyClass\"\n    class MyClass:\n        \"\"\"\n        docstring of \"MyClass\"\n        \"\"\"\n\n        def meth(self):  # eol-comment after MyClass.meth()\n            pass\n\n        def __init__(self) -\u003e None:\n            pass\n\n        def meth3(self):\n            pass\n\n        @lru_cache\n        def meth22(self):\n            pass\n\n        def meth2(self):\n            pass\n\n        @classmethod\n        @lru_cache\n        @foo\n        def cm(cls):\n            pass\n\n        @staticmethod\n        def sm():\n            pass\n\n        @classmethod\n        def cm2(cls):\n            pass\n\n\n    def myfun2():\n        pass\n\n\n    def myfun1():\n        pass\n\n\nAfter (sorted but broken)\n-------------------------\n\n::\n\n    \"\"\"\n    Hello\n    \"\"\"\n    from functools import lru_cache\n\n\n    class ClsWithParent(ClsWithoutDocString):\n        pass\n\n\n    class ClsWithoutDocString:\n        def foo(self):\n            pass\n\n\n    # Comment above \"MyClass\"\n    # second line of comment above \"MyClass\"\n    class MyClass:\n        \"\"\"\n        docstring of \"MyClass\"\n        \"\"\"\n\n        @staticmethod\n        def sm():\n            pass\n\n        @classmethod\n        @lru_cache\n        @foo\n        def cm(cls):\n            pass\n\n        @classmethod\n        def cm2(cls):\n            pass\n\n        @lru_cache\n        def meth22(self):\n            pass\n\n        def __init__(self) -\u003e None:\n            pass\n\n        def meth(self):  # eol-comment after MyClass.meth()\n            pass\n\n        def meth2(self):\n            pass\n\n        def meth3(self):\n            pass\n\n\n    def __morepriv():\n        pass\n\n\n    def _myprifun():\n        pass\n\n\n    def foo(f):\n        return f\n\n\n    def myfun1():\n        pass\n\n\n    def myfun2():\n        pass\n\n\n    def myfun3():\n        pass\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexhuma%2Frearr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexhuma%2Frearr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexhuma%2Frearr/lists"}