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 details)

Uploaded Source

Built Distribution

sqlpygen-3.0.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

File details

Details for the file sqlpygen-3.0.0.tar.gz.

File metadata

  • Download URL: sqlpygen-3.0.0.tar.gz
  • Upload date:
  • Size: 33.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for sqlpygen-3.0.0.tar.gz
Algorithm Hash digest
SHA256 268481375d24bc6a1902175b4082e3c2ece4405729c10c8dbdc95ff29338c386
MD5 09f58a2699f1791517f439b8ab165dda
BLAKE2b-256 78514da8e4b8b6889abd87cb42508f2f3aa34f4a83dbda0cdda251802d5334a2

See more details on using hashes here.

File details

Details for the file sqlpygen-3.0.0-py3-none-any.whl.

File metadata

  • Download URL: sqlpygen-3.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for sqlpygen-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 323245d452918c6d176b1aad9cd2b60ae69124804dd5e26f5455f250f27f953d
MD5 1fdc24c4e2116130f123b325ec6419c5
BLAKE2b-256 555b898fe82a6765726e023a6a146b8fadb6f06a279b6468313ac86904f5428c

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