Skip to main content

Structlab is a lightweight Python CLI tool that helps you scaffold both folders and files from customizable structures. Define reusable templates, choose your terminal type, and generate complete project layouts in seconds — ideal for rapid project bootstrapping.

Project description

structlab Logo

structlab

A powerful CLI tool for generating and managing project folder structures.

Structlab automates the creation of directories and files based on a predefined layout, helping developers and teams maintain consistency across projects. With commands for initialization, structure freezing, and usage guidance, it streamlines project setup and management.

Table of Contents

Introduction

Structlab is a powerful and flexible CLI tool designed to automate the creation and management of project folder structures. It simplifies the process of setting up standardized directory layouts, ensuring consistency across multiple projects. The generated structure follows a modular design, separating CLI commands, core logic, and utility functions for maintainability and scalability. It is based on layout.txt, allowing users to define custom folder structures effortlessly.

With structlab, you can:

  • Automatically generate project structures from predefined templates.
  • Capture and save the structure of an existing project.
  • Maintain organization and efficiency in project development.

Whether you're working on software development, research, or documentation projects, structlab provides a streamlined way to structure your files and directories.

Features

  • Automated Project Structure Generation – Quickly creates directories and files based on a predefined layout.
  • Structure Freezing – Captures the current project structure and saves it for reuse.
  • Customizable Exclusions – Allows specific files or directories to be ignored while scanning or generating structures.
  • Modular and Extensible – Built with a utility-based architecture for easy expansion and customization.
  • Lightweight and Efficient – Designed for speed and minimal dependencies.
  • Easy Installation and Usage – Packaged for seamless integration with Python projects.

Installation

Prerequisites

Before installing structlab, ensure that you have the following dependencies installed:

  • Python 3.7 or later – Required to run structlab
  • pip – The Python package manager (comes pre-installed with Python)

Installing via pip

You can install structlab globally using pip:

pip install structlab

To install it in a virtual environment:

python -m venv venv
source venv/bin/activate  # On Windows, use: venv\Scripts\activate
pip install structlab

Installing from source

If you want to install the latest development version from source:

git clone https://github.com/anexlab/structlab.git
cd structlab
pip install .

Verifying the installation

After installation, you can verify that structlab is installed correctly by running:

structlab help

Command List

structlab provides several commands to help manage and generate project structures. Below is a list of available commands:

Command Description Usage
init Generates files and folders based on layout.txt in the current directory. structlab init
init . Explicitly generates files and folders in the current directory. structlab init .
init <folder_name> Generates files and folders inside the specified folder. structlab init my_project
freeze Scans the current directory and saves its structure into layout.txt, excluding predefined system folders. structlab freeze
help Displays usage instructions and available commands. structlab help
--version, -v Displays the installed version of structlab. structlab --version or structlab -v

Contributing

We appreciate contributions from the community! If you’d like to improve structlab, follow these steps:

1. Fork & Clone the Repository

First, fork the repository on GitHub and then clone it to your local machine:

git clone https://github.com/anexlab/structlab.git
cd structlab

2. Set Up a Virtual Environment (Optional)

To keep dependencies organized, set up a virtual environment:

# For Linux/macOS (bash/zsh)
python -m venv venv
source venv/bin/activate

# For Windows (CMD)
python -m venv venv
venv\Scripts\activate

# For Windows (PowerShell)
python -m venv venv
venv\Scripts\Activate.ps1

Then, install dependencies:

pip install -r requirements.txt

3. Create a Feature Branch

Create a new branch for your changes:

git checkout -b feature-branch

4. Make Your Changes

Implement your feature or fix issues and commit your changes:

git add .
git commit -m "feat: add new feature or fix issue"

5. Run tests

Ensure all functionality works correctly before submitting changes:

pytest

6. Push Your Changes & Create a Pull Request

Push your changes to your fork and create a pull request:

git push origin feature-branch

Then, go to GitHub, navigate to the Pull Requests section, and submit your PR.

Contribution Guidelines

  • Follow the project's code style and structure.
  • Write meaningful commit messages.
  • Ensure new features are properly documented.
  • All contributions must be reviewed before merging.

License

This project is licensed under the MIT License.
You are free to use, modify, and distribute this project under the terms of the license.
See the LICENSE file for more details.

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

structlab-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

structlab-0.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: structlab-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for structlab-0.1.0.tar.gz
Algorithm Hash digest
SHA256 182220059b110fe64f1a5a1c66c34bc91b94f919bf2fbaf35b0c6c656ff24d21
MD5 8c099cb17bacadc5ba0f0feb5373f829
BLAKE2b-256 08ff36132bc2930d15917d9d37a641e099adb30ea4fa7c6842530cc533e08c9b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: structlab-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for structlab-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3da59fd6fd5e6ab9f107a4641402c919743da7f56106977d0a091998d04b1513
MD5 711fcb5c31662e5d96f1d9ef20f1ecf6
BLAKE2b-256 8af383e4b60f87fee5995de234f8205c96e44666e40fe4cd099ab6f2dcd43954

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