Skip to main content

Full file(content) tree → XML

Project description

xmltree

Full file(content) tree → XML

Installation

# Install globally with uv (recommended)
uv tool install xmltree

# Or use directly without installing
uvx xmltree

# Or install with pipx
pipx install xmltree

Usage

# Convert current directory
xmltree

# Convert specific directory
xmltree /path/to/project

# Save to file
xmltree -o project.xml

# Only include specific file types
xmltree -I "*.py" -I "*.md"

# Exclude additional patterns  
xmltree -i "*.log" -i "temp/*"

# Show absolute paths
xmltree --full-paths

# Compact output
xmltree --compact

Example

Given a project structure:

example_project/
├── src/
│   ├── __init__.py
│   ├── main.py
│   └── utils/
│       └── helpers.py
├── tests/
│   └── test_main.py
├── .gitignore
├── README.md
└── pyproject.toml

Running xmltree example_project produces:

<?xml version="1.0" encoding="UTF-8"?>
<directory path="example_project">
  <directory path="src">
    <file path="src/__init__.py">
      <content><![CDATA[
"""Example package."""

__version__ = "0.1.0"]]></content>
    </file>
    <!-- ... more files ... -->
  </directory>
  <file path="README.md">
    <content><![CDATA[
# Example Project

This is a sample project to demonstrate xmltree.]]></content>
  </file>
</directory>

Features

  • Converts directory structures to well-formed XML
  • Respects .gitignore files by default
  • Supports custom ignore and include patterns
  • Pretty-printed output by default
  • File contents wrapped in CDATA sections
  • Pipe-friendly for use with other tools

Why XML?

XML's explicit closing tags make structure unambiguous, unlike YAML's error-prone indentation. File contents can be wrapped in CDATA sections preserving exact formatting, while JSON would require escaping every quote and newline.

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

xmltree-0.1.0.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

xmltree-0.1.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xmltree-0.1.0.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.8

File hashes

Hashes for xmltree-0.1.0.tar.gz
Algorithm Hash digest
SHA256 37db78210061cbd20f89c9e3707369f2113edd6819e6c885c7b9ec9e44ee2325
MD5 464f51589d8c0b5e0cc123b4290d4f14
BLAKE2b-256 264bfa082590885cad782659d8330140553ef7b50dce16839ebf5dff6a331af4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xmltree-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.8

File hashes

Hashes for xmltree-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20412eb78f9637e3f9c4f9afd2d0e99c4f2671e282a8944a3ce7916dec8325f3
MD5 91d93ecdda7238b4428411a1b273de19
BLAKE2b-256 3e857e96f07595d64863a70f89ff77c285219a04cf29cb1843414f08dec7edd0

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