djangowiz


Namedjangowiz JSON
Version 0.2.1 PyPI version JSON
download
home_pagehttps://github.com/tavallaie/DjangoWiz
SummaryDjangoWiz: A simple and powerful toolkit to automate the generation of serializers, viewsets, URLs, and Docker configurations for your Django projects.
upload_time2024-05-15 14:49:18
maintainerNone
docs_urlNone
authorAli Tavallaie
requires_python<4.0,>=3.10
licenseMIT
keywords django automation toolkit code-generation web-development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            @@**_⚠️ Caution: This library is under heavy development and is not ready for production._**

@@# DjangoWiz

@@DjangoWiz is a simple and powerful toolkit to automate the generation of serializers, viewsets, URLs, and Docker configurations for your Django projects. This toolkit helps you quickly scaffold out necessary files based on your models, saving you time and effort.

@@## Features

@@- Automatically generates serializers, viewsets, and URLs based on your Django models.
@@- Supports generation of Dockerfile and Docker Compose configurations for development and production environments.
@@- Skips non-serializable classes and abstract models.
@@- Includes customizable templates using Jinja2.
@@- Provides flexible commands to generate different components individually or all together.
@@- Supports custom templates and single file mode.
@@- Can be used in other Python scripts.

@@## Installation

@@1. **Install via pip:**
@@    ```bash
@@    pip install DjangoWiz
@@    ```

@@2. **Alternatively, clone the repository:**
@@    ```bash
@@    git clone https://github.com/tavallie/DjangoWiz.git
@@    cd DjangoWiz
@@    ```

@@3. **Install dependencies:**
@@    Ensure you have Python and Poetry installed, then run:
@@    ```bash
@@    poetry install
@@    ```

@@## Usage

@@### Generate All Files

@@Generate serializers, viewsets, routes, URLs, Dockerfile, and Docker Compose configurations:

@@```bash
@@djangowiz generate_files <your_app> <your_project> <path/to/models.py> --overwrite
@@```

@@### Generate Core Files Only

@@Generate serializers, viewsets, and routes without Docker-related files:

@@```bash
@@djangowiz generate_core_files <your_app> <your_project> <path/to/models.py> --overwrite
@@```

@@### Generate Individual Components

@@#### Generate Serializers

@@```bash
@@djangowiz generate_serializers <your_app> <your_project> <path/to/models.py> --overwrite
@@```

@@#### Generate Viewsets

@@```bash
@@djangowiz generate_viewsets <your_app> <your_project> <path/to/models.py> --overwrite
@@```

@@#### Generate URLs

@@```bash
@@djangowiz generate_urls <your_app> <your_project> <path/to/models.py> --overwrite
@@```

@@#### Generate Routes

@@```bash
@@djangowiz generate_routes <your_app> <your_project> <path/to/models.py> --overwrite
@@```

@@### Using Custom Templates

@@You can specify a custom template directory with the `--template-dir` option. If a custom template is not provided, the default templates will be used.

@@```bash
@@djangowiz generate_files <your_app> <your_project> <path/to/models.py> --overwrite --template-dir path/to/custom_templates
@@```

@@### Using Single File Mode

@@You can generate all serializers and viewsets in a single file using the `--single-file` option.

@@```bash
@@djangowiz generate_files <your_app> <your_project> <path/to/models.py> --overwrite --single-file
@@```

@@### Using as a Python Library

@@You can use DjangoWiz in your own Python scripts:

@@```python
@@from djangowiz.core import ModelExtractor, ProjectGenerator

@@model_file = 'path/to/models.py'
@@model_names = ModelExtractor.extract_model_names(model_file)
@@generator = ProjectGenerator('your_app', 'your_project', model_names, template_dir='path/to/custom_templates')
@@generator.generate_all(single_file=True, overwrite=True)
@@```

@@## Directory Structure

@@Ensure your project directory is structured as follows:

@@```
@@DjangoWiz/
@@├── djangowiz/
@@│   ├── __init__.py
@@│   ├── core.py
@@│   ├── cli.py
@@│   ├── templates/
@@│       ├── docker-compose.dev.yml.j2
@@│       ├── docker-compose.prod.yml.j2
@@│       ├── Dockerfile.j2
@@│       ├── env.dev.j2
@@│       ├── env.prod.j2
@@│       ├── serializer.py.j2
@@│       ├── viewset.py.j2
@@│       ├── urls.py.j2
@@│       ├── routes.py.j2
@@├── pyproject.toml
@@├── README.md
@@├── LICENSE
@@```

@@## Customizing Templates

@@The templates used for generating files are located in the `djangowiz/templates` directory. You can customize these templates to fit your project's specific requirements. The templates use Jinja2 for rendering.

@@## License

@@This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.

@@## Contributing

@@Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.

@@## Author

@@Ali Tavallaie - [a.tavallaie@gmail.com](mailto:a.tavallaie@gmail.com)

@@---

@@Happy coding!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/tavallaie/DjangoWiz",
    "name": "djangowiz",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": null,
    "keywords": "django, automation, toolkit, code-generation, web-development",
    "author": "Ali Tavallaie",
    "author_email": "a.tavallaie@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/ac/b2/99f6e4630726793eccb02e752b7c6d8de257f9595af11f1dfd3805cc8015/djangowiz-0.2.1.tar.gz",
    "platform": null,
    "description": "@@**_\u26a0\ufe0f Caution: This library is under heavy development and is not ready for production._**\n\n@@# DjangoWiz\n\n@@DjangoWiz is a simple and powerful toolkit to automate the generation of serializers, viewsets, URLs, and Docker configurations for your Django projects. This toolkit helps you quickly scaffold out necessary files based on your models, saving you time and effort.\n\n@@## Features\n\n@@- Automatically generates serializers, viewsets, and URLs based on your Django models.\n@@- Supports generation of Dockerfile and Docker Compose configurations for development and production environments.\n@@- Skips non-serializable classes and abstract models.\n@@- Includes customizable templates using Jinja2.\n@@- Provides flexible commands to generate different components individually or all together.\n@@- Supports custom templates and single file mode.\n@@- Can be used in other Python scripts.\n\n@@## Installation\n\n@@1. **Install via pip:**\n@@    ```bash\n@@    pip install DjangoWiz\n@@    ```\n\n@@2. **Alternatively, clone the repository:**\n@@    ```bash\n@@    git clone https://github.com/tavallie/DjangoWiz.git\n@@    cd DjangoWiz\n@@    ```\n\n@@3. **Install dependencies:**\n@@    Ensure you have Python and Poetry installed, then run:\n@@    ```bash\n@@    poetry install\n@@    ```\n\n@@## Usage\n\n@@### Generate All Files\n\n@@Generate serializers, viewsets, routes, URLs, Dockerfile, and Docker Compose configurations:\n\n@@```bash\n@@djangowiz generate_files <your_app> <your_project> <path/to/models.py> --overwrite\n@@```\n\n@@### Generate Core Files Only\n\n@@Generate serializers, viewsets, and routes without Docker-related files:\n\n@@```bash\n@@djangowiz generate_core_files <your_app> <your_project> <path/to/models.py> --overwrite\n@@```\n\n@@### Generate Individual Components\n\n@@#### Generate Serializers\n\n@@```bash\n@@djangowiz generate_serializers <your_app> <your_project> <path/to/models.py> --overwrite\n@@```\n\n@@#### Generate Viewsets\n\n@@```bash\n@@djangowiz generate_viewsets <your_app> <your_project> <path/to/models.py> --overwrite\n@@```\n\n@@#### Generate URLs\n\n@@```bash\n@@djangowiz generate_urls <your_app> <your_project> <path/to/models.py> --overwrite\n@@```\n\n@@#### Generate Routes\n\n@@```bash\n@@djangowiz generate_routes <your_app> <your_project> <path/to/models.py> --overwrite\n@@```\n\n@@### Using Custom Templates\n\n@@You can specify a custom template directory with the `--template-dir` option. If a custom template is not provided, the default templates will be used.\n\n@@```bash\n@@djangowiz generate_files <your_app> <your_project> <path/to/models.py> --overwrite --template-dir path/to/custom_templates\n@@```\n\n@@### Using Single File Mode\n\n@@You can generate all serializers and viewsets in a single file using the `--single-file` option.\n\n@@```bash\n@@djangowiz generate_files <your_app> <your_project> <path/to/models.py> --overwrite --single-file\n@@```\n\n@@### Using as a Python Library\n\n@@You can use DjangoWiz in your own Python scripts:\n\n@@```python\n@@from djangowiz.core import ModelExtractor, ProjectGenerator\n\n@@model_file = 'path/to/models.py'\n@@model_names = ModelExtractor.extract_model_names(model_file)\n@@generator = ProjectGenerator('your_app', 'your_project', model_names, template_dir='path/to/custom_templates')\n@@generator.generate_all(single_file=True, overwrite=True)\n@@```\n\n@@## Directory Structure\n\n@@Ensure your project directory is structured as follows:\n\n@@```\n@@DjangoWiz/\n@@\u251c\u2500\u2500 djangowiz/\n@@\u2502   \u251c\u2500\u2500 __init__.py\n@@\u2502   \u251c\u2500\u2500 core.py\n@@\u2502   \u251c\u2500\u2500 cli.py\n@@\u2502   \u251c\u2500\u2500 templates/\n@@\u2502       \u251c\u2500\u2500 docker-compose.dev.yml.j2\n@@\u2502       \u251c\u2500\u2500 docker-compose.prod.yml.j2\n@@\u2502       \u251c\u2500\u2500 Dockerfile.j2\n@@\u2502       \u251c\u2500\u2500 env.dev.j2\n@@\u2502       \u251c\u2500\u2500 env.prod.j2\n@@\u2502       \u251c\u2500\u2500 serializer.py.j2\n@@\u2502       \u251c\u2500\u2500 viewset.py.j2\n@@\u2502       \u251c\u2500\u2500 urls.py.j2\n@@\u2502       \u251c\u2500\u2500 routes.py.j2\n@@\u251c\u2500\u2500 pyproject.toml\n@@\u251c\u2500\u2500 README.md\n@@\u251c\u2500\u2500 LICENSE\n@@```\n\n@@## Customizing Templates\n\n@@The templates used for generating files are located in the `djangowiz/templates` directory. You can customize these templates to fit your project's specific requirements. The templates use Jinja2 for rendering.\n\n@@## License\n\n@@This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more details.\n\n@@## Contributing\n\n@@Contributions are welcome! Please open an issue or submit a pull request if you have any suggestions or improvements.\n\n@@## Author\n\n@@Ali Tavallaie - [a.tavallaie@gmail.com](mailto:a.tavallaie@gmail.com)\n\n@@---\n\n@@Happy coding!\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "DjangoWiz: A simple and powerful toolkit to automate the generation of serializers, viewsets, URLs, and Docker configurations for your Django projects.",
    "version": "0.2.1",
    "project_urls": {
        "Homepage": "https://github.com/tavallaie/DjangoWiz",
        "Repository": "https://github.com/tavallaie/DjangoWiz"
    },
    "split_keywords": [
        "django",
        " automation",
        " toolkit",
        " code-generation",
        " web-development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "493dbc9026826af57bd3febfbd3ce96556658e89761d30f6cdde6b4e6be7f850",
                "md5": "fb76910a330bf0293cd9405dd1262049",
                "sha256": "d505b6b82d0133c5b1af62e2afb020e6d970153a18805dcdb1196645b010ee54"
            },
            "downloads": -1,
            "filename": "djangowiz-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fb76910a330bf0293cd9405dd1262049",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 10050,
            "upload_time": "2024-05-15T14:49:17",
            "upload_time_iso_8601": "2024-05-15T14:49:17.097935Z",
            "url": "https://files.pythonhosted.org/packages/49/3d/bc9026826af57bd3febfbd3ce96556658e89761d30f6cdde6b4e6be7f850/djangowiz-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "acb299f6e4630726793eccb02e752b7c6d8de257f9595af11f1dfd3805cc8015",
                "md5": "a35dddfb551d28ad8f04e84b1b2a670f",
                "sha256": "9c67b3d8eb9b27e6f85f20e493f64776cd8c40c2ee7d631fa64f313919e35100"
            },
            "downloads": -1,
            "filename": "djangowiz-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "a35dddfb551d28ad8f04e84b1b2a670f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 7641,
            "upload_time": "2024-05-15T14:49:18",
            "upload_time_iso_8601": "2024-05-15T14:49:18.805552Z",
            "url": "https://files.pythonhosted.org/packages/ac/b2/99f6e4630726793eccb02e752b7c6d8de257f9595af11f1dfd3805cc8015/djangowiz-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-15 14:49:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "tavallaie",
    "github_project": "DjangoWiz",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "djangowiz"
}
        
Elapsed time: 2.26388s