Skip to main content

A lightweight DSL for scaffolding files and folders

Project description

🧱 Bytecraft

A lightweight Domain-Specific Language for scaffolding files and folders — readable by humans, executable by Python.

pip install bytecraft

What it does

Instead of writing setup scripts in Bash or Python, you write simple instructions in a .bc file:

# My project setup

set-working-folder "my-app"

make-folder "src"
make-folder "src/utils"
make-folder "assets"

make-file "README.md" with "# My App"
make-file "src/main.py" with "print('Hello, World!')"
make-file "src/utils/helper.py"

Run it with:

py -m bytecraft setup.bc

Output:

[Bytecraft] Working folder set: my-app
[Bytecraft] Created folder: my-app/src
[Bytecraft] Created folder: my-app/src/utils
[Bytecraft] Created folder: my-app/assets
[Bytecraft] Created file: my-app/README.md
[Bytecraft] Created file: my-app/src/main.py
[Bytecraft] Created file: my-app/src/utils/helper.py

Installation

Requires Python 3.10+

pip install bytecraft

Commands

make-file

Creates a file. Parent directories are created automatically.

make-file "path/to/file.txt"
make-file "path/to/file.txt" with "content here"

If the file already exists, it is overwritten.


make-folder

Creates a directory. Does nothing if it already exists.

make-folder "path/to/folder"

set-working-folder

Sets the base directory for all subsequent relative paths. Created if it doesn't exist.

set-working-folder "my-project"

Comments

Lines starting with # are ignored.

# This is a comment

Forgiving Syntax

Bytecraft is intentionally forgiving. Quotes are optional — if they're missing, Bytecraft will try to interpret your intent anyway:

make-file hello.txt with Hello World

is treated the same as:

make-file "hello.txt" with "Hello World"

Unknown commands are skipped with a warning rather than crashing the script.


Path Resolution

All relative paths are resolved against the set-working-folder if one has been set, otherwise against the directory where you ran the command.

Absolute paths are always used as-is.


Limitations (v0.1)

  • No variables
  • No loops or conditionals
  • No multi-line file content
  • No append mode
  • No imports or includes

These are planned for future versions.


Roadmap

  • Multi-line content blocks
  • Variables and interpolation
  • append-file command
  • Strict mode
  • Template support
  • Import / include system

License

Server-Lab Open-Control License (SOCL) 1.0
Copyright (c) 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

bytecraft-0.1.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

bytecraft-0.1.1-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file bytecraft-0.1.1.tar.gz.

File metadata

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

File hashes

Hashes for bytecraft-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b80a38dca7a9cb61e6601c981ffc61e57c21520df20482cf85d7120fa46427de
MD5 1cb70320b241c2ba44f4884d38bed39c
BLAKE2b-256 b48a0b2f08bd7c28e80c9011e7b12382dadc3145245ce84fe98ca021835ca9b1

See more details on using hashes here.

File details

Details for the file bytecraft-0.1.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for bytecraft-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6a97b92449158d007130af98972c914e81e6102cb95e9406858599846ac7603
MD5 237121587857dd4d04315330b628b73e
BLAKE2b-256 46db4737f82fa5f0f2a2051bf2b62136749c2cc1cf5f3d7805f93ebf218b8fd9

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