complete-computing-environment/datasette-dogsheep.org

127 lines
4.2 KiB
Org Mode

:PROPERTIES:
:roam_refs: https://datasette.io/
:ID: 20220727T144236.025346
:ROAM_ALIASES: Datasette
:END:
#+title: Datasette: An open source multi-tool for exploring and publishing data
#+filetags: :Archive:CCE:Development:Tools:
#+AUTO_TANGLE: t
#+ARCOLOGY_KEY: cce/datasette
#+ARCOLOGY_ALLOW_CRAWL: t
[[file:archive.org][Archive]] [[id:a7420bb9-395f-4afa-92fb-8eaa0b8a4cd8][Tools]]
#+BEGIN_QUOTE
Datasette is a tool for exploring and publishing data. It helps people take data of any shape, analyze and explore it, and publish it as an interactive website and accompanying API.
Datasette is aimed at data journalists, museum curators, archivists, local governments, scientists, researchers and anyone else who has data that they wish to share with the world. It is part of a wider ecosystem of 40 tools and 93 plugins dedicated to making working with structured data as productive as possible.
#+END_QUOTE
These could be used to generate [[id:1fb8fb45-fac5-4449-a347-d55118bb377e][org-mode]] files for [[id:1d917282-ecf4-4d4c-ba49-628cbb4bb8cc][The Arcology Project]] and my [[id:knowledge_base][Knowledge Base]]....
* NEXT pull ~/DataExports from [[id:20211029T115928.954970][Virtuous Cassette]] and move to [[id:cce/syncthing][Syncthing]]
* Inaturalist to [[roam:Sqlite][Sqlite]]
:PROPERTIES:
:ID: 20220727T152924.019338
:END:
Slurp: [[shell:inaturalist-to-sqlite ~/DataExports/inaturalist.db rrix &]]
#+begin_src nix :tangle ~/arroyo-nix/pkgs/inaturalist-to-sqlite.nix
{ pkgs ? import <nixpkgs>,
python ? pkgs.python3,
... }:
python.pkgs.buildPythonPackage {
pname = "inaturalist-to-sqlite";
version = pkgs.lib.pkgVersions.inaturalist-to-sqlite.version;
src = pkgs.callPackage pkgs.lib.pkgVersions.inaturalist-to-sqlite.src {};
propagatedBuildInputs = with python.pkgs; [
sqlite-utils
click
requests
];
checkInputs = with python.pkgs; [
pytest
];
meta = with pkgs.lib; {
description = "Create a SQLite database containing your observation history from iNaturalist";
homepage = "https://github.com/dogsheep/inaturalist-to-sqlite";
platforms = platforms.unix;
maintainers = with maintainers; [rrix];
license = with licenses; [ asl20 ];
};
}
#+end_src
* Twitter to [[roam:Sqlite][Sqlite]]
:PROPERTIES:
:ID: 20220727T152922.043013
:END:
- Slurp favorites: [[shell:twitter-to-sqlite favorites --auth ~/sync/auth.json ~/"DataExports/twitter-faves.db" &]]
- Slurp followers: [[shell:twitter-to-sqlite followers --auth ~/sync/auth.json ~/"DataExports/twitter-follows.db" &]]
- Track [[id:20220727T152854.913076][Twitter Following Deltas]]
#+begin_example sql
sqlite> SELECT id, full_text FROM tweets WHERE ROWID IN (SELECT ROWID FROM tweets_fts WHERE tweets_fts MATCH 'quick take' ORDER BY rank);
1545048960699551744|@deejaygeejaygee quick take https://twitter.com/MartinLundfall/status/1545048960699551744/video/1
#+end_example
#+begin_src nix :tangle ~/arroyo-nix/pkgs/twitter-to-sqlite.nix
{ pkgs ? import <nixpkgs>,
python ? pkgs.python3,
... }:
python.pkgs.buildPythonPackage {
pname = "twitter-to-sqlite";
version = pkgs.lib.pkgVersions.twitter-to-sqlite.version;
src = pkgs.callPackage pkgs.lib.pkgVersions.twitter-to-sqlite.src {};
propagatedBuildInputs = with python.pkgs; [
sqlite-utils
requests-oauthlib
python-dateutil
];
patchPhase = ''
substituteInPlace setup.py --replace '"requests-oauthlib~=1.2.0",' '"requests-oauthlib~=1.3.0",'
'';
checkInputs = with python.pkgs; [
pytest
];
meta = with pkgs.lib; {
description = "Save data from Twitter to a SQLite database.";
homepage = "https://github.com/dogsheep/twitter-to-sqlite";
platforms = platforms.unix;
maintainers = with maintainers; [rrix];
license = with licenses; [ asl20 ];
};
}
#+end_src
* [[id:cce/home-manager][home-manager]] availability
Use these in [[id:cce/home-manager][home-manager]] like so:
#+ARROYO_HOME_MODULE: hm/datasette.nix
#+ARROYO_SYSTEM_EXCLUDE: droid
#+begin_src nix :tangle ~/arroyo-nix/hm/datasette.nix
{ pkgs, ... }:
{
home.packages = [ pkgs.inaturalist-to-sqlite pkgs.twitter-to-sqlite ];
}
#+end_src
* DONE move these to [[id:20221021T121120.541960][rixpkgs]]
:LOGBOOK:
- State "DONE" from "NEXT" [2022-12-23 Fri 15:21]
:END: