/swag-bag

Access to color palettes and logos of sports teams, countries, and more.

Primary LanguagePythonMIT LicenseMIT

Swag-Bag

Travis Codecov License: MIT

Swag-Bag is a convenient package for accessing the color palettes and logos of your favorite sports teams. It enables you to create beautifully themed visualizations with a little swag.

Installation

python and R packages are both currently under construction. Stay tuned for install instructions!

Usage

from swagbag import swag

colors = swag.TeamColors("Chicago Bulls", 2, "hex")

Then, you can hook into your favorite plotting package...

import seaborn as sns
import pandas as pd

df = pd.DataFrame([{'A':'Hodor', 'B':7},
                   {'A':'Bran', 'B':3}])

my_palette = sns.color_palette(colors)
sns.barplot(x='A', y='B', data=df, palette=my_palette, saturation=1)

bulls plot

Logos are queryable too...
import matplotlib.pyplot as plt

logo = swag.TeamLogos("Chicago Bulls")
plt.imshow(logo)

*NOTE: this project is in beta, so documentation may lag from present usage