Skip to main content

pickle-query Tool

Project description

pq

PQ is a jq-like viewer/processing tool for pickle files.

howto

# pq '' file.pkl
{'other': 456, 'test': 123}
# pq '' file.pkl -f table
|other|test|
| 456 |123 |
# pq 'keys' file.pkl
['test', 'other']
# pq '.["test"]' file.pkl
123
# pq 'eval({"value": i["other"] + i["test"]})' file.pkl -f table
|value|
|=====|
| 579 |

Implemented filters

Filter Usage Description
flat .[] Extract elements from list to apply filters on each
keys keys Extract keys from dictionary or list(range(len(list))) on a list
accessor .ATTRIBUTE or .[INDEX] Read attribute from object or index on a list/dictionary
sort sort(FILTEREXPR) Order elements by result of filter expression (accessor, eval)
eval eval(EVALEXPR) Apply EVALEXPR on items of list. EVALEXPR is a python expression with i as parameter (example: i["separation"], {"firstname": i["name"].split()[0], "lastname": i["name"].split()[1]})

Formatting filters

Type Description
pretty DEFAULT, pretty prints python structure (pprint module)
table prints list of dictionaries as a table (only common keys)

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

pq-tool-0.2.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

pq_tool-0.2.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file pq-tool-0.2.0.tar.gz.

File metadata

  • Download URL: pq-tool-0.2.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for pq-tool-0.2.0.tar.gz
Algorithm Hash digest
SHA256 cfedf92af9a92ee8a48259ecd0989d0777ad776ee5db91e9cc6c1e7988b53bd1
MD5 7cd929ce3feaf41a3499528ce663ef05
BLAKE2b-256 bfd4d82148970ef9e7240c9df62097dc9ccca281a245af8d3d174a7101b97e76

See more details on using hashes here.

File details

Details for the file pq_tool-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pq_tool-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.22.0 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.3 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for pq_tool-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 afb5f71ef7e524e1017aa37e91cb1e97edd9ebf98e09befb5a8ec604f98f3ee3
MD5 2570716569a2f591c84f52fc89807354
BLAKE2b-256 2d7dfe4eaffbd6117f9a3c24767eb4a71635dfb2bfce8b0533c105969285a198

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page