Skip to main content

fsg logo

fsg

Version 0.5.0 Python 3.11+ No dependencies MIT License

Generates clean directory trees that respect .gitignore and keep your docs up to date.

Documentation · Dokumentation · Changelog

fsg demo

Features

  • Respects .gitignore inside a git repository and skips tool directories like .venv or node_modules outside
  • Keeps marked trees in your README up to date, with a check mode for CI
  • Comments next to entries survive every update
  • Several trees per file, each with its own options
  • Sets up a pre-commit or git hook for you
  • Depth, directories only, include and exclude filters, built-in styles or your own glyphs
  • No dependencies, pure Python 3.11+

Installation

uv tool install fsg   # or: pipx install fsg
uvx fsg               # run without installing

Quickstart

Add the markers where the tree should appear:

<!-- fsg:start -->
<!-- fsg:end -->
fsg --update README.md       # writes the tree between the markers
fsg --check README.md        # exit 1 if the tree is out of date
fsg --setup-hook README.md   # updates the tree on every commit

This is the tree of this repository, rendered with [tool.fsg] from pyproject.toml:

src/
└── fsg/
    ├── hooks/            # commit hook setup
    ├── trees/            # git and plain directory walk
    ├── __init__.py
    ├── __main__.py
    ├── cli.py            # arguments and modes
    ├── clipboard.py      # --copy
    ├── config.py         # .fsg.toml and [tool.fsg]
    ├── console.py        # status lines
    ├── constants.py      # styles and ignored names
    ├── errors.py         # errors with hints
    ├── executable.py     # safe PATH lookup
    ├── git.py            # git commands
    ├── glyphs.py         # tree styles
    ├── marked_file.py    # marker blocks
    ├── section.py        # marker options
    ├── text_file.py      # atomic UTF-8 writes
    └── tree_comments.py  # comments kept on update

Documentation

fsg --docs opens the documentation in your browser. It is available in English and German:

  • Installation – uv, pipx and uvx
  • Usage – every option, filters and exit codes
  • Markers & sections – one or several trees per file, comments and hooks
  • Configuration – .fsg.toml and [tool.fsg]
  • Styles – built-in styles, own glyphs and the summary line
  • Recipes – CI checks, pre-commit and monorepos

Development

git clone https://github.com/KarnesTH/fsg.git
cd fsg
uv sync
uv run pytest

Metadata

Release files for fsg 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fsg 0.5.0
File Size Uploaded Provenance Actions
fsg-0.5.0.tar.gz 79.1 kB Without provenance Details for fsg-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fsg 0.5.0
File Interpreter ABI Platform Actions
fsg-0.5.0-py3-none-any.whl Python 3 none any Details for fsg-0.5.0-py3-none-any.whl

Total release size: 111.5 kB

Release files / fsg-0.5.0.tar.gz

Download URL fsg-0.5.0.tar.gz
Size 79.1 kB
Tags Source
SHA-256 checksum
How to use checksums
81f36435e8e9ad3f6a092adb4d03633a725a4c5ad5aa922d2096bcb31959fac6
BLAKE2b-256 checksum
How to use checksums
ba5e56840f71e7174e07b84639cf96714329ccb9043344c2a4a159c65efd9255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / fsg-0.5.0-py3-none-any.whl

Download URL fsg-0.5.0-py3-none-any.whl
Size 32.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da3905d617e0fafab100134b35135b5cba3bf2610f991452ccd8a78ac573de6a
BLAKE2b-256 checksum
How to use checksums
94931b0441bca5cddb43079ef624212f8bee63c80dc6945b56b8d1c40cbce2ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for fsg 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page