Skip to main content

DLApp

DLApp is the query utility for dictionary or list.

Installation

pip install dlapp

Features

  • support a simple wildcard characters ?, *, [], [!]
  • support regex
  • support custom keywords
  • support SQL-like select statement
  • support GUI application

Dependencies

Usage

(venv) test@test-machine ~ % dlapp --help
usage: dlapp [options]

dlapp application

optional arguments:
  -h, --help            show this help message and exit
  --gui                 Launch a dlapp GUI application.
  -f FILENAME, --filename FILENAME
                        JSON, YAML, or CSV file name.
  -e {csv,json,yaml,yml}, --filetype {csv,json,yaml,yml}
                        File type can be either json, yaml, yml, or csv.
  -l LOOKUP, --lookup LOOKUP
                        Lookup criteria for searching list or dictionary.
  -s SELECT_STATEMENT, --select SELECT_STATEMENT
                        Select statement to enhance multiple searching criteria.
  -t, --tabular         Show result in tabular format.
  -d, --dependency      Show Python package dependencies.
  -u {base,csv,json,yaml}, --tutorial {base,csv,json,yaml}
                        Tutorial can be either base, csv, json, or yaml.
(venv) test@test-machine ~ %

Getting Started

Development

>>> # test data
>>> lst_of_dict = [
...     { "title": "ABC Widget", "name": "abc", "width": 500},
...     { "title": "DEF Widget", "name": "def", "width": 300},
...     { "title": "MNP Widget", "name": "mnp", "width": 455},
...     { "title": "XYZ Widget", "name": "xyz", "width": 600}
... ]
>>>
>>> from dlapp import DLQuery
>>>
>>> query_obj = DLQuery(lst_of_dict)
>>>
>>> # find any value of title starting with A or X
>>> query_obj.find(lookup="title=_wildcard([AX]*)")
['ABC Widget', 'XYZ Widget']
>>>
>>> # find any data of title starting with A or X 
>>> # and select title, width where width lt 550
>>> query_obj.find(lookup="title=_wildcard([AX]*)", select="SELECT title, width WHERE width lt 550")
[{'title': 'ABC Widget', 'width': 500}]
>>>
>>>
>>>
>>> # assuming /path/sample.json file has the same structure data as lst_of_dict
>>> from dlapp import create_from_json_file
>>>
>>> query_obj = create_from_json_file('/path/sample.json')
>>>
>>> query_obj.find(lookup="title=_wildcard([AX]*)")
['ABC Widget', 'XYZ Widget']
>>>
>>> # to query json string data, use
>>> from dlapp import create_from_json_data
>>>
>>>
>>>
>>> # to query yaml file, use
>>> from dlapp import create_from_yaml_file
>>>
>>> # to query yaml string data, use
>>> from dlapp import create_from_yaml_data
>>>
>>>
>>>
>>> # to query csv file, use
>>> from dlapp import create_from_csv_file
>>>
>>> # to query csv string data, use
>>> from dlapp import create_from_yaml_file

Console command line

Open DLApp application

$ dl-app                      # using python entry point
$ dlapp --gui                 # using console command line
$ python -m dlapp --gui       # using python module invocation

Search json, yaml, or csv file

$ # assuming that /path/sample.json has the same structure data as lst_of_dict
$ dlapp --filename=/path/sample.json --lookup="title=_wildcard([AX]*)"
['ABC Widget', 'XYZ Widget']
$
$ dlapp --filename=/path/sample.json --lookup="title=_wildcard([AX]*)" --select="SELECT title, width WHERE width lt 550"
[{'title': 'ABC Widget', 'width': 500}]
$
$ # the same syntax can apply for yaml, yml, or csv file. 

Bugs/Requests

Please use the GitHub issue tracker to submit bugs or request features.

Licenses

Metadata

Release files for dlapp 0.3.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dlapp 0.3.6
File Size Uploaded Provenance Actions
dlapp-0.3.6.tar.gz 37.5 kB Without provenance Details for dlapp-0.3.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dlapp 0.3.6
File Interpreter ABI Platform Actions
dlapp-0.3.6-py3-none-any.whl Python 3 none any Details for dlapp-0.3.6-py3-none-any.whl

Total release size: 78.4 kB

Release files / dlapp-0.3.6.tar.gz

Download URL dlapp-0.3.6.tar.gz
Size 37.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e2372a5a4bc9fe4a96e8f5877c87337b80a2f7c6bb33ee41bcf548c34a63d7a1
BLAKE2b-256 checksum
How to use checksums
c183af2baf0d209f4a6ef13991f011e31369136ecc236fbc9cfa2869c62632ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Release files / dlapp-0.3.6-py3-none-any.whl

Download URL dlapp-0.3.6-py3-none-any.whl
Size 40.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e7f1aef0835afaecbe2888e94fbcb5a6850b92d7e74a6f4bbcb94b868eddc09
BLAKE2b-256 checksum
How to use checksums
617e761333c8c0f1860ac9ac614090e64efa3bdd55f199fba97ffe7869e0067e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6

Security for dlapp 0.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page