Skip to content

Instantly share code, notes, and snippets.

import requests
from io import StringIO
import boto3
import csv
import os
import datetime
def add_timestamp_to_filename(original_filename):
# Get the current date and time
import requests
from bs4 import BeautifulSoup
import csv
import boto3
# Replace this URL with the URL of the website you want to scrape
url = 'https://app.leg.wa.gov/far/Senate/Calendar'
# Send an HTTP request to the URL and get the HTML content
response = requests.get(url)
html_content = response.text
[
{
"number_of_reviews": 77,
"number_of_stars": 4.4,
"top_industry_represented": [
"Information Technology and Services: 22",
"Insurance: 5",
"Banking: 4",
"Computer Software: 3",
"Financial Services: 3",
CREATE DATABASE raw
CREATE storage integration s3_int type = external_stage storage_provider = 'S3' storage_aws_role_arn = 'arn:aws:iam::001234567890:role/myrole' enabled = true storage_allowed_locations = ('s3://bucket/folder/');
--Create a stage
CREATE
OR REPLACE STAGE raw_predictit storage_integration = s3_int file_format = (type = json) url = 's3://bucket/folder/'
--Select from stage
SELECT metadata$filename
SELECT N.name
FROM neighborhoods N
LEFT JOIN users U
ON N.id = U.neighborhood_id
WHERE U.id is null
import airflow
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.providers.postgres.operators.postgres import PostgresOperator
from datetime import datetime, timedelta
from bs4 import BeautifulSoup
from urllib.request import urlopen
import urllib.request
Run this on your postgres instance
CREATE EXTENSION aws_s3 CASCADE;
Run this on your EC2 instance
First-
faang
technology-driven start-up
instacart
pms
product managers
sql
sql
average amount
don ’ t
query.this ability
from textblob import TextBlob
t=#PUT YOUR TEXT HERE
blob = TextBlob(t)
for i in blob.noun_phrases:
print(i)