Skip to main content

Declarative project structure language

Project description

Forgen

Forgen is a declarative project structure language. Write a simple .fg script to describe your project layout — folders, files, and their contents — and let Forgen build it for you.

Installation

pip install forgen

Quick Start

Create a script myproject.fg:

project "MyProject"
set build_dir "build"
set resource_dir "resource"

folder "src"
folder "src/utils"

write "README.md" """
# MyProject

Generated by Forgen.
"""

write "src/main.py" """
def main():
    print("Hello, world!")
"""

Then build it:

forgen build myproject.fg ./output

Commands

Command Description
forgen build <script|pkg> <outdir> Build a project from a .fg script or .fgp package
forgen init <dir> Initialise a new Forgen project directory
forgen validate <script> Check a .fg script for errors
forgen pack <projectdir> <out.fgp> Bundle a project into a portable .fgp package
forgen make <dir> <out.fg> Reverse-engineer an existing directory into a .fg script

build flags

Flag Description
--clean Delete the output directory before building
--dry-run Parse and resolve without writing any files
--verbose Print each action as it runs

.fg Script Reference

# Comments start with #

project "ProjectName"          # Required — declares the project name
set key "value"                # Set a variable (string, int, bool, or list)

folder "path/to/dir"           # Create a directory

write "file.txt" "content"     # Write a file with inline content
write "file.txt" """           # Or use a triple-quoted multiline string
multi
line
content
"""

copy "src/file" -> "dest/file" # Copy a file from resource_dir

for x in [1, 2, 3] {          # Loop over a list
    folder "module-{x}"
}

if some_var {                  # Conditional block
    write "debug.log" "enabled"
}

.fgp Packages

A .fgp file is a ZIP archive containing a script.fg entry point and an optional resource/ directory for binary assets. Use forgen pack to create one and forgen build to extract and run it.

License

Server-Lab Open-Control License (SOCL) 1.0 — © 2025 Sourasish Das

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

forgen_tools-0.1.0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

forgen_tools-0.1.0-py3-none-any.whl (12.0 kB view details)

Uploaded Python 3

File details

Details for the file forgen_tools-0.1.0.tar.gz.

File metadata

  • Download URL: forgen_tools-0.1.0.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for forgen_tools-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c54a46915b255fa645549d6320142159fe58937126315aeb9ea1a383290bb89b
MD5 3f4f1c3673802d26124717fce7c9a019
BLAKE2b-256 c59c712e2090b42070018c0d87ab75c0ea96ed0f4e98b093da9307b245993e06

See more details on using hashes here.

File details

Details for the file forgen_tools-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: forgen_tools-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for forgen_tools-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 551ad0bd277596049ca1c53084e47417829c1d8a2a9bdf891771814170a3223f
MD5 bb34a3587cb2a9d6a4543243c9c602eb
BLAKE2b-256 2f53642e6ad544b404bdcd08264c491d5074ab02ece30c2308974e12fbdf1da2

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