Skip to main content

UNKNOWN

Project description

Pure Python implementation of a subset of the features of jq for YAML documents.

Status: No active development planned, maintenance work only.

If you’re looking for a way to do jq-like filtering on YAML documents, you’ll probably be better off using the yq provided by y2j. y2j provides a wrapper around jq that transforms the input YAML into JSON, calls out to jq, then transforms the result back. This means it automatically supports the full feature set of jq.

If for some reason you need a pure python implementation, this repo is for you.

What’s implemented?

Everything from the Basic Filters section of the jq manual is supported - at least yq acts the same way as jq in the examples there. Object construction also more or less works.

Known limitations

The parsing technology used in this project (parser combinators) is not powerful enough to support parsing some of the more complex features of jq.

Hacking

virtualenv virtualenv
. virtualenv/bin/activate
pip install -r requirements.txt

# Optionally install as a package:
pip install .

There are basic unit-tests for some of the operators, but the meat of the test suite are the functional tests defined in functional_tests/*.yml files and run by run_functional_tests.py.

The whole test suite of jq is in functional_tests/jq.txt, run by run_jq_tests.py. Sections starting with a line containing skip are, surprisingly, skipped - until that functionality is implemented.

They’re all started by nosetests

Roadmap

Here are some steps that’d need to be taken to bring the feature set of this yq closer to that of jq.

  • Work the same way as jq for the “Types and Values” section

  • Operators, functions

  • Check if operators can be refactored

  • Package, release

  • Conditionals, comparisons

  • “Advanced features”, Assignment from the jq manual

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

yq-0.0.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

yq-0.0.2-py2-none-any.whl (14.2 kB view details)

Uploaded Python 2

File details

Details for the file yq-0.0.2.tar.gz.

File metadata

  • Download URL: yq-0.0.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yq-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f912755290e3155312b1963f9b03453416344e0a32e4a294c00e928d58460766
MD5 4a04f0241a912591c0364ca956aa72fb
BLAKE2b-256 161359ac0722672eee7e3da3c10c5ef3ad94ae712a34851196a8e97a52d8e3e5

See more details on using hashes here.

File details

Details for the file yq-0.0.2-py2-none-any.whl.

File metadata

  • Download URL: yq-0.0.2-py2-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for yq-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 7eeb59d2822d611962dee9d94a2e0515b58ff125c2c6ad268716ad64b99f40e8
MD5 0128fb3aed5057bf91090754ebcf155b
BLAKE2b-256 2ea53555543c43e70feb018e900838c29487a25b9fb68ed9ee4eeb83388aef9b

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