from requests import get
from requests.exceptions import RequestException
from contextlib import closing
from bs4 import BeautifulSoup
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import time
import sys
import random
import common
import re

taxyear = common.getTaxYear()

pins = pd.read_csv("oppins.csv")

# Don't start processing pins until you hit 'startpin'
startpin = '16053260380000'
try:
    startpin
except NameError:
    startpin = None


def simple_get(url):
    """
    Attempts to get the content at `url` by making an HTTP GET request.
    If the content-type of response is some kind of HTML/XML, return the
    text content, otherwise return None.
    """
示例#2
0
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import common

baseyear = common.getTaxYear()
projection = pd.read_csv(str(baseyear) + "/projections.csv")
projection = projection.set_index(projection.Year)
projection = projection[projection.index >= baseyear]


def project(col, baseyear):
    plt.close()
    plt.figure(figsize=(6, 5), dpi=200)
    p = projection[col]
    years = [
        str(baseyear),
        str(baseyear + 5),
        str(baseyear + 10),
        str(baseyear + 15),
        str(baseyear + 20)
    ]
    p1 = plt.bar(years, p[p.index.isin(years)])

    plt.title('Projected Future Tax  $' + col + ' in ' + str(baseyear))
    plt.xticks(years,
               (str(baseyear), '5 years', '10 years', '15 years', '20 years'))
    rects = p1.patches
    # For each bar: Place a label
    for rect in rects:
        # Get X and Y placement of label from rect.