Skip to main content

SQL Database of csv files(RDBMS). Execute SQL queries on csv files.

Project description

Python module to handle csv files as tables of SQL RDBMS. We can pass SQL queries to parse and retreive data from csv files

Usage

import cosevadb
cosevadb.query("select name,age from data/passengers.csv,data/header.csv where native='USA'")

Return type

[sqlcode,'<success/error message>',[result/empty]]

On error  >>> SQLCode=-1, empty result list
On success>>> SQLCode=0

Reserved words

SELECT

FROM

WHERE

Operators supported

Arithmatic operators : +, -, *, /, %

Comparison operators : >, <, >=, <=, =, !=

Logical operators : &,|

Operator precedence (in order from high to low)

'%'

'/'

'*'

'+'

'-'

'<','<='

'>','>='

'!'

'='

'&'

'|'

File formats

Comma seperated value(.csv) files.

Instructions

  • String values should be within ''
  • A file with headers(Comma separated) should be passed along with csv data file
  • As of now only select operations implemented
  • Comparison operator '=' is used instead of '=='
  • Expression evaluation will use BODMAS and have individual operator precedence unlike python or java. i.e., '9-7+1' will result '1'

Licence

MIT Licence. Contributions are welcome

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

cosevadb-0.0.2.tar.gz (7.2 kB view hashes)

Uploaded Source

Built Distribution

cosevadb-0.0.2-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

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