Skip to main content

Execute SQL queries on data present in CSV or Excel files. Also allows to generate the query output files.

Project description

queryeasy

Execute SQL queries on data present in CSV or Excel files. Also allows to generate the query output files.

Features

  • Query the CSV or Excel files using sql queries
  • Provides the option to store the query output to .xls, .xlsx, .csv formats
  • Formats the output to fit in the terminal
  • Removes the spaces from the column headers to ease query process
  • Saves the output file to default dir if no path is specified

Installation

You can pip install the package using

pip install queryeasy

The command line utility will be installed as queryeasy to bin on Linux (e.g. /usr/bin); or as queryeasy.exe to Scripts in your Python installation on Windows (e.g. C:\Python3\Scripts\tabulate.exe).

After installing, check the version

queryeasy --version

Usage

queryeasy [-h] [-s sheet_name] [-o output_file] [-v] filename sql_query

It can be used to execute sql queries on csv file

queryeasy sample.csv "select * from sample"

It can be used to execute sql queries on excel file

queryeasy sample.xls "select * from sample" -s Sheet1
queryeasy sample.xlsx "select * from sample" -s Sheet3

The output of the performed query can be saved to a csv or excel file

queryeasy sample.xls "select * from sample" -s Sheet1 -o /path/output.xls
queryeasy sample.xlsx "select * from sample" -s Sheet3 -o /path/output.xlsx
queryeasy sample.xlsx "select * from sample" -s Sheet3 -o output.xlsx
queryeasy sample.csv "select * from sample" -s Sheet3 -o /path/output.csv
queryeasy sample.csv "select * from sample" -s Sheet3 -o output

Arguments

positional arguments: 
  filename              Enter the file path/name
  sql_query             Enter the SQL query

optional arguments:
  -h, --help            show this help message and exit
  -s sheet_name, --sheet sheet_name
                        Provide the sheet name for excel file
  -o output_file, --output output_file
                        Output file path/name to store results
  -v, --version         show program's version number and exit

Notes

  • Table names used in the SQL query should match the input CSV/Excel file names, without the ".csv" or ".xls" extension
  • While entering query, replace the spaces in column names with underscore(_)
  • The default output file extension is .csv
  • The output file supports ".xlsx", ".xls", ".csv" extensions as of now

Contribute

The library is in initial stage and requires a lot of work, please feel free to contribute

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

queryeasy-0.0.4.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

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

queryeasy-0.0.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file queryeasy-0.0.4.tar.gz.

File metadata

  • Download URL: queryeasy-0.0.4.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

File hashes

Hashes for queryeasy-0.0.4.tar.gz
Algorithm Hash digest
SHA256 f54151197548e7857bdb8a3c85dee2899730c5f7091cf993c8dac1ef10464abd
MD5 eabe6350c98d1017f735f4a5108e3113
BLAKE2b-256 aa0228ad5f5ccf6122b0e5974a4b83022025d5de9078fd99bb304249de7bbef5

See more details on using hashes here.

File details

Details for the file queryeasy-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: queryeasy-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.6

File hashes

Hashes for queryeasy-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d48b6537e6ea1cc8ac434371659c210db3e1b21a4a2f261a25e98f884bf660b6
MD5 19b5e9071754fe5ecc8f4f662501f6fe
BLAKE2b-256 d9bd40b12f876ed3aa0f67052ad942f6ff6a147f7bd3bcefb8bcf091723ea4dd

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