Skip to main content

Scaffold production-ready project folder structures from a CLI or from Python

Project description

       ___                      ______
  ____/ (_)__________________ _/ __/ /_
 / __  / / ___/ ___/ ___/ __ `/ /_/ __/
/ /_/ / / /  / /__/ /  / /_/ / __/ /_
\__,_/_/_/   \___/_/   \__,_/_/  \__/

PyPI Python versions License

Scaffold production-ready project folder structures — from the CLI or from Python.

Install

pip install pydircraft
# or
uv add pydircraft

This installs the dircraft command and the dircraft Python package.

CLI usage

Once installed, the dircraft command is available on your PATH:

# explicit flags
dircraft --lang python --name agent --type dev

# positional shorthand — same result
dircraft python agent dev

# no args at all → defaults to python / project / dev
dircraft

# only override what you need
dircraft --name myapp

# re-run into a folder that already has files in it
dircraft python agent dev --force
Flag Default Meaning
--lang / 1st arg python Language to scaffold for
--name / 2nd arg project Name of the folder to create
--type / 3rd arg dev Project type
--force off Overwrite a non-empty target folder

Currently supported: --lang python --type dev, which creates a full-stack development scaffold in the directory the command is run from:

<name>/
├── backend/            # FastAPI app (app/, tests/, scripts/, Dockerfile, requirements.txt)
├── frontend/           # Streamlit app (main.py, pages/, services/, Dockerfile, requirements.txt)
├── .gitignore
├── .env / .env.example
├── .editorconfig
├── docker-compose.yml
└── README.md

Run it:

cd agent/backend && pip install -r requirements.txt && uvicorn app.main:app --reload
cd agent/frontend && pip install -r requirements.txt && streamlit run main.py
# or, with Docker
cd agent && docker-compose up --build

More --lang / --type combinations will be added over time.

Library usage

DirectoryCreator also works standalone, from a plain list of paths:

from dircraft import DirectoryCreator

folder_paths = [
    "project_root/src",
    "project_root/tests",
    "project_root/docs",
    "project_root/assets/images",
    "project_root/assets/styles",
]

DirectoryCreator().create(folder_paths)
print("✅ Folder structure created successfully")

Anything with a file extension is created as a file, everything else as a directory.

Or from a dict of path -> content, when you want files pre-filled (None for a plain directory):

from dircraft import DirectoryCreator

paths = {
    "project_root/src/main.py": "# FastAPI entry\n",
    "project_root/README.md": "# My Project\n",
    "project_root/tests": None,
}

DirectoryCreator().create(paths)
print("✅ Structure + files created")

More examples in examples/.

License

Apache License 2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydircraft-0.2.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydircraft-0.2.0-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file pydircraft-0.2.0.tar.gz.

File metadata

  • Download URL: pydircraft-0.2.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for pydircraft-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f3e2933b7287c212f5bdf1da376ec1a784db8ae1a043add13ff83421f3a4163c
MD5 6da80cab5f06c435f2c43fef4e7cadaa
BLAKE2b-256 6dfb6bde36f34d1c348531dff1f8ace67fee34230fe9a0f542b21dfea59e87e0

See more details on using hashes here.

File details

Details for the file pydircraft-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pydircraft-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for pydircraft-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2e02dc4608520b139b7402ab2f3d00bbe9b0f0758cfda4d430ce0b5af2b89ee7
MD5 541acf13a480e73eab54fd17f5b54889
BLAKE2b-256 c820b68bedcc70ea53d4ad9f4e1f38a11370a69050cfe8a4a709a223e924a91d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page