instant-python 0.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- instant_python/__init__.py +1 -0
- instant_python/cli/__init__.py +0 -0
- instant_python/cli/cli.py +58 -0
- instant_python/cli/instant_python_typer.py +35 -0
- instant_python/config/__init__.py +0 -0
- instant_python/config/application/__init__.py +0 -0
- instant_python/config/application/config_generator.py +23 -0
- instant_python/config/delivery/__init__.py +0 -0
- instant_python/config/delivery/cli.py +19 -0
- instant_python/config/domain/__init__.py +0 -0
- instant_python/config/domain/question_wizard.py +7 -0
- instant_python/config/infra/__init__.py +0 -0
- instant_python/config/infra/question_wizard/__init__.py +0 -0
- instant_python/config/infra/question_wizard/questionary_console_wizard.py +25 -0
- instant_python/config/infra/question_wizard/step/__init__.py +0 -0
- instant_python/config/infra/question_wizard/step/dependencies_step.py +64 -0
- instant_python/config/infra/question_wizard/step/general_step.py +81 -0
- instant_python/config/infra/question_wizard/step/git_step.py +41 -0
- instant_python/config/infra/question_wizard/step/questionary.py +17 -0
- instant_python/config/infra/question_wizard/step/steps.py +21 -0
- instant_python/config/infra/question_wizard/step/template_step.py +63 -0
- instant_python/initialize/__init__.py +0 -0
- instant_python/initialize/application/__init__.py +0 -0
- instant_python/initialize/application/project_initializer.py +47 -0
- instant_python/initialize/delivery/__init__.py +0 -0
- instant_python/initialize/delivery/cli.py +48 -0
- instant_python/initialize/domain/__init__.py +0 -0
- instant_python/initialize/domain/env_manager.py +9 -0
- instant_python/initialize/domain/node.py +73 -0
- instant_python/initialize/domain/project_formatter.py +7 -0
- instant_python/initialize/domain/project_renderer.py +10 -0
- instant_python/initialize/domain/project_structure.py +77 -0
- instant_python/initialize/domain/project_writer.py +20 -0
- instant_python/initialize/domain/version_control_configurer.py +9 -0
- instant_python/initialize/infra/__init__.py +0 -0
- instant_python/initialize/infra/env_manager/__init__.py +0 -0
- instant_python/initialize/infra/env_manager/env_manager_factory.py +27 -0
- instant_python/initialize/infra/env_manager/pdm_env_manager.py +66 -0
- instant_python/initialize/infra/env_manager/system_console.py +65 -0
- instant_python/initialize/infra/env_manager/uv_env_manager.py +74 -0
- instant_python/initialize/infra/formatter/__init__.py +0 -0
- instant_python/initialize/infra/formatter/ruff_project_formatter.py +10 -0
- instant_python/initialize/infra/renderer/__init__.py +0 -0
- instant_python/initialize/infra/renderer/jinja_environment.py +71 -0
- instant_python/initialize/infra/renderer/jinja_project_renderer.py +57 -0
- instant_python/initialize/infra/version_control/__init__.py +0 -0
- instant_python/initialize/infra/version_control/git_configurer.py +29 -0
- instant_python/initialize/infra/writer/__init__.py +0 -0
- instant_python/initialize/infra/writer/file_system_project_writer.py +23 -0
- instant_python/shared/__init__.py +0 -0
- instant_python/shared/application_error.py +8 -0
- instant_python/shared/domain/__init__.py +0 -0
- instant_python/shared/domain/config_repository.py +18 -0
- instant_python/shared/domain/config_schema.py +113 -0
- instant_python/shared/domain/dependency_config.py +41 -0
- instant_python/shared/domain/general_config.py +71 -0
- instant_python/shared/domain/git_config.py +32 -0
- instant_python/shared/domain/template_config.py +76 -0
- instant_python/shared/infra/__init__.py +0 -0
- instant_python/shared/infra/persistence/__init__.py +0 -0
- instant_python/shared/infra/persistence/yaml_config_repository.py +39 -0
- instant_python/shared/supported_built_in_features.py +20 -0
- instant_python/shared/supported_licenses.py +11 -0
- instant_python/shared/supported_managers.py +10 -0
- instant_python/shared/supported_python_versions.py +12 -0
- instant_python/shared/supported_templates.py +12 -0
- instant_python/templates/boilerplate/.gitignore +164 -0
- instant_python/templates/boilerplate/.pre-commit-config.yml +73 -0
- instant_python/templates/boilerplate/.python-version +1 -0
- instant_python/templates/boilerplate/CITATION.cff +13 -0
- instant_python/templates/boilerplate/LICENSE +896 -0
- instant_python/templates/boilerplate/README.md +8 -0
- instant_python/templates/boilerplate/SECURITY.md +43 -0
- instant_python/templates/boilerplate/event_bus/__init__.py +0 -0
- instant_python/templates/boilerplate/event_bus/domain_event.py +15 -0
- instant_python/templates/boilerplate/event_bus/domain_event_json_deserializer.py +25 -0
- instant_python/templates/boilerplate/event_bus/domain_event_json_serializer.py +16 -0
- instant_python/templates/boilerplate/event_bus/domain_event_subscriber.py +33 -0
- instant_python/templates/boilerplate/event_bus/event_aggregate.py +19 -0
- instant_python/templates/boilerplate/event_bus/event_bus.py +9 -0
- instant_python/templates/boilerplate/event_bus/exchange_type.py +14 -0
- instant_python/templates/boilerplate/event_bus/mock_event_bus.py +16 -0
- instant_python/templates/boilerplate/event_bus/rabbit_mq_configurer.py +45 -0
- instant_python/templates/boilerplate/event_bus/rabbit_mq_connection.py +71 -0
- instant_python/templates/boilerplate/event_bus/rabbit_mq_consumer.py +56 -0
- instant_python/templates/boilerplate/event_bus/rabbit_mq_event_bus.py +26 -0
- instant_python/templates/boilerplate/event_bus/rabbit_mq_queue_formatter.py +21 -0
- instant_python/templates/boilerplate/event_bus/rabbit_mq_settings.py +8 -0
- instant_python/templates/boilerplate/exceptions/__init__.py +0 -0
- instant_python/templates/boilerplate/exceptions/base_error.py +13 -0
- instant_python/templates/boilerplate/exceptions/domain_error.py +6 -0
- instant_python/templates/boilerplate/exceptions/domain_event_type_not_found_error.py +6 -0
- instant_python/templates/boilerplate/exceptions/rabbit_mq_connection_not_established_error.py +7 -0
- instant_python/templates/boilerplate/exceptions/required_value_error.py +6 -0
- instant_python/templates/boilerplate/fastapi/__init__.py +0 -0
- instant_python/templates/boilerplate/fastapi/application.py +74 -0
- instant_python/templates/boilerplate/fastapi/error_handlers.py +88 -0
- instant_python/templates/boilerplate/fastapi/error_response.py +31 -0
- instant_python/templates/boilerplate/fastapi/fastapi_log_middleware.py +32 -0
- instant_python/templates/boilerplate/fastapi/lifespan.py +13 -0
- instant_python/templates/boilerplate/fastapi/success_response.py +13 -0
- instant_python/templates/boilerplate/github/action.yml +35 -0
- instant_python/templates/boilerplate/github/bug_report.yml +60 -0
- instant_python/templates/boilerplate/github/ci.yml +199 -0
- instant_python/templates/boilerplate/github/feature_request.yml +21 -0
- instant_python/templates/boilerplate/github/release.yml +94 -0
- instant_python/templates/boilerplate/logger/__init__.py +0 -0
- instant_python/templates/boilerplate/logger/file_logger.py +55 -0
- instant_python/templates/boilerplate/logger/file_rotating_handler.py +36 -0
- instant_python/templates/boilerplate/logger/json_formatter.py +16 -0
- instant_python/templates/boilerplate/mypy.ini +41 -0
- instant_python/templates/boilerplate/persistence/__init__.py +0 -0
- instant_python/templates/boilerplate/persistence/alembic_migrator.py +19 -0
- instant_python/templates/boilerplate/persistence/async/README.md +1 -0
- instant_python/templates/boilerplate/persistence/async/__init__.py +0 -0
- instant_python/templates/boilerplate/persistence/async/alembic.ini +124 -0
- instant_python/templates/boilerplate/persistence/async/async_engine_fixture.py +20 -0
- instant_python/templates/boilerplate/persistence/async/async_session.py +20 -0
- instant_python/templates/boilerplate/persistence/async/env.py +94 -0
- instant_python/templates/boilerplate/persistence/async/models_metadata.py +10 -0
- instant_python/templates/boilerplate/persistence/async/postgres_settings.py +15 -0
- instant_python/templates/boilerplate/persistence/async/script.py.mako +26 -0
- instant_python/templates/boilerplate/persistence/async/sqlalchemy_repository.py +28 -0
- instant_python/templates/boilerplate/persistence/base.py +4 -0
- instant_python/templates/boilerplate/persistence/synchronous/__init__.py +0 -0
- instant_python/templates/boilerplate/persistence/synchronous/session_maker.py +21 -0
- instant_python/templates/boilerplate/persistence/synchronous/sqlalchemy_repository.py +40 -0
- instant_python/templates/boilerplate/pyproject.toml +134 -0
- instant_python/templates/boilerplate/pytest.ini +10 -0
- instant_python/templates/boilerplate/scripts/add_dependency.py +45 -0
- instant_python/templates/boilerplate/scripts/create_aggregate.py +33 -0
- instant_python/templates/boilerplate/scripts/insert_template.py +90 -0
- instant_python/templates/boilerplate/scripts/integration.sh +39 -0
- instant_python/templates/boilerplate/scripts/local_setup.py +12 -0
- instant_python/templates/boilerplate/scripts/makefile +184 -0
- instant_python/templates/boilerplate/scripts/post-merge.py +40 -0
- instant_python/templates/boilerplate/scripts/pre-commit.py +15 -0
- instant_python/templates/boilerplate/scripts/pre-push.py +6 -0
- instant_python/templates/boilerplate/scripts/remove_dependency.py +40 -0
- instant_python/templates/boilerplate/scripts/unit.sh +40 -0
- instant_python/templates/project_structure/clean_architecture/layers/application.yml +3 -0
- instant_python/templates/project_structure/clean_architecture/layers/delivery.yml +8 -0
- instant_python/templates/project_structure/clean_architecture/layers/domain.yml +10 -0
- instant_python/templates/project_structure/clean_architecture/layers/infra.yml +12 -0
- instant_python/templates/project_structure/clean_architecture/layers/test_application.yml +3 -0
- instant_python/templates/project_structure/clean_architecture/layers/test_delivery.yml +3 -0
- instant_python/templates/project_structure/clean_architecture/layers/test_domain.yml +3 -0
- instant_python/templates/project_structure/clean_architecture/layers/test_infra.yml +9 -0
- instant_python/templates/project_structure/clean_architecture/main_structure.yml +38 -0
- instant_python/templates/project_structure/clean_architecture/source.yml +9 -0
- instant_python/templates/project_structure/clean_architecture/test.yml +9 -0
- instant_python/templates/project_structure/config_files/gitignore.yml +3 -0
- instant_python/templates/project_structure/config_files/mypy.yml +4 -0
- instant_python/templates/project_structure/config_files/pyproject.yml +4 -0
- instant_python/templates/project_structure/config_files/pytest.yml +4 -0
- instant_python/templates/project_structure/config_files/python_version.yml +3 -0
- instant_python/templates/project_structure/documentation/citation.yml +4 -0
- instant_python/templates/project_structure/documentation/license.yml +3 -0
- instant_python/templates/project_structure/documentation/readme.yml +4 -0
- instant_python/templates/project_structure/documentation/security.yml +4 -0
- instant_python/templates/project_structure/domain_driven_design/layers/bounded_context.yml +17 -0
- instant_python/templates/project_structure/domain_driven_design/layers/delivery.yml +8 -0
- instant_python/templates/project_structure/domain_driven_design/layers/shared.yml +18 -0
- instant_python/templates/project_structure/domain_driven_design/layers/shared_domain.yml +10 -0
- instant_python/templates/project_structure/domain_driven_design/layers/shared_infra.yml +12 -0
- instant_python/templates/project_structure/domain_driven_design/layers/test_shared.yml +8 -0
- instant_python/templates/project_structure/domain_driven_design/layers/test_shared_delivery.yml +3 -0
- instant_python/templates/project_structure/domain_driven_design/layers/test_shared_domain.yml +3 -0
- instant_python/templates/project_structure/domain_driven_design/layers/test_shared_infra.yml +9 -0
- instant_python/templates/project_structure/domain_driven_design/main_structure.yml +38 -0
- instant_python/templates/project_structure/domain_driven_design/source.yml +10 -0
- instant_python/templates/project_structure/domain_driven_design/test.yml +9 -0
- instant_python/templates/project_structure/errors.yml +12 -0
- instant_python/templates/project_structure/events/event_bus_domain.yml +48 -0
- instant_python/templates/project_structure/events/event_bus_infra.yml +40 -0
- instant_python/templates/project_structure/events/mock_event_bus.yml +4 -0
- instant_python/templates/project_structure/fastapi/fastapi_app.yml +32 -0
- instant_python/templates/project_structure/fastapi/fastapi_domain.yml +12 -0
- instant_python/templates/project_structure/fastapi/fastapi_infra.yml +12 -0
- instant_python/templates/project_structure/github/github_action.yml +24 -0
- instant_python/templates/project_structure/github/github_issues_template.yml +14 -0
- instant_python/templates/project_structure/github/makefile.yml +3 -0
- instant_python/templates/project_structure/github/precommit_hook.yml +4 -0
- instant_python/templates/project_structure/logger.yml +16 -0
- instant_python/templates/project_structure/macros.j2 +73 -0
- instant_python/templates/project_structure/persistence/alembic_migrator.yml +6 -0
- instant_python/templates/project_structure/persistence/async_alembic.yml +27 -0
- instant_python/templates/project_structure/persistence/async_engine_conftest.yml +4 -0
- instant_python/templates/project_structure/persistence/async_sqlalchemy.yml +14 -0
- instant_python/templates/project_structure/persistence/persistence.yml +8 -0
- instant_python/templates/project_structure/persistence/synchronous_sqlalchemy.yml +20 -0
- instant_python/templates/project_structure/standard_project/layers/source_features.yml +13 -0
- instant_python/templates/project_structure/standard_project/layers/test_event_bus.yml +6 -0
- instant_python/templates/project_structure/standard_project/layers/test_features.yml +6 -0
- instant_python/templates/project_structure/standard_project/main_structure.yml +38 -0
- instant_python/templates/project_structure/standard_project/source.yml +5 -0
- instant_python/templates/project_structure/standard_project/test.yml +5 -0
- instant_python-0.20.0.dist-info/METADATA +318 -0
- instant_python-0.20.0.dist-info/RECORD +202 -0
- instant_python-0.20.0.dist-info/WHEEL +4 -0
- instant_python-0.20.0.dist-info/entry_points.txt +2 -0
- instant_python-0.20.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
- name: {{ template.bounded_context }}
|
|
2
|
+
type: directory
|
|
3
|
+
python: True
|
|
4
|
+
children:
|
|
5
|
+
- name: {{ template.aggregate_name }}
|
|
6
|
+
type: directory
|
|
7
|
+
python: True
|
|
8
|
+
children:
|
|
9
|
+
- name: application
|
|
10
|
+
type: directory
|
|
11
|
+
python: True
|
|
12
|
+
- name: domain
|
|
13
|
+
type: directory
|
|
14
|
+
python: True
|
|
15
|
+
- name: infrastructure
|
|
16
|
+
type: directory
|
|
17
|
+
python: True
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{%- set delivery_features = [
|
|
3
|
+
{"feature": "fastapi_application", "template": "fastapi/fastapi_app.yml"}
|
|
4
|
+
] %}
|
|
5
|
+
- name: delivery
|
|
6
|
+
type: directory
|
|
7
|
+
python: True
|
|
8
|
+
{{ macros.render_children_for(delivery_features, 2) }}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{%- set domain_related_features = ["value_objects", "event_bus", "fastapi_application"] %}
|
|
3
|
+
{%- set infra_related_features = ["event_bus", "logger", "async_sqlalchemy", "async_alembic", "fastapi_application"] %}
|
|
4
|
+
{%- set has_domain = domain_related_features | is_in(template.built_in_features) -%}
|
|
5
|
+
{%- set has_infra = infra_related_features | is_in(template.built_in_features) -%}
|
|
6
|
+
- name: shared
|
|
7
|
+
type: directory
|
|
8
|
+
python: True
|
|
9
|
+
{% if has_domain or has_infra %}
|
|
10
|
+
children:
|
|
11
|
+
{% if has_domain %}
|
|
12
|
+
{{ macros.include_block("domain_driven_design/layers/shared_domain.yml", 4) }}
|
|
13
|
+
{% endif %}
|
|
14
|
+
{% if has_infra %}
|
|
15
|
+
{{ macros.include_block("domain_driven_design/layers/shared_infra.yml", 4) }}
|
|
16
|
+
{% endif %}
|
|
17
|
+
{% endif %}
|
|
18
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{%- set domain_features = [
|
|
3
|
+
{"feature": "value_objects", "template": "errors.yml"},
|
|
4
|
+
{"feature": "event_bus", "template": "events/event_bus_domain.yml"},
|
|
5
|
+
{"feature": "fastapi_application", "template": "fastapi/fastapi_domain.yml"}
|
|
6
|
+
] %}
|
|
7
|
+
- name: domain
|
|
8
|
+
type: directory
|
|
9
|
+
python: True
|
|
10
|
+
{{ macros.render_children_for(domain_features, 2) }}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{%- set infra_features = [
|
|
3
|
+
{"feature": "event_bus", "template": "events/event_bus_infra.yml"},
|
|
4
|
+
{"feature": "logger", "template": "logger.yml"},
|
|
5
|
+
{"feature": "async_sqlalchemy", "template": "persistence/async_sqlalchemy.yml"},
|
|
6
|
+
{"feature": "async_alembic", "template": "persistence/alembic_migrator.yml"},
|
|
7
|
+
{"feature": "fastapi_application", "template": "fastapi/fastapi_infra.yml"}
|
|
8
|
+
] %}
|
|
9
|
+
- name: infra
|
|
10
|
+
type: directory
|
|
11
|
+
python: True
|
|
12
|
+
{{ macros.render_children_for(infra_features, 2) }}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
- name: shared
|
|
3
|
+
type: directory
|
|
4
|
+
python: True
|
|
5
|
+
children:
|
|
6
|
+
{{ macros.include_block("domain_driven_design/layers/test_shared_delivery.yml", 4) }}
|
|
7
|
+
{{ macros.include_block("domain_driven_design/layers/test_shared_domain.yml", 4) }}
|
|
8
|
+
{{ macros.include_block("domain_driven_design/layers/test_shared_infra.yml", 4) }}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{%- set infra_features = [
|
|
3
|
+
{"feature": "event_bus", "template": "events/mock_event_bus.yml"},
|
|
4
|
+
{"feature": "async_sqlalchemy", "template": "persistence/async_engine_conftest.yml"},
|
|
5
|
+
] %}
|
|
6
|
+
- name: infra
|
|
7
|
+
type: directory
|
|
8
|
+
python: True
|
|
9
|
+
{{ macros.render_children_for(infra_features, 2) }}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{# === Core Project Structure === #}
|
|
3
|
+
{{ macros.include_block("domain_driven_design/source.yml", 0) }}
|
|
4
|
+
{{ macros.include_block("domain_driven_design/test.yml", 0) }}
|
|
5
|
+
{# === Base Configuration Files === #}
|
|
6
|
+
{{ macros.include_block("config_files/pyproject.yml", 0) }}
|
|
7
|
+
{{ macros.include_block("config_files/python_version.yml", 0) }}
|
|
8
|
+
{{ macros.include_block("documentation/license.yml", 0) }}
|
|
9
|
+
{# === CI/CD and Automation Features === #}
|
|
10
|
+
{% set ci_cd_features = [
|
|
11
|
+
{"feature": "github_actions", "template": "github/github_action.yml"},
|
|
12
|
+
{"feature": "github_actions", "template": "github/makefile.yml"},
|
|
13
|
+
{"feature": "github_issues_template", "template": "github/github_issues_template.yml"},
|
|
14
|
+
{"feature": "makefile", "template": "github/makefile.yml"},
|
|
15
|
+
{"feature": "precommit_hook", "template": "github/precommit_hook.yml"},
|
|
16
|
+
{"feature": "precommit_hook", "template": "github/makefile.yml"}
|
|
17
|
+
] %}
|
|
18
|
+
{{ macros.render_features(ci_cd_features, 0) }}
|
|
19
|
+
{# === Git Features === #}
|
|
20
|
+
{% if git.initialize %}
|
|
21
|
+
{{ macros.include_block("config_files/gitignore.yml", 0) }}
|
|
22
|
+
{{ macros.include_block("documentation/readme.yml", 0) }}
|
|
23
|
+
{% endif %}
|
|
24
|
+
{# === Testing and Type Checking === #}
|
|
25
|
+
{% if dependencies | has_dependency("pytest") %}
|
|
26
|
+
{{ macros.include_block("config_files/pytest.yml", 0) }}
|
|
27
|
+
{% endif %}
|
|
28
|
+
{% if dependencies | has_dependency("mypy") %}
|
|
29
|
+
{{ macros.include_block("config_files/mypy.yml", 0) }}
|
|
30
|
+
{% endif %}
|
|
31
|
+
{# === Database Migration === #}
|
|
32
|
+
{{ macros.render_feature_if_enabled("async_alembic", "persistence/async_alembic.yml", 0) }}
|
|
33
|
+
{# === Documentation and Metadata === #}
|
|
34
|
+
{% set doc_features = [
|
|
35
|
+
{"feature": "citation_file", "template": "documentation/citation.yml"},
|
|
36
|
+
{"feature": "security_file", "template": "documentation/security.yml"}
|
|
37
|
+
] %}
|
|
38
|
+
{{ macros.render_features(doc_features, 0) }}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
- name: {{ general.source_name }}
|
|
3
|
+
type: directory
|
|
4
|
+
python: True
|
|
5
|
+
children:
|
|
6
|
+
{{ macros.include_block("domain_driven_design/layers/delivery.yml", 4) }}
|
|
7
|
+
{{ macros.include_block("domain_driven_design/layers/shared.yml", 4) }}
|
|
8
|
+
{%- if template.specify_bounded_context %}
|
|
9
|
+
{{ macros.include_block("domain_driven_design/layers/bounded_context.yml", 4) }}
|
|
10
|
+
{%- endif %}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
- name: test
|
|
3
|
+
type: directory
|
|
4
|
+
python: True
|
|
5
|
+
children:
|
|
6
|
+
{{ macros.include_block("domain_driven_design/layers/test_shared.yml", 4) }}
|
|
7
|
+
{%- if template.specify_bounded_context %}
|
|
8
|
+
{{ macros.include_block("domain_driven_design/layers/bounded_context.yml", 4) }}
|
|
9
|
+
{%- endif %}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
- name: event
|
|
2
|
+
type: directory
|
|
3
|
+
python: True
|
|
4
|
+
children:
|
|
5
|
+
- name: domain_event
|
|
6
|
+
type: file
|
|
7
|
+
extension: .py
|
|
8
|
+
template: event_bus/domain_event.py
|
|
9
|
+
- name: domain_event_subscriber
|
|
10
|
+
type: file
|
|
11
|
+
extension: .py
|
|
12
|
+
template: event_bus/domain_event_subscriber.py
|
|
13
|
+
- name: event_bus
|
|
14
|
+
type: file
|
|
15
|
+
extension: .py
|
|
16
|
+
template: event_bus/event_bus.py
|
|
17
|
+
- name: exchange_type
|
|
18
|
+
type: file
|
|
19
|
+
extension: .py
|
|
20
|
+
template: event_bus/exchange_type.py
|
|
21
|
+
- name: errors
|
|
22
|
+
type: directory
|
|
23
|
+
python: True
|
|
24
|
+
children:
|
|
25
|
+
- name: base_error
|
|
26
|
+
type: file
|
|
27
|
+
extension: .py
|
|
28
|
+
template: exceptions/base_error.py
|
|
29
|
+
- name: domain_error
|
|
30
|
+
type: file
|
|
31
|
+
extension: .py
|
|
32
|
+
template: exceptions/domain_error.py
|
|
33
|
+
- name: domain_event_type_not_found_error
|
|
34
|
+
type: file
|
|
35
|
+
extension: .py
|
|
36
|
+
template: exceptions/domain_event_type_not_found_error.py
|
|
37
|
+
- name: rabbit_mq_connection_not_established_error
|
|
38
|
+
type: file
|
|
39
|
+
extension: .py
|
|
40
|
+
template: exceptions/rabbit_mq_connection_not_established_error.py
|
|
41
|
+
- name: value_objects
|
|
42
|
+
type: directory
|
|
43
|
+
python: True
|
|
44
|
+
children:
|
|
45
|
+
- name: event_aggregate
|
|
46
|
+
type: file
|
|
47
|
+
extension: .py
|
|
48
|
+
template: event_bus/event_aggregate.py
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
- name: event
|
|
2
|
+
type: directory
|
|
3
|
+
python: True
|
|
4
|
+
children:
|
|
5
|
+
- name: domain_event_json_deserializer
|
|
6
|
+
type: file
|
|
7
|
+
extension: .py
|
|
8
|
+
template: event_bus/domain_event_json_deserializer.py
|
|
9
|
+
- name: domain_event_json_serializer
|
|
10
|
+
type: file
|
|
11
|
+
extension: .py
|
|
12
|
+
template: event_bus/domain_event_json_serializer.py
|
|
13
|
+
- name: rabbit_mq
|
|
14
|
+
type: directory
|
|
15
|
+
python: True
|
|
16
|
+
children:
|
|
17
|
+
- name: rabbit_mq_configurer
|
|
18
|
+
type: file
|
|
19
|
+
extension: .py
|
|
20
|
+
template: event_bus/rabbit_mq_configurer.py
|
|
21
|
+
- name: rabbit_mq_connection
|
|
22
|
+
type: file
|
|
23
|
+
extension: .py
|
|
24
|
+
template: event_bus/rabbit_mq_connection.py
|
|
25
|
+
- name: rabbit_mq_consumer
|
|
26
|
+
type: file
|
|
27
|
+
extension: .py
|
|
28
|
+
template: event_bus/rabbit_mq_consumer.py
|
|
29
|
+
- name: rabbit_mq_event_bus
|
|
30
|
+
type: file
|
|
31
|
+
extension: .py
|
|
32
|
+
template: event_bus/rabbit_mq_event_bus.py
|
|
33
|
+
- name: rabbit_mq_queue_formatter
|
|
34
|
+
type: file
|
|
35
|
+
extension: .py
|
|
36
|
+
template: event_bus/rabbit_mq_queue_formatter.py
|
|
37
|
+
- name: rabbit_mq_settings
|
|
38
|
+
type: file
|
|
39
|
+
extension: .py
|
|
40
|
+
template: event_bus/rabbit_mq_settings.py
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
- name: api
|
|
2
|
+
type: directory
|
|
3
|
+
python: True
|
|
4
|
+
children:
|
|
5
|
+
- name: application
|
|
6
|
+
type: file
|
|
7
|
+
extension: .py
|
|
8
|
+
template: fastapi/application.py
|
|
9
|
+
- name: handlers
|
|
10
|
+
type: directory
|
|
11
|
+
python: True
|
|
12
|
+
children:
|
|
13
|
+
- name: error_handlers
|
|
14
|
+
type: file
|
|
15
|
+
extension: .py
|
|
16
|
+
template: fastapi/error_handlers.py
|
|
17
|
+
{% if "async_alembic" in template.built_in_features %}
|
|
18
|
+
- name: lifespan
|
|
19
|
+
type: file
|
|
20
|
+
extension: .py
|
|
21
|
+
template: fastapi/lifespan.py
|
|
22
|
+
{% endif %}
|
|
23
|
+
{% if "logger" in template.built_in_features %}
|
|
24
|
+
- name: middleware
|
|
25
|
+
type: directory
|
|
26
|
+
python: True
|
|
27
|
+
children:
|
|
28
|
+
- name: fastapi_log_middleware
|
|
29
|
+
type: file
|
|
30
|
+
extension: .py
|
|
31
|
+
template: fastapi/fastapi_log_middleware.py
|
|
32
|
+
{% endif %}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
- name: .github
|
|
2
|
+
type: directory
|
|
3
|
+
children:
|
|
4
|
+
- name: actions
|
|
5
|
+
type: directory
|
|
6
|
+
children:
|
|
7
|
+
- name: python_setup
|
|
8
|
+
type: directory
|
|
9
|
+
children:
|
|
10
|
+
- name: action
|
|
11
|
+
type: file
|
|
12
|
+
extension: .yml
|
|
13
|
+
template: github/action.yml
|
|
14
|
+
- name: workflows
|
|
15
|
+
type: directory
|
|
16
|
+
children:
|
|
17
|
+
- name: ci
|
|
18
|
+
type: file
|
|
19
|
+
extension: .yml
|
|
20
|
+
template: github/ci.yml
|
|
21
|
+
- name: release
|
|
22
|
+
type: file
|
|
23
|
+
extension: .yml
|
|
24
|
+
template: github/release.yml
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
- name: .github
|
|
2
|
+
type: directory
|
|
3
|
+
children:
|
|
4
|
+
- name: ISSUE_TEMPLATE
|
|
5
|
+
type: directory
|
|
6
|
+
children:
|
|
7
|
+
- name: bug_report
|
|
8
|
+
type: file
|
|
9
|
+
extension: .yml
|
|
10
|
+
template: github/bug_report.yml
|
|
11
|
+
- name: feature_request
|
|
12
|
+
type: file
|
|
13
|
+
extension: .yml
|
|
14
|
+
template: github/feature_request.yml
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
- name: logger
|
|
2
|
+
type: directory
|
|
3
|
+
python: True
|
|
4
|
+
children:
|
|
5
|
+
- name: json_formatter
|
|
6
|
+
type: file
|
|
7
|
+
extension: .py
|
|
8
|
+
template: logger/json_formatter.py
|
|
9
|
+
- name: file_logger
|
|
10
|
+
type: file
|
|
11
|
+
extension: .py
|
|
12
|
+
template: logger/file_logger.py
|
|
13
|
+
- name: file_rotating_handler
|
|
14
|
+
type: file
|
|
15
|
+
extension: .py
|
|
16
|
+
template: logger/file_rotating_handler.py
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{#
|
|
2
|
+
Macro to include a template and indent its content
|
|
3
|
+
|
|
4
|
+
Args:
|
|
5
|
+
template_name: Name of the template file to include
|
|
6
|
+
indent: Number of spaces to indent the content
|
|
7
|
+
#}
|
|
8
|
+
{%- macro include_block(template_name, indent) -%}
|
|
9
|
+
{%- set content -%}
|
|
10
|
+
{%- include template_name -%}
|
|
11
|
+
{%- endset -%}
|
|
12
|
+
{{ content | indent(indent, true) }}
|
|
13
|
+
{%- endmacro -%}
|
|
14
|
+
|
|
15
|
+
{#
|
|
16
|
+
Renders a specific feature if it's enabled in template.built_in_features
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
feature_name: Name of the feature to check
|
|
20
|
+
template_path: Path to the template file to include
|
|
21
|
+
indent_level: Number of spaces to indent the content
|
|
22
|
+
#}
|
|
23
|
+
{%- macro render_feature_if_enabled(feature_name, template_path, indent=0) -%}
|
|
24
|
+
{%- if feature_name in template.built_in_features -%}
|
|
25
|
+
{{ include_block(template_path, indent) }}
|
|
26
|
+
{%- endif -%}
|
|
27
|
+
{%- endmacro -%}
|
|
28
|
+
|
|
29
|
+
{#
|
|
30
|
+
Renders multiple features from a list
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
features: List of dicts with 'feature' and 'template' keys
|
|
34
|
+
indent_level: Number of spaces to indent the content
|
|
35
|
+
|
|
36
|
+
Example:
|
|
37
|
+
{% set features = [
|
|
38
|
+
{"feature": "event_bus", "template": "event_bus_domain.yml"},
|
|
39
|
+
{"feature": "value_objects", "template": "errors.yml"}
|
|
40
|
+
] %}
|
|
41
|
+
{{ render_features(features, 8) }}
|
|
42
|
+
#}
|
|
43
|
+
{%- macro render_features(features, indent=0) -%}
|
|
44
|
+
{%- set rendered_templates = [] -%}
|
|
45
|
+
{%- for item in features -%}
|
|
46
|
+
{%- if item.feature in template.built_in_features and item.template not in rendered_templates -%}
|
|
47
|
+
{{ include_block(item.template, indent) }}
|
|
48
|
+
{% set _ = rendered_templates.append(item.template) -%}
|
|
49
|
+
{%- endif -%}
|
|
50
|
+
{%- endfor -%}
|
|
51
|
+
{%- endmacro -%}
|
|
52
|
+
|
|
53
|
+
{#
|
|
54
|
+
Conditional wrapper for children nodes
|
|
55
|
+
Only renders the "children:" key and content if there are active features
|
|
56
|
+
|
|
57
|
+
Args:
|
|
58
|
+
features: List of features to check
|
|
59
|
+
indent_level: Base indentation for the children key
|
|
60
|
+
#}
|
|
61
|
+
{%- macro render_children_for(features, indent=0) -%}
|
|
62
|
+
{%- set active_features = [] -%}
|
|
63
|
+
{%- for item in features -%}
|
|
64
|
+
{%- if item.feature in template.built_in_features -%}
|
|
65
|
+
{%- set _ = active_features.append(item) -%}
|
|
66
|
+
{%- endif -%}
|
|
67
|
+
{%- endfor -%}
|
|
68
|
+
{%- if active_features | length > 0 %}
|
|
69
|
+
{{ "children:" | indent(indent, true) }}
|
|
70
|
+
{{ render_features(active_features, indent + 2) }}
|
|
71
|
+
{%- endif -%}
|
|
72
|
+
{%- endmacro -%}
|
|
73
|
+
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
- name: alembic
|
|
2
|
+
type: file
|
|
3
|
+
extension: .ini
|
|
4
|
+
template: persistence/async/alembic.ini
|
|
5
|
+
- name: migrations
|
|
6
|
+
type: directory
|
|
7
|
+
children:
|
|
8
|
+
- name: versions
|
|
9
|
+
type: directory
|
|
10
|
+
- name: README
|
|
11
|
+
type: file
|
|
12
|
+
extension: .md
|
|
13
|
+
template: persistence/async/README.md
|
|
14
|
+
- name: env
|
|
15
|
+
type: file
|
|
16
|
+
extension: .py
|
|
17
|
+
template: persistence/async/env.py
|
|
18
|
+
{% if "async_sqlalchemy" in template.built_in_features %}
|
|
19
|
+
- name: models_metadata
|
|
20
|
+
type: file
|
|
21
|
+
extension: .py
|
|
22
|
+
template: persistence/async/models_metadata.py
|
|
23
|
+
{% endif %}
|
|
24
|
+
- name: script
|
|
25
|
+
type: file
|
|
26
|
+
extension: .py.mako
|
|
27
|
+
template: persistence/async/script.py.mako
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{{ macros.include_block("persistence/persistence.yml", 0) }}
|
|
3
|
+
- name: sqlalchemy
|
|
4
|
+
type: directory
|
|
5
|
+
python: True
|
|
6
|
+
children:
|
|
7
|
+
- name: base
|
|
8
|
+
type: file
|
|
9
|
+
extension: .py
|
|
10
|
+
template: persistence/base.py
|
|
11
|
+
- name: async_session
|
|
12
|
+
type: file
|
|
13
|
+
extension: .py
|
|
14
|
+
template: persistence/async/async_session.py
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
- name: persistence
|
|
2
|
+
type: directory
|
|
3
|
+
python: True
|
|
4
|
+
children:
|
|
5
|
+
- name: sqlalchemy
|
|
6
|
+
type: directory
|
|
7
|
+
python: True
|
|
8
|
+
children:
|
|
9
|
+
- name: base
|
|
10
|
+
type: file
|
|
11
|
+
extension: .py
|
|
12
|
+
template: persistence/base.py
|
|
13
|
+
- name: session_maker
|
|
14
|
+
type: file
|
|
15
|
+
extension: .py
|
|
16
|
+
template: persistence/synchronous/session_maker.py
|
|
17
|
+
- name: sqlalchemy_repository
|
|
18
|
+
type: file
|
|
19
|
+
extension: .py
|
|
20
|
+
template: persistence/synchronous/sqlalchemy_repository.py
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{%- set source_features = [
|
|
3
|
+
{"feature": "value_objects", "template": "errors.yml"},
|
|
4
|
+
{"feature": "event_bus", "template": "events/event_bus_domain.yml"},
|
|
5
|
+
{"feature": "event_bus", "template": "events/event_bus_infra.yml"},
|
|
6
|
+
{"feature": "logger", "template": "logger.yml"},
|
|
7
|
+
{"feature": "async_sqlalchemy", "template": "persistence/async_sqlalchemy.yml"},
|
|
8
|
+
{"feature": "async_alembic", "template": "persistence/alembic_migrator.yml"},
|
|
9
|
+
{"feature": "fastapi_application", "template": "fastapi/fastapi_app.yml"},
|
|
10
|
+
{"feature": "fastapi_application", "template": "fastapi/fastapi_infra.yml"},
|
|
11
|
+
{"feature": "fastapi_application", "template": "fastapi/fastapi_domain.yml"}
|
|
12
|
+
] %}
|
|
13
|
+
{{ macros.render_children_for(source_features, 2) }}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{%- set test_features = [
|
|
3
|
+
{"feature": "async_sqlalchemy", "template": "persistence/async_engine_conftest.yml"},
|
|
4
|
+
{"feature": "event_bus", "template": "standard_project/layers/test_event_bus.yml"}
|
|
5
|
+
] %}
|
|
6
|
+
{{ macros.render_children_for(test_features, 2) }}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{% import "macros.j2" as macros with context %}
|
|
2
|
+
{# === Core Project Structure === #}
|
|
3
|
+
{{ macros.include_block("standard_project/source.yml", 0) }}
|
|
4
|
+
{{ macros.include_block("standard_project/test.yml", 0) }}
|
|
5
|
+
{# === Base Configuration Files === #}
|
|
6
|
+
{{ macros.include_block("config_files/pyproject.yml", 0) }}
|
|
7
|
+
{{ macros.include_block("config_files/python_version.yml", 0) }}
|
|
8
|
+
{{ macros.include_block("documentation/license.yml", 0) }}
|
|
9
|
+
{# === CI/CD and Automation Features === #}
|
|
10
|
+
{% set ci_cd_features = [
|
|
11
|
+
{"feature": "github_actions", "template": "github/github_action.yml"},
|
|
12
|
+
{"feature": "github_actions", "template": "github/makefile.yml"},
|
|
13
|
+
{"feature": "github_issues_template", "template": "github/github_issues_template.yml"},
|
|
14
|
+
{"feature": "makefile", "template": "github/makefile.yml"},
|
|
15
|
+
{"feature": "precommit_hook", "template": "github/precommit_hook.yml"},
|
|
16
|
+
{"feature": "precommit_hook", "template": "github/makefile.yml"}
|
|
17
|
+
] %}
|
|
18
|
+
{{ macros.render_features(ci_cd_features, 0) }}
|
|
19
|
+
{# === Git Features === #}
|
|
20
|
+
{% if git.initialize %}
|
|
21
|
+
{{ macros.include_block("config_files/gitignore.yml", 0) }}
|
|
22
|
+
{{ macros.include_block("documentation/readme.yml", 0) }}
|
|
23
|
+
{% endif %}
|
|
24
|
+
{# === Testing and Type Checking === #}
|
|
25
|
+
{% if dependencies | has_dependency("pytest") %}
|
|
26
|
+
{{ macros.include_block("config_files/pytest.yml", 0) }}
|
|
27
|
+
{% endif %}
|
|
28
|
+
{% if dependencies | has_dependency("mypy") %}
|
|
29
|
+
{{ macros.include_block("config_files/mypy.yml", 0) }}
|
|
30
|
+
{% endif %}
|
|
31
|
+
{# === Database Migration === #}
|
|
32
|
+
{{ macros.render_feature_if_enabled("async_alembic", "persistence/async_alembic.yml", 0) }}
|
|
33
|
+
{# === Documentation and Metadata === #}
|
|
34
|
+
{% set doc_features = [
|
|
35
|
+
{"feature": "citation_file", "template": "documentation/citation.yml"},
|
|
36
|
+
{"feature": "security_file", "template": "documentation/security.yml"}
|
|
37
|
+
] %}
|
|
38
|
+
{{ macros.render_features(doc_features, 0) }}
|