Skip to main content

Parse yaml

Project description

yaml-pipe

PyPI Python Versions PyPI Download Issues Release Drafter

Install

pip install yaml-pipe

How to use

  • --dotindex: extract only.
  • --dotlist: edit only.
  • -f, --file: edit only.

Extract Example 1

---
aaa:
  bbb: bbb
cat sample.yml | yaml-pipe --dotindex "aaa.bbb"

output

bbb

Extract Example 2

---
aaa:
  bbb: bbb
---
xxx:
  yyy: yyy
cat sample.yml | yaml-pipe --block_id 1 --dotindex "xxx.yyy"

output

yyy

Extract Example 3

---
xxx:
  yyy:
    zzz: zzz
cat sample.yml | yaml-pipe --block_id 1 --dotindex "xxx"

output

yyy:
  zzz: zzz

Edit Example 1

sample.yml

---
foo:
  bar: BAR
cat sample.yml | yaml-pipe --dotlist foo.bar="bar"

output

---
foo:
  bar: bar

Edit Example 2

sample.yml

---
foo:
  bar: BAR
---
fizz:
  buzz: BUZZ
cat sample.yml | yaml-pipe --block_id 1 --dotlist fizz.buzz="buzz"

output

---
foo:
  bar: BAR
---
fizz:
  buzz: buzz

example3

sample.yml

---
foo:
  bar: BAR
---
fizz:
  buzz: BUZZ

update.yml

fizz:
  buzz: buzz
cat sample.yml | yaml-pipe --block_id 1 --file update.yml

output

---
foo:
  bar: BAR
---
fizz:
  buzz: buzz

Developers

Linting and test

pyenv local 3.10.4 3.9.13 3.8.13
poetry install
poetry run nox
./test_cli.sh

Upload to PyPI

Default target is testpypi.

make pypi-upload

If you upload to pypi, set empty to TEST_PYPI.

make pypi-upload TEST_PYPI=

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

yaml-pipe-1.2.2.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

yaml_pipe-1.2.2-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file yaml-pipe-1.2.2.tar.gz.

File metadata

  • Download URL: yaml-pipe-1.2.2.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-52-generic

File hashes

Hashes for yaml-pipe-1.2.2.tar.gz
Algorithm Hash digest
SHA256 0390bcd0984096a38e39576b686f1e8beae713fa111a5b4a2554070601d26249
MD5 8668955904626d7834ea23177a223f7f
BLAKE2b-256 2138fdef02cd2a3774e0b852a49f909673d6b86d8fa28b1cdb073f35fbac50c0

See more details on using hashes here.

File details

Details for the file yaml_pipe-1.2.2-py3-none-any.whl.

File metadata

  • Download URL: yaml_pipe-1.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Linux/5.13.0-52-generic

File hashes

Hashes for yaml_pipe-1.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c130ea26260927a7fa68f8226b65bca90aec30087b201ae89d46582ab597148
MD5 2451a8661fc3b2365b8184dbf1771426
BLAKE2b-256 a49e83b52ec06028cabbd3fbcb238653b5848e7c939283a03a8a24d642ca0400

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