A data exploration project using data from: https://www.craigoates.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
3.3 KiB

#+options: ':nil *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline author:t
#+options: broken-links:nil c:nil creator:nil d:(not "LOGBOOK") date:t e:t
#+options: email:nil f:t inline:t num:t p:nil pri:nil prop:nil stat:t tags:t
#+options: tasks:t tex:t timestamp:t title:t toc:t todo:t |:t
#+title: Data Exploration of Artwork Section
#+date: \today
#+author: Craig Oates
#+email: craig@craigoates.net
#+language: en
#+select_tags: export
#+exclude_tags: noexport
#+creator: Emacs 29.0.60 (Org mode 9.6.1)
#+cite_export:
#+export_file_name: ./exported/artwork.html
* <2023-03-26 Sun> Summary & Set-up
#+begin_quote
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