SP

SPyQL – SQL with Python in the middle

Hacker News

SPyQL – SQL with Python in the middle

SPyQL ( https://github.com/dcmoura/spyql ) is SQL with Python in the middle, an open-source project fully written in Python for making command-line data processing more intuitive, readable and powerful. Try mixing in the same pot: a SQL SELECT for providing the structure, Python expressions for defining transformations and conditions, the essence of awk as a data-processing language, and the JSON handling capabilities of jq. How does a SPyQL query looks like? $ spyql “ IMPORT pendulum AS p SELECT (p.now() - p.from_timestamp(purchase_ts)).in_days() AS days_ago, sum_agg(price * quantity) AS total FROM csv WHERE department.upper() == 'IT' and purchase_ts is not Null GROUP BY 1 ORDER BY 1 TO json” < my_purchases.csv In a single statement we are 1) reading a CSV (of purchases) with automatic header detection, dialect detection, type inference and casting, 2) filtering out records that do not belong to the IT department or do not have a purchase timestamp 3) summing the total purchases and grouping by how many days ago they happened, 4) sorting from the most to the least recent day and 5) writing the result in JSON format. All this without loading the full dataset into memory. The Readme is loaded with recipes and there is also a demo video: https://vimeo.com/danielcmoura/spyqldemo Any feedback is welcomed! Thank you.

Share card

Actual performance

105points
45comments
Made the leaderboard

Launch Intel predictions

Analyze your own launch →
Hacker NewsStrong engagement from HN community · Strong signals: ide, io · Missing: https docs, excited, just released
79%79% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
71%71% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Product HuntUnlikely to reach the leaderboard · Strong signals: single, open · Missing: mac, agents, macos
45%45% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Strong signals: video · Missing: mobile apps, ios, personal
43%43% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Strong signals: intuitive · Missing: plus, platform, reviews
34%34% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
17%17% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
3%3% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Vi
Vinum – SQL Processor for Python with native Python, Numpy UDF Support65%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Vinum – SQL Processor for Python with native Python, Numpy UDF Support

Hacker News1
Bi
Binder - a lightweight SQL mapper for Python64%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Binder - a lightweight SQL mapper for Python

Hacker News1
pg
pg13, a python ORM with SQL simulator for mocking78%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

pg13, a python ORM with SQL simulator for mocking

Hacker News1
Qu
Quma – Plain SQL in Python72%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Quma – Plain SQL in Python

Hacker News5
SQ
SQLGlot – Customizable Python SQL Transpiler65%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

SQLGlot – Customizable Python SQL Transpiler

Hacker News5
Cs
Csql – Python lib for composeable SQL queries57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Csql – Python lib for composeable SQL queries

Hacker News89
SQ
SQL tests in python, deterministic and fast45%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

SQL tests in python, deterministic and fast

Hacker News2
Co
Convert sql result tuples to json consumable dicts [Python]59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Convert sql result tuples to json consumable dicts [Python]

Hacker News4
Fa
Facata – Connect to SQL Databases from Python61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Facata – Connect to SQL Databases from Python

Hacker News24
Py
Python integration into SQL Server 201748%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Python integration into SQL Server 2017

Hacker News3