Skip to main content

Generate type annotated Python code from annotated SQL

Project description

sqlpygen is a utility to generate type annotated Python code from annotated SQL.

The current version of the tool only supports generating code for SQLite3.

Installation

You can install SqlPyGen using pip.

$ pip install sqlpygen

Example Usage

When using sqlpygen to generate Python code from SQL, one creates a sqlpygen file. See examples directory for syntax of sqlpygen files.

Next use the following command to generate the python code.

$ cd examples
$ sqlpygen compile example1.sqlpygen
Executed schema table_stocks successfully
Executed query insert_into_stocks successfully
Executed query select_from_stocks successfully
Executed query count_stocks successfully
Writing output to: example1.py
Module example1 generated successfully.

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

sqlpygen-3.0.0.tar.gz (33.0 kB view hashes)

Uploaded Source

Built Distribution

sqlpygen-3.0.0-py3-none-any.whl (18.1 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