From d16ae36f393bd5ed11ba3cbfd7a1bcc095dcd628 Mon Sep 17 00:00:00 2001 From: Michael Chow Date: Mon, 24 Jan 2022 15:31:26 -0500 Subject: [PATCH] feat: add data to package --- MANIFEST.in | 1 + {data => schrutepy/data}/schrute.csv | 0 {data => schrutepy/data}/schrute.feather | Bin schrutepy/schrutepy.py | 3 ++- setup.py | 1 + 5 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 MANIFEST.in rename {data => schrutepy/data}/schrute.csv (100%) rename {data => schrutepy/data}/schrute.feather (100%) diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..e3e3c5a --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include schrutepy/data/schrute.csv diff --git a/data/schrute.csv b/schrutepy/data/schrute.csv similarity index 100% rename from data/schrute.csv rename to schrutepy/data/schrute.csv diff --git a/data/schrute.feather b/schrutepy/data/schrute.feather similarity index 100% rename from data/schrute.feather rename to schrutepy/data/schrute.feather diff --git a/schrutepy/schrutepy.py b/schrutepy/schrutepy.py index f7476e0..23bf0fe 100644 --- a/schrutepy/schrutepy.py +++ b/schrutepy/schrutepy.py @@ -1,4 +1,5 @@ import pandas +from importlib import resources def load_schrute(): @@ -6,7 +7,7 @@ def load_schrute(): The entire script transcriptions from The Office in pandas dataframe format. """ - full_path = "https://github.com/bradlindblad/schrutepy/raw/master/data/schrute.csv" + full_path = resources.files("schrutepy") / "data" / "schrute.csv" df = pandas.read_csv(full_path) df = df.drop("Unnamed: 0", axis=1) diff --git a/setup.py b/setup.py index ccaf093..a35bafb 100644 --- a/setup.py +++ b/setup.py @@ -16,6 +16,7 @@ url="https://github.com/bradlindblad/schrutepy", packages=find_packages(), install_requires=requirements, + include_package_data=True, classifiers=[ "Programming Language :: Python :: 3.6", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)",