{"id":26978454,"url":"https://github.com/alexdemure/fastgenerator","last_synced_at":"2025-04-03T13:35:18.943Z","repository":{"id":282910114,"uuid":"950050292","full_name":"AlexDemure/fastgenerator","owner":"AlexDemure","description":"Code generator CLI tool","archived":false,"fork":false,"pushed_at":"2025-04-02T11:16:06.000Z","size":63,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"production","last_synced_at":"2025-04-02T12:25:37.022Z","etag":null,"topics":["code","codegenerate","codegenerator","fastapi-boilerplate","fastapi-crud","fastapi-template","generation","generator"],"latest_commit_sha":null,"homepage":"","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/AlexDemure.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-17T14:53:12.000Z","updated_at":"2025-04-02T11:16:09.000Z","dependencies_parsed_at":"2025-03-17T16:29:46.701Z","dependency_job_id":"ab293b44-ec43-4ef4-b109-50d07ae6e401","html_url":"https://github.com/AlexDemure/fastgenerator","commit_stats":null,"previous_names":["alexdemure/fastgenerator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Ffastgenerator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Ffastgenerator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Ffastgenerator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexDemure%2Ffastgenerator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexDemure","download_url":"https://codeload.github.com/AlexDemure/fastgenerator/tar.gz/refs/heads/production","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247010430,"owners_count":20868705,"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":["code","codegenerate","codegenerator","fastapi-boilerplate","fastapi-crud","fastapi-template","generation","generator"],"created_at":"2025-04-03T13:35:18.394Z","updated_at":"2025-04-03T13:35:18.921Z","avatar_url":"https://github.com/AlexDemure.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/AlexDemure/fastgenerator\"\u003e\n    \u003ca href=\"https://ibb.co/23v8Qx04\"\u003e\u003cimg src=\"https://i.ibb.co/fdk85fVw/Frame-1349.png\" alt=\"Frame-1349\" border=\"0\" /\u003e\u003c/a\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  CLI utility for code generation based on a TOML configuration file.\n\u003c/p\u003e\n\n---\n\n## Installation\n\n```\npip install fastgenerator\n```\n\n## Usage\n\nRun the code generation process:\n\n```sh\nfastgenerator --file {config.toml} --context \"{}\"\n```\n\n\n## Configuration File Guide\n\nFastgenerator uses a structured TOML configuration file to define the project structure, file contents, and commands to execute.\n\n### General Structure\n\n```\nworkdir = \"myproject\"\n\nfolders = []\n\nexclude = []\n\n[[files]]\npath = \"{{name}}.py\"\ncontent = \"\"\"\ndef hello():\n    print(\"Hello\", {{name}})\n\nif __name__ == '__main__':\n    hello()\n\"\"\"\n\n[[scripts]]\ncommand = \"isort {{workdir}}\"\ncheck = true\n```\n\n### Sections Overview\n\n| Section       | Format                          | Description                                                             |   |   |\n|---------------|---------------------------------|-------------------------------------------------------------------------|---|---|\n| `workdir`     | `\"\"`                            | Uses the current directory                                              |   |   |\n|               | `\"myproject\"`                   | Uses the current directory + `/myproject`                               |   |   |\n|               | `\"/home/myproject\"`             | Uses an absolute path                                                   |   |   |\n| `exclude`     | `[\"src/static/__init__.py\"]`    | Uses a relative path to `workdir`. Excludes file creation.              |   |   |\n| `folders`     | `[\"src/\", \"src/static\"]`        | Uses a relative path to `workdir`. Describes directories to be created. |   |   |\n| `[[files]]`   |                                 | Defines file creation rules                                             |   |   |\n|               | `mode = \"a\"`                    | File writing mode: `\"a\"` (append), `\"w\"` (overwrite)                    |   |   |\n|               | `path = \"src/__init__.py\"`      | Relative to workdir, specifies file location.                           |   |   |\n|               | `\"\"\" ... \"\"\" / path / url`      | Raw content, local file path, or URL for remote content.                |   |   |\n| `[[scripts]]` |                                 | Defines commands to be executed after generation.                       |   |   |\n|               | `command = \"isort {{workdir}}\"` | Command to execute, supports dynamic variables.                         |   |   |\n|               | `check = True\\False\"`           | If true, raises an error if the command fails, otherwise logs output.   |   |   |\n\n\n## Using Dynamic Variables\n\nFastgenerator supports dynamic variables in both file paths, contents, and script commands.\n\n```toml\n[[files]]\npath = \"src/{{name}}.py\"\ncontent = \"\"\"\ndef hello():\n    print(\"Hello, {{name}}!\")\n\nif __name__ == '__main__':\n    hello()\n\"\"\"\n```\n\n## Automating Post-Generation Tasks\n\nFastGenerator allows you to execute scripts after generating files. These scripts can perform tasks such as formatting, linting, or additional file modifications.\n\n#### Example\n```\n[[scripts]]\ncommand = \"isort {{workdir}}\"\ncheck = true\n\n[[scripts]]\ncommand = \"ruff {{workdir}} --fix\"\ncheck = false\n```\n\n- Commands support dynamic variables.\n- If check = true, the execution will fail if the command returns a non-zero exit code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdemure%2Ffastgenerator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexdemure%2Ffastgenerator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexdemure%2Ffastgenerator/lists"}