|
|
|
@ -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 |
|
|
|
|