Skip to main content

Structor

Simple library that allow you to create templates of folders/files structure and generate them from a cli (like done in angular, django, react...)


Installation:

On macOS

brew install pipx
pipx ensurepath
pipx install structor

On Linux, install via pip (requires pip 19.0 or later)

python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install structor

On Windows, install via pip (requires pip 19.0 or later)

# If you installed python using the app-store, replace `python` with `python3` in the next line.
# If you have a pre-installed version on windows replace `python` with `py`
python -m pip install --user pipx
python -m pipx ensurepath
pipx install structor

Initialization

Run the command "structor init" to initialize a sample template. this will generate the folder and the yaml file.

  • In this example, the command "structor run startproject" will create all the folders and the files in the startproject section and the command "structor run addmodule my_new_module" will create new modules/components
---
commands:
  startproject:
    src:
    - __init__.py
    src > config:
    - __init__.py
    - config.py
    - local_config.py.dist
    src > modules:
    - __init__.py
    src > static: []
  addmodule:
    src > modules > {{APP-NAME}}:
    - __init__.py
    - "{{APP-NAME}}.py"
    - "models.py"
    - "views.py"
    - "controllers.py"
replacement:
  "{{APP-NAME}}": "**1"
file-template:
  src > modules > {{APP-NAME}} > {{APP-NAME}}.py: "my_template_file.py.struct"
  • The values "**1", "**2"... will be replaced by the arguments passed in the cli.
  • All values put in the "replacement" section will be replaced in the folders/files and files content.
  • The "file-template" section allow you to init the created files from a file template

Release files for structor 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for structor 1.0.4
File Size Uploaded
structor-1.0.4.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for structor 1.0.4
File Interpreter ABI Platform
structor-1.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / structor-1.0.4.tar.gz

Download URL structor-1.0.4.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
96b8e7110d3f810a810b50a4ebca5d0f304e74ebff487a5478c0c9950e8ab92b
BLAKE2b-256 checksum
How to use checksums
d0a0d57cbce725a3db64b676437de334ea506b7ddbd02db141a6244ebdd5aed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / structor-1.0.4-py3-none-any.whl

Download URL structor-1.0.4-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46ea81fdb8f81c3a79f2ea8a6938520470b43067b960fa66de368f3417df0f31
BLAKE2b-256 checksum
How to use checksums
8ca78a9b205f4b491c46e7b0e44bc97e34c345058649c965cd56ddc4d0c98897
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release history Release notifications | RSS feed

This release

1.0.4 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page