Skip to content

Instantly share code, notes, and snippets.

@rossturk
rossturk / astro-cli-hb-analytics.py
Created December 16, 2022 22:44
Grab Homebrew download stats
from datetime import datetime
from astro import sql as aql
from astro.sql.table import Table
from airflow.models import DAG
from git import Repo
from os.path import exists
from airflow.operators.python import get_current_context
from airflow.exceptions import AirflowSkipException
import pandas as pd
import io
projects % sqlite3 ~/.cache/flox/pkgdb-v2/1360681c88df2c468545c993bb3615b3adc51a9af0ac5fbc713873df0c4564f3.sqlite
SQLite version 3.39.5 2022-10-14 20:58:05
Enter ".help" for usage hints.
sqlite> create view v_PnamesPathnames as select json_extract(v.path, "$[#-1]") as pathName, p.pname from v_PackagesPaths v, Packages p where v.id = p.id and pathName != p.pname;
sqlite> select * from v_PnamesPathnames where pathName != pname limit 100;
ArchiSteamFarm|archisteamfarm
EmptyEpsilon|empty-epsilon
Fabric|fabric
% flox -v -v install python  INT ✘ 
`$FLOX_CONFIG_HOME` not set, using "/Users/rturk/.config/flox/"
no default user nix.conf found - weird
Attempting to read own UUID from file
installing packages [python] to Unspecified
[DEBUG] [flox_rust_sdk::models::environment] looking for .flox: starting_path=/Users/rturk/projects/sd-notebook/.flox
[DEBUG] [flox_rust_sdk::models::environment] .flox found: path=/Users/rturk/projects/sd-notebook/.flox
detected concrete environment type: path
[DEBUG] [flox_rust_sdk::models::environment::path_environment] attempting to open .flox directory: /Users/rturk/projects/sd-notebook/.flox
Writing new metrics buffer entry