Skip to contents

{artutils} is the data access layer for the Artalytics platform. It provides functions to query artist, artwork, and collection data from the database, construct CDN asset URLs, and aggregate data for Shiny applications.

Installation

# Install from GitHub (requires GITHUB_PAT)
pak::pkg_install("artalytics/artutils")

Quick Example

library(artutils)

# Look up an artist by their URL slug
artist_record <- get_artist_by_slug("bobby-fatemi")
artist <- artist_record$artist_uuid

# Get profile data
stats <- get_artist_stats(artist)
collections <- get_artist_collections_summary(artist)
recent_works <- get_artist_recent_works(artist, limit = 6)

# Construct CDN URLs for assets
avatar <- path_artist_thumb(artist)
thumbnails <- sapply(recent_works$art_uuid, function(art) {
    path_artwork_thumb(artist, art)
})

# For Shiny apps, aggregate everything in one call
appdata <- get_appdata(artist, artwork = recent_works$art_uuid[1])

Package Hierarchy

appPlatform / mod* packages (application layer)
        |
    artutils (data access layer)
        |
    artcore (infrastructure layer)

{artutils} depends only on {artcore} for database connections and CDN operations. It never depends on application packages.

Environment Variables

{artutils} requires database credentials via {artcore}. Set these before loading:

Variable Description
ART_PGHOST PostgreSQL host
ART_PGPORT PostgreSQL port
ART_PGUSER PostgreSQL username
ART_PGPASS PostgreSQL password
ART_PGDATA PostgreSQL database name

See {artcore} environment variables documentation for complete setup instructions.

Core Functionality

{artutils} provides functions across six categories:

  • Data Access — Query artist, artwork, and collection data with [get_artist_index()], [get_artwork_stats()], etc.
  • Data Modifiers — Create and update records with [add_artwork()], [update_artist_stats()], etc.
  • Path Utilities — Construct CDN asset URLs with [path_artwork_thumb()], [path_artist_thumb()], etc.
  • Application Data — Aggregate data for Shiny apps with [get_appdata()]
  • Settings — Manage preferences and visibility (experimental)
  • Database Interface — Low-level database operations with [db_art_get()], [db_art_update()], etc.

See the function reference for complete API documentation.

Documentation

Development

For AI agent instructions and coding standards, see AGENTS.md.


Proprietary - Do Not Distribute

Bobby Fatemi - All rights reserved