Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
What's happening

Arpit Solanki arpit1997

💭
What's happening
View GitHub Profile
View tasks.py
import os
import time
import json
import slack
from xplenty import XplentyClient
ACCOUNT_ID = os.getenv('ACCOUNT_ID') # Your account ID
API_KEY = os.getenv('API_KEY') # Your account's API Key
SLACK_TOKEN = os.getenv('SLACK_TOKEN') # Slack Token for sending alerts
View __init__.py
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from datetime import datetime
from .tasks import run_package, send_slack_alert
default_args = {
'owner': 'airflow',
'depends_on_past': False,
View airflow_setup.sh
# Create a virtual environment and activate it
virtualenv -p python3 xplenty_venv
source xplenty_venv/bin/activate
# Install Airflow and XPlenty Python Client
pip install apache-airflow==1.10.3 xplenty requests slackclient