Skip to content

Instantly share code, notes, and snippets.

View nickefy's full-sized avatar

Nicholas nickefy

View GitHub Profile
@nickefy
nickefy / print_text_old.py
Created June 6, 2021 18:08
Airflow Operator without Framework
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from os import environ
class PrintText(BaseOperator):
@apply_defaults
def __init__(
self,
text_to_print,
@nickefy
nickefy / hello_world_old.py
Last active June 6, 2021 19:27
Airflow DAG without framework
from datetime import timedelta
from airflow.models import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago
from airflow.operators.print_text_old import PrintText
text_to_print_dag = 'Hello World!'
args = {
'owner': 'Airflow',
@nickefy
nickefy / Data-Engineering-Google-Bigquery-to-Pretty-Email-Templates-using-Apache-Airflow-Dag.py
Last active March 7, 2021 19:54
Data-Engineering-Google-Bigquery-to-Pretty-Email-Templates-using-Apache-Airflow-Dag
from dateutil.relativedelta import relativedelta
from airflow.exceptions import AirflowException
from airflow import models
from airflow import DAG
from operators import Operator
from datetime import datetime, timedelta
import os
# dag run interval
schedule_interval_dag = timedelta(days=1)
@nickefy
nickefy / Data Engineering-Google Bigquery to Pretty Email Templates using Apache Airflow operator.py
Last active March 16, 2021 09:50
Operator for Data Engineering-Google Bigquery to Pretty Email Templates using Apache Airflow.py
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from os import environ
from google.cloud import bigquery
from datetime import datetime
from datetime import timedelta
from airflow import configuration
from airflow.utils.email import send_email
import time
import logging
@nickefy
nickefy / Python-For-Data-Science - How-To-Get-More-Views-On-Youtube.py
Created February 15, 2021 14:50
Python-For-Data-Science - How-To-Get-More-Views-On-Youtube.py
# To manipulate data, NLP and visualizations
import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import os
from subprocess import check_output
# Standard plotly imports
import plotly as py
import plotly.tools as tls
@nickefy
nickefy / Python-For-Data-Science-Bootstrap-For-Plotly-Dash-Interactive-Visualizations.py
Created January 18, 2021 00:18
Python-For-Data-Science-Bootstrap-For-Plotly-Dash-Interactive-Visualizations.py
import dash
import dash_core_components as dcc
import dash_html_components as html
import numpy as np
import plotly.graph_objs as go
import dash_bootstrap_components as dbc
external_stylesheets = [dbc.themes.BOOTSTRAP]
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
import dash
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Input, Output
import plotly.graph_objs as go
from numpy import random
app = dash.Dash()
# initiate dataframe
@nickefy
nickefy / A Guide to Plotly Dash Interactive Visualizations.py
Last active November 8, 2020 16:11
Python For Data Science - A Guide to Plotly Dash Interactive Visualizations
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import pandas as pd
from dash.dependencies import Input, Output
from numpy import random
app = dash.Dash()
@nickefy
nickefy / airflow sensors.py
Last active May 17, 2022 15:35
example dag for sensors
from airflow.exceptions import AirflowException
from airflow import models
from airflow import DAG
from datetime import datetime, timedelta
from airflow.utils.email import send_email
from dateutil.relativedelta import relativedelta
import os
schedule_interval_dag = timedelta(days=1)
@nickefy
nickefy / Google Drive Data Pipeline.js
Last active July 30, 2019 09:43
Code for Google Drive Data Pipeline in Google App Script
function scan_files() {
var folder = DriveApp.getFolderById(folderID);
var processedfolder = DriveApp.getFolderById(processedfolderId);
var files = folder.getFiles();
while (files.hasNext()) {
var file = files.next();
if (file.getName().substring(0, 10) != 'processed_' || file.getName().substring(0, 7) != 'loaded_') {
loadCSVfromdrive(file);
}
}