Skip to content

Commit

Permalink
Adapt project to use dlt for ingestion
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasthalen committed Jan 14, 2025
1 parent 9207ce5 commit 297cf70
Show file tree
Hide file tree
Showing 88 changed files with 1,318 additions and 1,867 deletions.
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.13
3.12
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
# Arcane Insight
<img src="https://blz-contentstack-images.akamaized.net/v3/assets/bltc965041283bac56c/bltce748775e32f8c04/5f0769f35d2ae808119fb2dd/homepage_logo.png" height="50" alt="Hearthstone Logo" style="vertical-align: middle"> <img src="https://github.com/TobikoData/sqlmesh/blob/main/docs/readme/sqlmesh.png?raw=true" height="50" alt="SQLmesh" style="vertical-align: middle"> <img src="https://duckdb.org/images/logo-dl/DuckDB_Logo-horizontal.svg" height="50" alt="DuckDB" style="vertical-align: middle">
<img src="https://blz-contentstack-images.akamaized.net/v3/assets/bltc965041283bac56c/bltce748775e32f8c04/5f0769f35d2ae808119fb2dd/homepage_logo.png" height="50" alt="Hearthstone Logo" style="vertical-align: middle"> <img src="https://cdn.sanity.io/images/nsq559ov/production/7f85e56e715b847c5519848b7198db73f793448d-82x25.svg?w=2000&auto=format" height="50" alt="dltHub" style="vertical-align: middle"> <img src="https://github.com/TobikoData/sqlmesh/blob/main/docs/readme/sqlmesh.png?raw=true" height="50" alt="SQLmesh" style="vertical-align: middle"> <img src="https://duckdb.org/images/logo-dl/DuckDB_Logo-horizontal.svg" height="50" alt="DuckDB" style="vertical-align: middle">

Arcane Insight is a data analytics project designed to harness the power of SQLMesh & DuckDB to collect, transform, and analyze data from [Blizzard's Hearthstone API](https://develop.battle.net/documentation/hearthstone).

Focused on card statistics and attributes, this project reveals detailed insights into card mechanics, strengths, and trends to support BI and strategic analysis.

## Architecture
```mermaid
architecture-beta
service battle_net(cloud)[Battle Net API]
group duckdb(disk)[DuckDB]
group bronze(disk)[Bronze] in duckdb
service raw(database)[Raw] in bronze
service snapshot(database)[Snapshot] in bronze
group silver(disk)[Silver] in duckdb
service staging(database)[Staging] in silver
service raw_vault(database)[Raw Vault] in silver
service business_vault(database)[Business Vault] in silver
group gold(disk)[Gold] in duckdb
service marts(database)[Marts] in gold
service bi(internet)[BI]
battle_net:R --> L:raw
raw:R --> L:snapshot
snapshot:R --> L:staging
staging:R --> L:raw_vault
raw_vault:R --> L:business_vault
business_vault:R --> L:marts
marts:R --> L:bi
```

## ERDs
### Bronze
#### bronze.raw.*
Expand Down
Empty file removed data/.gitkeep
Empty file.
18 changes: 18 additions & 0 deletions elt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# Record the start time
start_time=$(date +%s)

# ELT
echo "Starting ELT process..."
python ./pipelines/battle_net.py
sqlmesh run

# Record the end time
end_time=$(date +%s)

# Calculate the elapsed time
elapsed_time=$((end_time - start_time))

# Print the elapsed time
echo "Elapsed time: ${elapsed_time} seconds"
177 changes: 177 additions & 0 deletions external_models.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
- name: '"bronze"."raw"."raw__hearthstone__bg_game_modes"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__cardback_categories"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__cardbacks"'
columns:
id: BIGINT
sort_category: BIGINT
text: TEXT
name: TEXT
image: TEXT
slug: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__cards"'
columns:
id: BIGINT
collectible: BIGINT
slug: TEXT
class_id: BIGINT
multi_class_ids: JSON
spell_school_id: BIGINT
card_type_id: BIGINT
card_set_id: BIGINT
rarity_id: BIGINT
artist_name: TEXT
mana_cost: BIGINT
name: TEXT
text: TEXT
image: TEXT
image_gold: TEXT
flavor_text: TEXT
crop_image: TEXT
child_ids: JSON
keyword_ids: JSON
is_zilliax_functional_module: BOOLEAN
is_zilliax_cosmetic_module: BOOLEAN
_dlt_load_id: TEXT
_dlt_id: TEXT
health: BIGINT
attack: BIGINT
minion_type_id: BIGINT
multi_type_ids: JSON
rune_cost: JSON
armor: BIGINT
durability: BIGINT
parent_id: BIGINT
banned_from_sideboard: BIGINT
tourist_class_id: BIGINT
faction_id: JSON
copy_of_card_id: BIGINT
max_sideboard_cards: BIGINT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__classes"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
card_id: BIGINT
hero_power_card_id: BIGINT
alternate_hero_card_ids: JSON
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__game_modes"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__keywords"'
columns:
id: BIGINT
slug: TEXT
name: TEXT
ref_text: TEXT
text: TEXT
game_modes: JSON
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__mercenary_factions"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__mercenary_roles"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__minion_types"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
game_modes: JSON
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__rarities"'
columns:
slug: TEXT
id: BIGINT
crafting_cost: JSON
dust_value: JSON
name: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__set_groups"'
columns:
slug: TEXT
year: BIGINT
svg: TEXT
card_sets: JSON
name: TEXT
standard: BOOLEAN
icon: TEXT
_dlt_load_id: TEXT
_dlt_id: TEXT
year_range: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__sets"'
columns:
id: BIGINT
name: TEXT
slug: TEXT
hyped: BOOLEAN
type: TEXT
collectible_count: BIGINT
collectible_revealed_count: BIGINT
non_collectible_count: BIGINT
non_collectible_revealed_count: BIGINT
_dlt_load_id: TEXT
_dlt_id: TEXT
alias_set_ids: JSON
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__spell_schools"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
game_modes: JSON
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
- name: '"bronze"."raw"."raw__hearthstone__types"'
columns:
slug: TEXT
id: BIGINT
name: TEXT
game_modes: JSON
_dlt_load_id: TEXT
_dlt_id: TEXT
gateway: local
63 changes: 0 additions & 63 deletions models/bronze/raw/raw__hearthstone__bg_game_modes.py

This file was deleted.

63 changes: 0 additions & 63 deletions models/bronze/raw/raw__hearthstone__cardback_categories.py

This file was deleted.

Loading

0 comments on commit 297cf70

Please sign in to comment.