diff options
author | B. Stack <bgstack15@gmail.com> | 2024-07-09 15:11:26 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-07-09 15:11:26 -0400 |
commit | 516263ea51350514571deafc70b14f9f19d760d8 (patch) | |
tree | 9da665d2e3eee383335c5f2ecc82dd649824ed66 /libraries/base.py | |
download | library-info-516263ea51350514571deafc70b14f9f19d760d8.tar.gz library-info-516263ea51350514571deafc70b14f9f19d760d8.tar.bz2 library-info-516263ea51350514571deafc70b14f9f19d760d8.zip |
initial commit
Diffstat (limited to 'libraries/base.py')
-rw-r--r-- | libraries/base.py | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libraries/base.py b/libraries/base.py new file mode 100644 index 0000000..74394be --- /dev/null +++ b/libraries/base.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python3 +# File: libraries/base.py +# Author: bgstack15 +# Startdate: 2024-07-06-7 08:08 +# SPDX-License-Identifier: GPL-3.0-only +# Title: Library Plugin example +# Project: library_info +# Purpose: base class for library plugins +# History: +# Usage: +# Reference: +# Improve: +# Dependencies: +# dep-devuan: python3-bs4 + +# For a real library you will need this entry too: +#from .base import * +import requests, json, dateutil, base64, os +from bs4 import BeautifulSoup + +class BaseLibrary: + + def __init__(self, username = None, password = None, baseurl = None): + self.username = username + self.password = password + self.baseurl = baseurl + # will need cookies or session manager here. + + def get_checkouts(self): + """ STUB """ + sample = { + "title": "sample book 1", + "format": "book", + "picture": "DUMMYIMAGEprobablybase64ed", + "barcode": 912738490172349, + "duedate": "2024-07-12", + "possible_renewal_date": "2024-07-11", + "times_renewed": 0, + "checkout_date": "2024-07-02" + } + return [sample] + + def get_class_name(self): + """ Leave this function as is. It will return the filename. """ + return os.path.basename(__file__).replace(".py","") + + def login(self): + """ + This is where the login interaction should happen. + """ |