A desktop application for managing a library's books, accounts, and loans, built with Python and CustomTkinter.
This started as a university coursework project (a library management system covering CRUD operations over a SQLite database with a GUI), and was extended beyond the brief to practise additional skills:
- External API integration — searching and importing book details from the Google Books API
- Applied machine learning — a simple AI-driven recommendation engine using cosine similarity / collaborative filtering
- Software design — OOP architecture separating GUI, database, API, and AI layers
- Packaging & distribution — building and shipping the app as a standalone macOS application
- Books — add books manually or search and import them via the Google Books API, edit details, delete, and live-filter the catalogue.
- Accounts — manage customer records (name, surname, phone, email) with search/filter and editing.
- Loans — create loans, track due dates, mark books as returned, and automatically flag overdue loans.
- Dashboard — at-a-glance stats for total books, accounts, active loans, and overdue loans.
- AI Recommendations — suggests books for a selected customer using cosine similarity over loan history (collaborative filtering), falling back to the most popular available books for customers with no loan history.
- Python 3 with CustomTkinter for the GUI
- SQLite for local data storage
- scikit-learn / numpy for the recommendation engine
- Google Books API for book lookups
- PyInstaller for packaging into a standalone macOS app
src/
├── main.py # entry point — sets up the database and launches the GUI
├── AI/
│ └── aiModel.py # book recommendation engine
├── API/
│ └── callAPI.py # Google Books API integration
├── DB/
│ ├── dbConnection.py # SQLite connection helper
│ ├── setup.py # creates tables on first run
│ ├── booksData.py
│ ├── accData.py
│ └── loansData.py
└── GUI/
├── mainWindow.py # landing window
├── libraryWindow.py # dashboard + navigation
├── recomWindow.py # AI recommendations window
├── booksFrame.py
├── accFrame.py
├── loansFrame.py
└── components/ # reusable widgets (tables, forms, dialogs, search bars)
If you just want to use the app — no Python or setup required:
- Download the installer: LBLSystemInstaller.dmg
- Open the downloaded
.dmgfile - Drag LibraryManagementApp into the Applications folder shortcut shown in the window
- Open LibraryManagementApp from your Applications folder
First launch: macOS may show "LibraryManagementApp is damaged and can't be opened". This is not an actual problem — it happens because the app isn't signed with a paid Apple Developer certificate. To fix it, open Terminal and run:
xattr -cr /Applications/LBL System.appThen open the app again — it will launch normally every time after that.
- Clone the repository
- Create a virtual environment and activate it:
python -m venv myvenv
source myvenv/bin/activate- Install dependencies:
pip install -r requirements.txt- Add a Google Books API key. Create a file at
src/API/.envcontaining:
API_Key=YOUR_GOOGLE_API_KEY_HERE
- Run the application:
python src/main.pyThe database/database.db file is created automatically on first launch (the data/ folder ships with the repository).
The SQLite database has three tables, created automatically on first launch:
books
| Column | Type | Notes |
|---|---|---|
| bookID | INTEGER | Primary key, autoincrement |
| ISBN | INTEGER | Unique |
| title | TEXT | Required |
| author | TEXT | Required |
| copies | INTEGER | Total copies owned |
| pageCount | INTEGER | |
| publishDate | TEXT | |
| mainCategory | TEXT | |
| categories | TEXT |
accounts
| Column | Type | Notes |
|---|---|---|
| accountID | INTEGER | Primary key, autoincrement |
| name | TEXT | Required |
| surname | TEXT | Required |
| phoneNum | TEXT | Required |
| TEXT | Required |
loans
| Column | Type | Notes |
|---|---|---|
| loanID | INTEGER | Primary key, autoincrement |
| bookID | INTEGER | Foreign key → books.bookID |
| accountID | INTEGER | Foreign key → accounts.accountID |
| loanDate | TEXT | |
| deadline | TEXT | |
| status | INTEGER | 0 = not returned, 1 = returned |
- Windows and Linux packaging alongside the macOS build
- Automated tests for the database, API, and AI layers
- Export loan/account data (e.g. to CSV or PDF reports)
- Notifications/reminders for upcoming or overdue loan deadlines
- Expanding the AI recommendation model with more input signals (e.g. genres, ratings) and switching to matrix factorisation through surprise library's SVD method
- User accounts/authentication for multi-librarian access