diff --git a/google_books/picklist-draft.ipynb b/google_books/picklist-draft.ipynb index d7ce280..1c8d201 100644 --- a/google_books/picklist-draft.ipynb +++ b/google_books/picklist-draft.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 57, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": 58, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 59, + "execution_count": 19, "metadata": {}, "outputs": [ { @@ -48,7 +48,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 20, "metadata": {}, "outputs": [ { @@ -65,7 +65,7 @@ }, { "cell_type": "code", - "execution_count": 61, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -88,20 +88,20 @@ }, { "cell_type": "code", - "execution_count": 62, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ "def do_not_sent(row):\n", - " if not row[\"iLocation\"].startswith((\"bu\", \"ma\", \"pa\", \"rc\", \"sc\")):\n", + " if not row[\"iLocation\"].startswith((\"bu\", \"ma\", \"pa\", \"rc\", \"sc\", \"ls\")):\n", " return \"TRUE\"\n", " elif int(row[\"iType\"]) > 101:\n", " return \"TRUE\"\n", " elif int(row[\"iType\"]) in (\n", - " 4, 5, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n", - " 21, 22, 23, 24, 26, 27, 28, 30, 31, 32, 33, 34,\n", - " 35, 36, 37, 38, 39, 41, 42, 43, 51, 52, 53, 66, 68, 70, 72,\n", - " 73, 74, 75, 76, 79, 51, 52, 53):\n", + " 6, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,\n", + " 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,\n", + " 35, 36, 37, 38, 39, 41, 42, 43, 50, 51, 52, 53, 61, 66, 68, 70, 72,\n", + " 73, 74, 75, 76, 79):\n", " return \"TRUE\"\n", " elif \"google\" in row[\"iIntNote\"].lower():\n", " return \"TRUE\"\n", @@ -114,7 +114,7 @@ }, { "cell_type": "code", - "execution_count": 63, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -123,7 +123,7 @@ }, { "cell_type": "code", - "execution_count": 64, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -132,18 +132,18 @@ }, { "cell_type": "code", - "execution_count": 65, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "df_sasb = df[(df[\"building\"] == \"SASB\") & (df[\"do_not_sent\"] == \"FALSE\")]\n", - "gdf_sasb = df_sasb.groupby(\"iLocation\")[[\"iNumber\", \"iLocation\", \"iBarcode\", \"iCallNum\", \"title\", \"pubInfo\", \"bCallNum\", \"bStaffCallNum\"]].apply(lambda x: x.sort_values(\"iCallNum\"))\n", - "gdf_sasb.to_csv(\"../files/picklist/sasb.csv\", index=False, sep=\"\\t\", columns=[\"iNumber\", \"iLocation\", \"iBarcode\", \"iCallNum\", \"title\", \"pubInfo\", \"bCallNum\", \"bStaffCallNum\"])" + "gdf_sasb = df_sasb.groupby(\"iLocation\")[[\"iNumber\", \"iLocation\", \"iBarcode\", \"iCallNum\", \"iVolume\", \"title\", \"pubInfo\", \"bCallNum\", \"bStaffCallNum\"]].apply(lambda x: x.sort_values(\"iCallNum\"))\n", + "gdf_sasb.to_csv(\"../files/picklist/sasb.csv\", index=False, sep=\"\\t\", columns=[\"iNumber\", \"iLocation\", \"iBarcode\", \"iCallNum\", \"iVolume\", \"title\", \"pubInfo\", \"bCallNum\", \"bStaffCallNum\"])" ] }, { "cell_type": "code", - "execution_count": 66, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -154,7 +154,7 @@ }, { "cell_type": "code", - "execution_count": 67, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -165,7 +165,7 @@ }, { "cell_type": "code", - "execution_count": 68, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -175,7 +175,7 @@ }, { "cell_type": "code", - "execution_count": 69, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -186,7 +186,7 @@ }, { "cell_type": "code", - "execution_count": 70, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -197,7 +197,7 @@ }, { "cell_type": "code", - "execution_count": 71, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -208,7 +208,7 @@ }, { "cell_type": "code", - "execution_count": 72, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ diff --git a/google_books/picklist.py b/google_books/picklist.py index e86c5d1..caadb6e 100644 --- a/google_books/picklist.py +++ b/google_books/picklist.py @@ -40,6 +40,7 @@ def prep_item_list_for_sierra(tar_file: str, list_size: int) -> None: files = glob.glob("files/picklist/*_combined-*.txt") n = -1 s = 1 + print(f"Outputting to file: {str(s).zfill(3)}...") for f in files: reader = csv.reader(open(f, "r", encoding="utf-8"), delimiter="\t") for row in reader: @@ -60,7 +61,7 @@ def prep_sierra_export_for_dataframe(fh: str, date: str) -> None: Args: fh (str): The path to the Sierra export file - date (str): The date of the export in the fomrmat YYYY-MM-DD + date (str): The date of the export in the format YYYY-MM-DD """ with open(fh, "r", encoding="utf-8", errors="replace") as f: reader = csv.reader(f, delimiter="\t")