Create directory and file architecture from a tree structure text file
Project description
๐๏ธ mkarchi
mkarchi (make architecture) is a command-line tool that generates complete project structures from simple tree-format text files โ and now, with v0.1.6, it can also generate mkarchi syntax from an existing project.
Design your architecture once, apply it anywhere, or reverse-engineer your folders back into mkarchi format.
โจ Features
๐ Create directories from a tree structure ๐ Create empty files automatically โ๏ธ Create files with content using (begincontenu) / (endcontenu) ๐ฏ Preserve indentation (perfect for Python, YAML, JSONโฆ) ๐ฌ Support comments inside structure files ๐ Generate mkarchi structure from existing folders (NEW in v0.1.6) ๐ Fast, simple, and AI-friendly
๐ฆ Installation
โ Recommended (via pip)
pip install mkarchi
Option 2: Install from source
git clone https://github.com/yourusername/mkarchi.git
cd mkarchi
pip install -e .
Option 3: Run as module (no installation)
git clone https://github.com/yourusername/mkarchi.git
cd mkarchi
python -m mkarchi apply structure.txt
๐ Quick Start
1๏ธโฃ Create a structure file
Create a file called structure.txt:
my_project/
โโโ src/
โ โโโ main.py(begincontenu)
โ โ def main():
โ โ print("Hello, World!")
โ โ
โ โ if __name__ == "__main__":
โ โ main()
โ (endcontenu)
โ โโโ utils.py(begincontenu)
โ def helper():
โ return "Helper function"
โ (endcontenu)
โโโ tests/
โ โโโ test_main.py
โโโ README.md(begincontenu)
โ # My Project
โ
โ This is an awesome project!
โ (endcontenu)
โโโ requirements.txt(begincontenu)
pytest>=7.0.0
requests>=2.28.0
(endcontenu)
2๏ธโฃ Run mkarchi
mkarchi apply structure.txt
3๏ธโฃ See the magic โจ
๐ Creating structure from structure.txt...
๐ Created directory: my_project
๐ Created directory: my_project/src
๐ Created file with content: my_project/src/main.py
๐ Created file with content: my_project/src/utils.py
๐ Created directory: my_project/tests
๐ Created file: my_project/tests/test_main.py
๐ Created file with content: my_project/README.md
๐ Created file with content: my_project/requirements.txt
โ
Architecture created successfully!
๐ Usage
mkarchi apply structure.txt
mkarchi give [options] [output_file]
mkarchi --help
mkarchi --version
mkarchi -v
๐ NEW: mkarchi give (v0.1.6)
Generate mkarchi syntax from your current directory.
Default behavior
mkarchi give
โก๏ธ Generates structure.txt โก๏ธ Includes file contents
Generate structure without file contents
mkarchi give -c
or
mkarchi give -c myproject.txt
๐ Structure File Format
๐ Create Directories
Directories must end with /:
my_folder/
โโโ subfolder/
โโโ another_folder/
๐ Create Empty Files
Files without (begincontenu) / (endcontenu) are created empty:
my_folder/
โโโ empty_file.txt
โโโ config.json
โ๏ธ Create Files with Content
Use (begincontenu) and (endcontenu) to define file content:
script.py(begincontenu)
print("Hello!")
print("This is Python code")
(endcontenu)
๐ฏ Indentation Preservation
mkarchi automatically preserves indentation:
utils.py(begincontenu)
def greet(name):
if name:
print(f"Hello, {name}!")
else:
print("Hello, World!")
(endcontenu)
Result (utils.py):
def greet(name):
if name:
print(f"Hello, {name}!")
else:
print("Hello, World!")
๐ฌ Comments Support
Use # for comments in your structure file:
project/
โโโ src/ # Source code
โ โโโ main.py # Entry point
โโโ tests/ # Tests
๐ฏ Use Cases
โก Rapid project scaffolding
๐ฆ Reusable templates
๐ค AI-generated architectures
๐ Documentation & tutorials
๐งฉ Microservices setup
mkarchi apply service1.txt
mkarchi apply service2.txt
๐ง Advanced Example (Python Project)
python_project/
โโโ src/
โ โโโ __init__.py
โ โโโ main.py(begincontenu)
โ """Main module."""
โ
โ def main():
โ print("Starting application...")
โ (endcontenu)
โโโ tests/
โ โโโ __init__.py
โ โโโ test_main.py(begincontenu)
โ import pytest
โ from src.main import main
โ
โ def test_main():
โ assert main() is None
โ (endcontenu)
โโโ setup.py(begincontenu)
โ from setuptools import setup, find_packages
โ
โ setup(
โ name="my-project",
โ version="0.1.0",
โ packages=find_packages(),
โ )
โ (endcontenu)
โโโ README.md
๐ค Contributing
Contributions are welcome! ๐
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-feature
Commit your changes:
git commit -m "Add amazing feature"
Push to your branch:
git push origin feature/amazing-feature
Open a Pull Request
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
๐ Issues & Feedback
Found a bug or have a feature request? Please open an issue on GitHub Issues.
โญ Support the Project
If you find mkarchi useful, please consider giving it a โญ on GitHub!
โค๏ธ Made with passion by Soufyan Rachdi
๐ฆ Installation
โ Recommended (via pip)
pip install mkarchi
Option 2: Install from source
git clone https://github.com/yourusername/mkarchi.git
cd mkarchi
pip install -e .
Option 3: Run as module (no installation)
git clone https://github.com/yourusername/mkarchi.git
cd mkarchi
python -m mkarchi apply structure.txt
๐ Quick Start
1๏ธโฃ Create a structure file
Create a file called structure.txt:
my_project/
โโโ src/
โ โโโ main.py(begincontenu)
โ โ def main():
โ โ print("Hello, World!")
โ โ
โ โ if __name__ == "__main__":
โ โ main()
โ (endcontenu)
โ โโโ utils.py(begincontenu)
โ def helper():
โ return "Helper function"
โ (endcontenu)
โโโ tests/
โ โโโ test_main.py
โโโ README.md(begincontenu)
โ # My Project
โ
โ This is an awesome project!
โ (endcontenu)
โโโ requirements.txt(begincontenu)
pytest>=7.0.0
requests>=2.28.0
(endcontenu)
2๏ธโฃ Run mkarchi
mkarchi apply structure.txt
3๏ธโฃ See the magic โจ
๐ Creating structure from structure.txt...
๐ Created directory: my_project
๐ Created directory: my_project/src
๐ Created file with content: my_project/src/main.py
๐ Created file with content: my_project/src/utils.py
๐ Created directory: my_project/tests
๐ Created file: my_project/tests/test_main.py
๐ Created file with content: my_project/README.md
๐ Created file with content: my_project/requirements.txt
โ
Architecture created successfully!
๐ Usage
mkarchi apply structure.txt
mkarchi give [options] [output_file]
mkarchi --help
mkarchi --version
mkarchi -v
๐ NEW: mkarchi give (v0.1.6)
Generate mkarchi syntax from your current directory.
Default behavior
mkarchi give
โก๏ธ Generates structure.txt โก๏ธ Includes file contents
Generate structure without file contents
mkarchi give -c
or
mkarchi give -c myproject.txt
๐ Structure File Format
๐ Create Directories
Directories must end with /:
my_folder/
โโโ subfolder/
โโโ another_folder/
๐ Create Empty Files
Files without (begincontenu) / (endcontenu) are created empty:
my_folder/
โโโ empty_file.txt
โโโ config.json
โ๏ธ Create Files with Content
Use (begincontenu) and (endcontenu) to define file content:
script.py(begincontenu)
print("Hello!")
print("This is Python code")
(endcontenu)
๐ฏ Indentation Preservation
mkarchi automatically preserves indentation:
utils.py(begincontenu)
def greet(name):
if name:
print(f"Hello, {name}!")
else:
print("Hello, World!")
(endcontenu)
Result (utils.py):
def greet(name):
if name:
print(f"Hello, {name}!")
else:
print("Hello, World!")
๐ฌ Comments Support
Use # for comments in your structure file:
project/
โโโ src/ # Source code
โ โโโ main.py # Entry point
โโโ tests/ # Tests
๐ฏ Use Cases
โก Rapid project scaffolding
๐ฆ Reusable templates
๐ค AI-generated architectures
๐ Documentation & tutorials
๐งฉ Microservices setup
mkarchi apply service1.txt
mkarchi apply service2.txt
๐ง Advanced Example (Python Project)
python_project/
โโโ src/
โ โโโ __init__.py
โ โโโ main.py(begincontenu)
โ """Main module."""
โ
โ def main():
โ print("Starting application...")
โ (endcontenu)
โโโ tests/
โ โโโ __init__.py
โ โโโ test_main.py(begincontenu)
โ import pytest
โ from src.main import main
โ
โ def test_main():
โ assert main() is None
โ (endcontenu)
โโโ setup.py(begincontenu)
โ from setuptools import setup, find_packages
โ
โ setup(
โ name="my-project",
โ version="0.1.0",
โ packages=find_packages(),
โ )
โ (endcontenu)
โโโ README.md
๐ค Contributing
Contributions are welcome! ๐
Fork the repository
Create a feature branch:
git checkout -b feature/amazing-feature
Commit your changes:
git commit -m "Add amazing feature"
Push to your branch:
git push origin feature/amazing-feature
Open a Pull Request
๐ License
This project is licensed under the MIT License. See the LICENSE file for details.
๐ Issues & Feedback
Found a bug or have a feature request? Please open an issue on GitHub Issues.
โญ Support the Project
If you find mkarchi useful, please consider giving it a โญ on GitHub!
โค๏ธ Made with passion by Soufyan Rachdi
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkarchi-0.1.7.tar.gz.
File metadata
- Download URL: mkarchi-0.1.7.tar.gz
- Upload date:
- Size: 14.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c39c7fcbe073d0c1c29b3c4bef7cb2761274277d270e0d361104748fe7521d75
|
|
| MD5 |
c8d31b9120708dbb934d6acf9f7e241b
|
|
| BLAKE2b-256 |
ef57615bc5f1b05621a55887ceae617126062f9b1dc1fcd6069cb92c07b78d11
|
File details
Details for the file mkarchi-0.1.7-py3-none-any.whl.
File metadata
- Download URL: mkarchi-0.1.7-py3-none-any.whl
- Upload date:
- Size: 14.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5773037cca0e05943c19c195dc67749570358f5cbe4a47719efe271c0158755b
|
|
| MD5 |
15c27d17c83087d3d9f0fbb0f9cf2f20
|
|
| BLAKE2b-256 |
39b014a09da1ad12246de9810918a715be71bc3f1310c0f16ff467be84ebbfa0
|