Skip to main content

Builds File Trees from TreeScript. If DataLabels are present in TreeScript, a DataDirectory argument is required.

Project description

TreeScript FileTreeBuilder

Script for Building File Trees.

  • Makes your dreams come true.

How To Make The Most Of TreeScript

  1. Think in File Trees:
    • Initial and Final Trees.
    • Tree Templates for New Modules, Packages, Apps.
    • Data Directory and Data Labels.
  2. Prepare Your TreeScript Designs.
    • New Project in any language you want.
    • New Feature in a New Module File Tree.
  3. Plan TreeScript Operations.
    • Split Larger Trees into multiple TreeScript Files.
    • Combine Trim and Build Operations in a Sequence to meet Workflow requirements.
    • Apply other TreeScript Packages to your Workflow:
      • [TreeScript-Diff] : Difference between two TreeScript files.
      • [TreeScript-Files] : Convert TreeScript into a list of File Paths.
      • [TreeScriptify] : Create TreeScript from existing File Trees.
  4. Run TreeScript, as part of your Workflow.
    • Install; add aliases to your terminal config file, if desired.

Script Structure

  • Directory names contain a slash char.
  • The Indentation is 2 spaces per level.

Directory Slash Chars

  • Both directions are accepted: \, /
  • Start or End of the Directory Name: \src or src/
  • No spaces between Name and char.

Example

src/
  __init__.py
  dir/

Project Technical Details

File Tree Builder

Execute the File Tree Builder with the ftb command.

  • Creates Files and Directories
  • If DataLabels are present, a DataDirectory is required.

File Tree Trimmer (Remover)

Execute the File Tree Remover by adding the --trim argument.

  • Removes Files and Empty Directories.
  • DataLabels require DataDirectory.
    • Files are exported to the DataDirectory.

Builder DataLabel

A DataLabel is a link to Text content to be inserted into the file.

  • DataLabel must be present in the DataDirectory, if present in the TreeScript File.
  • DataDirectory contents are checked during the Tree Validation phase of program execution.

Valid DataLabels

The range of accepted DataLabel characters has been narrowed to reduce risk.

  • Letters: A - z
  • Numbers: 0 - 9
  • Punctuation: -_.

Invalid DataLabels

The dot directories are invalid.

  • Current Dir: .
  • Parent Dir: ..

Default Input Reader

Before the Reader receives TreeScript, the input is filtered so comments and empty lines are not ever seen by the Reader. The Default Input Reader processes one line at a time and calculates multiple file tree node properties that it stores in dataclass objects.

It calculates for each node:

  • Name
  • File or directory status
  • Depth in tree
  • (optional) DataArgument

Input Data Argument

The Data Argument specifies what will be inserted into the file that is created. The Data Argument is provided in the Input File, immediately after the File Name (separated by a space). There are two types of Data Arguments:

  • DataLabel
  • InlineContent

Tree Trim Data Directory Feature

The Remover provides an additional feature beyond the removal of files in the Tree. This feature enables Files to be saved to a Data Directory when they are removed. Rather than destroying the file data, it is moved to a new directory.

To-Do Features

  • Append/Prepend
  • Overwrite Prevention
  • Inline Content

Builder File Inline Content (TODO)

Inline Content is written in the Tree Node Structure Input file itself. To distinguish DataContent from a DataLabel, the Content must begin with a special character.

Options for the DataContent character are under consideration.

  • Less than bracket is a good option: <
  • Star char is an alternative: *

This feature is a neat mid-sized improvement that may open up opportunities for more workflow flexibility.

  • Adding a new file late in the process.
    • such as after data directory is already prepared, and you review TS and notice a little thing missing.
    • value-adding option that helps you build files faster, more convenient than the DataDirectory.
  • Workflows that use TreeScript:
    • Easier To Plan, and Communicate What You Did.
    • Package Restructuring, Migrations.
    • Test Environment Setup
    • FileSystem Inventory

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

treescript_builder-0.1.5.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

treescript_builder-0.1.5-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file treescript_builder-0.1.5.tar.gz.

File metadata

  • Download URL: treescript_builder-0.1.5.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for treescript_builder-0.1.5.tar.gz
Algorithm Hash digest
SHA256 dc85bd441fd8349daa9a1cfe8b3cb07f5a1e06f73c223951b27403f58e8470fd
MD5 4ee5e6f7faad521ec833263812d1b662
BLAKE2b-256 e883e15cde774e92675716e79e85a4c8111acea0e67c732fd8f2efeb88436e23

See more details on using hashes here.

Provenance

The following attestation bundles were made for treescript_builder-0.1.5.tar.gz:

Publisher: publish.yml on DK96-OS/treescript-builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file treescript_builder-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for treescript_builder-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 067582ac8f87a8031690004974063d20ddd390a6eb4e76e3b82a6f5428bbb0da
MD5 47d719a59aad4f5368b5e5f7be4f4bbf
BLAKE2b-256 f1de63ff819a840bf3b1a2dbb6b6e6f154dc949219ff8871f3af010abfbf5c7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for treescript_builder-0.1.5-py3-none-any.whl:

Publisher: publish.yml on DK96-OS/treescript-builder

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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