From 1b1598c129755b8179d8041a88292b3950525129 Mon Sep 17 00:00:00 2001 From: Craig Oates Date: Sun, 26 Mar 2023 14:43:27 +0100 Subject: [PATCH] update artwork.org (set-up and data cleaning). --- artwork.org | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/artwork.org b/artwork.org index 1344332..40063ca 100644 --- a/artwork.org +++ b/artwork.org @@ -19,3 +19,77 @@ Make sure you have gone through the [[file:./README.org][README]] and set-up the environment on your machine. #+end_quote + +The code in this file explores the [[https://www.craigoates.net/art][Artworks]] section of the site. + +* <2023-03-26 Sun> Clean data + +This is the SQL used to remove data I don't want in a public facing +repository. The database is not included. I'm keeping the SQLite code for future +reference and for the sake of completeness. + +#+header: :list +#+header: :separator \ +#+header: :results raw +#+header: :dir data +#+header: :db co-production-2023-03-21.db +#+begin_src sqlite + .headers on + .mode csv + .output artwork-2023-03-21.csv + select + id, + title, + slug, + published, + category, + width, + height, + depth, + pixel_width, + pixel_height, + play_length, + medium, + created_at, + updated_at + from + artwork; +#+end_src + +#+RESULTS: + +#+begin_src shell :results code + # Use -l to check file permissions. + ls -h data/artwork*.csv +#+end_src + +#+RESULTS: +#+begin_src shell +data/artwork-2023-03-21.csv +#+end_src + +To view the data in =data/artwork-2023-03-21.csv=, you need ~csvlook~ installed. + +#+begin_src shell + sudo apt update + sudo apt install csvkit +#+end_src + +If ~csvlook~ isn't installed, skip the following code block. It produces a sample +of the data this file will be using to explore the data for the Artworks section +of my site. + +#+begin_src shell :results code + head -n 4 data/artwork-2023-03-21.csv | csvlook +#+end_src + +#+RESULTS: +#+begin_src shell +| id | title | slug | published | category | width | height | depth | pixel_width | pixel_height | play_length | medium | created_at | updated_at | +| -- | ----------------------------- | -------------------- | ------------------- | -------- | ----- | ------ | ----- | ----------- | ------------ | ----------- | ----------------- | --------------------------- | --------------------------- | +| 1 | Drop and Run (Purple Squares) | drop-and-run | 2012-05-07 00:00:00 | Video | | | | | | 4 | Digital Animation | 2022-04-11 00:00:00.000000Z | 2022-05-09 14:43:28.379441Z | +| 2 | Eje x, Exio y, Z-Achse | eje-x-exio-y-z-achse | 2016-11-11 00:00:00 | Prints | 15 | 21 | | | | | Digital Print | 2022-04-11 | | +| 3 | Up This Way | up-this-way | 2016-01-24 00:00:00 | Prints | 21 | 30 | | | | | Digital Print | 2022-04-11 | | +#+end_src + +* <2023-03-26 Sun> Explore Data