nowfound

Dev tools · January 25, 2022

SS

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…

Visit github.comAlternativestop 25% of January 2022

What it does

In the maker’s words, at launch

SPyQL (https:&#x2F;&#x2F;github.com&#x2F;dcmoura&#x2F;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:&#x2F;&#x2F;vimeo.com&#x2F;danielcmoura&#x2F;spyqldemo Any feedback is welcomed! Thank you.

Does the same job

all alternatives →
  • CP
  • JupySQL2023 · ▲115

    JupySQL is a SQL client for Jupyter

  • Hubql2023 · ▲109

    Turn data models and APIs into diagrams and documentation

  • ShapedQLJan 2026 · ▲211

    The SQL engine for search, feeds, and AI agents

  • SQ
    SQLite query inside a Bash function2021 · ▲134

    Part of the workflow for building my website is the generation of a table in tab-separated column format (.tsv). The source data is found in four other .tsv files. I use an SQLite query to perform a 4-way join and write out the new table. For convenience, I wrote a script that encapsulates the query inside a Bash function. The example below illustrates this technique. repertoire() { pushd $CMM_SOURCES&#x2F;_data sqlite3 <<EOS .headers on .mode tabs .import category.tsv category .import composition.tsv composition .import concert.tsv concert .import program.tsv program .once repertoire.tsv…

  • SQLPilot2024 · ▲149

    AI First SQL Editor

More dev tools this month

the category →
  • Dograh592

    The open source VAPI alternative

    Dev tools · 25d ago · dograh.com

  • Meridian530

    Don't let your work go unnoticed. Get promoted!

    Dev tools · 20d ago · meridiona.com

  • x1516

    Lovable for iPhone apps go from idea to App Store

    Dev tools · 11d ago · x1.new

  • Open-source GTM skills for technical founders

    Dev tools · 29d ago · gtmcofounder.com

  • Nuphos380

    The AI-Native DevOps Workspace.

    Dev tools · 24d ago · nuphos.ai

  • OpenTrailPaper is open-source bike computer firmware for the LilyGO T5S3 4.7" E-Paper PRO. It supports offline maps, GPX routes, FIT recording and Bluetooth sensors.

    Dev tools · 1d ago · opentrailpaper.com

Launched alongside, January 2022

the whole month →
  • LA

    Life & fun · 2022 · looptap.vasanthv.com

  • Fig956

    Autocomplete for the Terminal

    Dev tools · 2022 · fig.io

  • The world's best copy. In one place.

    Growth · 2022 · marketingexamples.com

  • WP

    History: Last year I had to replace the tire on my bike, and I was surprised how difficult it was to find a suitable new tire. There were a lot of numbers written on the casing, so I googled what they meant. In the end I was successful, but I didn't want to do the same work again for the next bike after I've forgotten the details. So I wrote this website. Technically, the web page is kept very simple, no frameworks, no templates, no website builder. It uses HTML5, CSS and JavaScript, and it privides a responsive layout for mobile usage. I'm happy to receive feedback. If you have tried the…

    Life & fun · 2022 · fahrrad-tools.de

  • The ultimate MVP cheat sheet with 60+ startup formulas

    Dev tools · 2022 · mvprecipes.com

  • Design real websites right on the canvas, publish in seconds

    Dev tools · 2022