Skip to main content

Default template for PDM package

Project description

Unit Testing Pre Commit Checks Publish

PyPI MIT

🔄 InverSQL

Generate SQL that match a set of records by decomposing decision trees

  1. User doesn't want to write SQL.
  2. User uploads CSV to inversql streamlit app
  3. User selects cells (that will be selected by the SQL).
  4. We overfit a scikit-learn binary decision tree on the data.
  5. We decompose the tree, convert to boolean logic (explainable AI part).
  6. We simplify the logic with sympy.
  7. Generate SQL from previous steps (joins to JOIN and boolean to WHERE).
  8. User sees the SQL.
  9. User is happy.

🎬 Demo in a GIF 🏛️ Architecture diagram
Quick Demo
Link to live demo site here.
Architecture Diagram

🏎️ Performance

For each individual SQL query candidate (the shortest one is displayed in the UI), we need to retrain a new decision tree.

But... The decision tree fitting is honestly fast, don't worry about this.

🌟 Give us a star!

That's pretty much it!

If you have read this far, please consider giving me a star (⭐) or a fork (🍴).

This will keep my motivation going!

Or if you have too much cash at hand: BuyMeACoffee

If you REALLY like my work, nowadays I'm working on aioway, it's an optimizing compiler approach to deep learning, check it out!

👨‍👨‍👦‍👦 Contributors

Contribution welcome!

To contribute, refer to CONTRIBUTING.md, and our CODE_OF_CONDUCT.md.

🎨 Inspiration.

Inspired by regexgen's process. Instead of regex we do SQL. Instead of selecting text we do select records. Decision tree is my inspiration tho.

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

inversql-0.1.0.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

inversql-0.1.0-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file inversql-0.1.0.tar.gz.

File metadata

  • Download URL: inversql-0.1.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.27.0 CPython/3.14.5 Linux/6.17.0-1015-azure

File hashes

Hashes for inversql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 152f1ee5fa74c74489b3bf18d7ff522bca758807e239acf9224a0669f3b41209
MD5 9daf1dc50d491a363f9269b9bbcc8f7b
BLAKE2b-256 183e603698a6b8b957c5a04fa3458a60d8bdb339b460f6381e8ea71e07999d50

See more details on using hashes here.

File details

Details for the file inversql-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: inversql-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: pdm/2.27.0 CPython/3.14.5 Linux/6.17.0-1015-azure

File hashes

Hashes for inversql-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8426d19b59e82537879f7be7517599e545d2c6416d0b470b2d1acba7997acdb0
MD5 82953256142746af8d37a9a478967fde
BLAKE2b-256 18f2cecb50a750af8777a9f51837b687f2a33b9772f1cbfc824fb2728b8dd0a8

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