Calculate JSON Pointers to each value within a YAML document along with the line, column and character position for the start and end of that value
Project description
YamlSourceMap
Calculate JSON Pointers to each value within a YAML document along with the line, column and character position for the start and end of that value.
For example:
python -m pip install yaml_source_map
from yaml_source_map import calculate
print(calculate('foo: bar'))
The above prints:
{
"": Entry(
value_start=Location(line=0, column=0, position=0),
value_end=Location(line=0, column=8, position=8),
key_start=None,
key_end=None,
),
"/foo": Entry(
value_start=Location(line=0, column=5, position=5),
value_end=Location(line=0, column=8, position=8),
key_start=Location(line=0, column=0, position=0),
key_end=Location(line=0, column=3, position=3),
),
}
The following features have been implemented:
- support for primitive types (
strings
,numbers
,booleans
andnull
), - support for structural types (
sequence
andmapping
).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yaml_source_map-1.0.0.tar.gz
(5.2 kB
view hashes)
Built Distribution
Close
Hashes for yaml_source_map-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09ddc43127818632385472cef2d101c5e202e99cc2d55ea4251c9db7c7bea094 |
|
MD5 | cc803e18787691a0e0932bbc17a31c9b |
|
BLAKE2b-256 | fbcd15e1b7569829f464532a281590dfd62c80efc3e763a88f99d5a846e22d82 |