{"id":15938173,"url":"https://github.com/pluveto/source-layout","last_synced_at":"2025-02-22T22:14:26.668Z","repository":{"id":199872564,"uuid":"703979670","full_name":"pluveto/source-layout","owner":"pluveto","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-12T09:46:45.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-03T20:22:14.898Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pluveto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-12T09:44:18.000Z","updated_at":"2023-10-12T09:44:42.000Z","dependencies_parsed_at":"2023-10-13T04:07:14.680Z","dependency_job_id":null,"html_url":"https://github.com/pluveto/source-layout","commit_stats":null,"previous_names":["pluveto/source-layout"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fsource-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fsource-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fsource-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fsource-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pluveto","download_url":"https://codeload.github.com/pluveto/source-layout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240241820,"owners_count":19770466,"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-07T05:21:28.113Z","updated_at":"2025-02-22T22:14:26.628Z","avatar_url":"https://github.com/pluveto.png","language":"Python","readme":"# Source Layout - Python Code Node Order Analyzer\n\nA tool to check your Python code layout (order of private/public class member etc).\n\n## Installation\n\nSimply clone or download the repository and place the script in your desired location.\n\n## Usage\n\nThe tool is built as a command line application. You can run it providing a single Python file or a path directory contains python files. Utilize the `-v` or `--verbose` option for verbose outputs:\n\n```shell\npython source_layout.py\n# or\npython src/\n```\n\n## Example\n\nInput:\n\n```python\nclass Dog:\n    @staticmethod\n    def from_dict(d: dict):\n        return Dog(d[\"name\"], d[\"age\"])\n\n    name: str\n\n    def __init__(self, name: str, age: int):\n        self.name = name\n        self.age = age\n\n    def bark(self):\n        print(f\"{self.name} barks!\")\n\n    def __repr__(self):\n        return f\"Dog(name={self.name}, age={self.age})\"\n\n    age: int\n```\n\nOutput:\n\n```shell\nFound issues in examples/example.py:\n    examples/example.py:6 \"name\" should not be after \"from_dict\"\n    examples/example.py:15 \"__repr__\" should not be after \"bark\"\n    examples/example.py:18 \"age\" should not be after \"__repr__\"\n```\n\n## Functionality\n\nHere's an brief of what the tool does:\n\n- Parse your Python code\n- Enumerate through the objects and nodes of the file(s), and classify them by type (class declarations, class variables, import statements, magic methods, getters\u0026setters, static methods, public/private methods).\n- Build a declaration tree resultant from analysis, and check their order.\n- The tool can recognize if an object (like a method) is improperly placed in relation to other objects.\n- Output a detailed log of the analysis, that can be toggled quiet or verbose.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\nAny bugs or feature recommendations can be forwarded to the repository's issue tracker.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluveto%2Fsource-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpluveto%2Fsource-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluveto%2Fsource-layout/lists"}