You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Built on [tree-sitter-yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml)
7
-
via the [yamlpath](https://crates.io/crates/yamlpath) and
8
-
[yamlpatch](https://crates.io/crates/yamlpatch) Rust crates, with Python
9
-
bindings through [PyO3](https://pyo3.rs).
5
+
Edit YAML files from Python, while respecting format and comments during the round-trip.
6
+
7
+
Built on [tree-sitter-yaml](https://github.com/tree-sitter-grammars/tree-sitter-yaml) via the [yamlpath](https://crates.io/crates/yamlpath) and [yamlpatch](https://crates.io/crates/yamlpatch) Rust crates.
10
8
11
9
## Installation
12
10
13
-
```
14
-
pip install yamltrip
15
-
```
11
+
```console
12
+
# With uv
13
+
$ uv add yamltrip
16
14
17
-
Requires Python 3.10+. Distributed as pre-built wheels (no Rust toolchain
integers only. Python-style negative indices are not supported.
127
-
-**Editor write-back is best-effort** — `Editor` detects external file
128
-
modifications between enter and exit, but the check-then-write is not
129
-
atomic. It is not suitable for environments with concurrent writers.
130
-
-**Line endings preserved as-is** — no CRLF/LF normalization is performed.
131
-
Mixed line endings in the input are passed through unchanged.
132
-
133
-
## Development
134
-
135
-
```bash
136
-
# Install dev dependencies
137
-
uv sync
138
-
139
-
# Build and test
140
-
uv run pytest
141
-
142
-
# Lint
143
-
uv run ruff check
144
-
uv run ruff format --check
145
-
```
128
+
intermediate mappings. Only string keys create new mappings.
129
+
-**No negative sequence indices.** Python-style negative indexing is not
130
+
supported.
131
+
132
+
## Acknowledgements
133
+
134
+
yamltrip depends entirely on the [yamlpath](https://github.com/zizmorcore/zizmor/tree/main/crates/yamlpath) and [yamlpatch](https://github.com/zizmorcore/zizmor/tree/main/crates/yamlpatch) Rust crates for format-preserving YAML parsing and patching. These libraries use tree-sitter to query and modify YAML source text without discarding comments, whitespace, or key ordering. All of the core logic in yamltrip
135
+
passes through them. Thanks to [William Woodruff](https://github.com/woodruffw) for creating and maintaining both crates as part of [zizmor](https://github.com/zizmorcore/zizmor).
0 commit comments