Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stock data #47

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
265 changes: 265 additions & 0 deletions models/staging/stocks/_stocks__models.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
version: 2

models:
- name: stg_stocks__fund_ownership
description: ""
access: public
columns:
- name: symbol
data_type: varchar
description: ""

- name: report_date
data_type: date
description: ""

- name: organization
data_type: varchar
description: ""

- name: percent_held
data_type: float
description: ""

- name: total_shares
data_type: float
description: ""

- name: total_value
data_type: float
description: ""

- name: percent_change
data_type: float
description: ""

- name: stg_stocks__grade_history
description: ""
access: public
columns:
- name: symbol
data_type: varchar
description: ""

- name: epoch_grade_date
data_type: timestamp_ntz
description: ""

- name: firm
data_type: varchar
description: ""

- name: to_grade
data_type: varchar
description: ""

- name: from_grade
data_type: varchar
description: ""

- name: proposed_action
data_type: varchar
description: ""

- name: stg_stocks__history
description: ""
access: public
columns:
- name: symbol
data_type: varchar
description: ""

- name: date
data_type: date
description: ""

- name: close
data_type: float
description: ""

- name: volume
data_type: float
description: ""

- name: open
data_type: float
description: ""

- name: high
data_type: float
description: ""

- name: low
data_type: float
description: ""

- name: adjusted_closed
data_type: float
description: ""

- name: dividends
data_type: float
description: ""

- name: splits
data_type: float
description: ""

- name: stg_stocks__insider_transactions
description: ""
access: public
columns:
- name: symbol
data_type: varchar
description: ""

- name: shares
data_type: float
description: ""

- name: filer_url
data_type: varchar
description: ""

- name: transaction_text
data_type: varchar
description: ""

- name: filer_name
data_type: varchar
description: ""

- name: filer_relation
data_type: varchar
description: ""

- name: money_text
data_type: varchar
description: ""

- name: start_date
data_type: date
description: ""

- name: ownership
data_type: varchar
description: ""

- name: total_value
data_type: float
description: ""

- name: stg_stocks__recommendation_trends
description: ""
access: public
columns:
- name: symbol
data_type: varchar
description: ""

- name: period
data_type: varchar
description: ""

- name: strong_buy
data_type: number
description: ""

- name: buy
data_type: number
description: ""

- name: hold
data_type: number
description: ""

- name: sell
data_type: number
description: ""

- name: strong_sell
data_type: number
description: ""

- name: stg_stocks__sec_filings
description: ""
columns:
- name: symbol
data_type: varchar
description: ""

- name: report_date
data_type: date
description: ""

- name: epoch_date
data_type: timestamp_ntz
description: ""

- name: type
data_type: varchar
description: ""

- name: title
data_type: varchar
description: ""

- name: edgar_url
data_type: varchar
description: ""

- name: stg_stocks__summary_profile
description: ""
access: public
columns:
- name: address_1
data_type: varchar
description: ""

- name: city
data_type: varchar
description: ""

- name: state
data_type: varchar
description: ""

- name: zip_code
data_type: varchar
description: ""

- name: country
data_type: varchar
description: ""

- name: phone
data_type: varchar
description: ""

- name: website
data_type: varchar
description: ""

- name: industry
data_type: varchar
description: ""

- name: sector
data_type: varchar
description: ""

- name: long_business_summary
data_type: varchar
description: ""

- name: full_time_employees
data_type: number
description: ""

- name: symbol
data_type: varchar
description: ""

- name: address_2
data_type: varchar
description: ""
24 changes: 24 additions & 0 deletions models/staging/stocks/stg_stocks__fund_ownership.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
with

source as (

select * from {{ source('stocks', 'fund_ownership') }}

),

renamed as (

select
symbol,
report_date,
organization,
pct_held as percent_held,
position as total_shares,
value as total_value,
pct_change as percent_change

from source

)

select * from renamed
23 changes: 23 additions & 0 deletions models/staging/stocks/stg_stocks__grade_history.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
with

source as (

select * from {{ source('stocks', 'grade_history') }}

),

renamed as (

select
symbol,
epoch_grade_date,
firm,
to_grade,
from_grade,
action as proposed_action

from source

)

select * from renamed
27 changes: 27 additions & 0 deletions models/staging/stocks/stg_stocks__insider_transactions.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
with

source as (

select * from {{ source('stocks', 'insider_transactions') }}

),

renamed as (

select
symbol,
shares,
filer_url,
transaction_text,
filer_name,
filer_relation,
money_text,
start_date,
ownership,
value as total_value

from source

)

select * from renamed
24 changes: 24 additions & 0 deletions models/staging/stocks/stg_stocks__recommendation_trends.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
with

source as (

select * from {{ source('stocks', 'recommendation_trends') }}

),

renamed as (

select
symbol,
period,
strong_buy,
buy,
hold,
sell,
strong_sell

from source

)

select * from renamed
23 changes: 23 additions & 0 deletions models/staging/stocks/stg_stocks__sec_filings.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
with

source as (

select * from {{ source('stocks', 'sec_filings') }}

),

renamed as (

select
symbol,
date as report_date,
epoch_date,
type,
title,
edgar_url

from source

)

select * from renamed
Loading