Skip to content

About

Desktop app in Python and Flet for searching books through the Google Books API and saving them to favourites, want-to-read and recently-viewed lists in local SQLite.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DigitalLibrary

A desktop app for looking up books and keeping your own reading lists.

Search the Google Books catalogue by title, then file what you find into three personal lists — favourites, want-to-read and recently viewed — stored locally in SQLite. Built with Flet (Python); the interface is in Russian.

Python Flet SQLite Google Books API

What it does

  • Search by title — type a title, get the author, the description and a preview link.
  • Cycle through matches — "Другой Вариант" steps to the next result for the same query.
  • Save to three lists — the heart toggles favourites, +/− toggles want-to-read, and anything you open is logged to recently-viewed automatically.
  • Remove entries — each list is a tab with a delete button per row.
  • Accounts — register (name ≥ 3 chars, validated email, password ≥ 8 chars), log in, edit your details, log out. Each account gets its own library file.
  • Light/dark toggle — on every screen.

How it works

main.py is the whole app: five Flet views wired to a bottom NavigationBar, entered through ft.app(target=register).

View Role
register Sign-up form; skips straight into the app if a session is already saved
login Checks credentials, writes the session
search_book Google Books lookup plus the save buttons (the home tab)
library Three tabs — favourites / want-to-read / recently viewed
account Edit name, email and password; log out

A lookup is a single unauthenticated GET to https://www.googleapis.com/books/v1/volumes?q=intitle:<title> — no API key required. A module-level cur_index tracks which result of that response is currently on screen.

Storage is plain SQLite, created on first run:

  • users.db → users(name, email, password) — every account.
  • user_library/<sha256(email)>.db → one file per account, holding three tables of (title): favorite_books, want_to_read, recently_read.
  • data.json → the current session (name, email, password); this is how the app remembers you between launches.

The sha256 helper (hash_text) names the per-account database file. It is not applied to passwords — see Status.

main.py                       # the entire app: views, SQLite access, Google Books calls
main.txt                      # near-copy of main.py (one widget name differs)
main.exe                      # prebuilt Windows build of the same app (~83 MB)
assets/favicon.png            # app icon
Электронная Библиотека.pptx   # the Russian slide deck presenting the project
requirements.txt

Running locally

git clone https://github.com/Amir10202010/DigitalLibrary.git
cd DigitalLibrary

python3 -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

pip install -r requirements.txt
python main.py

A window opens on the registration screen. users.db, user_library/ and data.json are created in the working directory the first time you use it.

requirements.txt holds Flet below 0.25 deliberately: this code targets the 0.2x API (ft.colors, ft.icons.FAVORITE_BORDER, ft.app(target=...)), which later releases replaced with the ft.Colors / ft.Icons enums.

On Windows you can skip the setup entirely and run main.exe, a prebuilt binary of this same app.

Status

A learning project — a school assignment (the included deck puts it at about two weeks' work), kept here as it was written rather than polished. Worth knowing before you use it:

  • Passwords are stored in plain text. users.db keeps them exactly as typed, login compares them directly, and data.json writes the password to disk a second time. Don't reuse a real password.
  • Reading lists are per-account — a separate database file keyed by the hashed email — but nothing protects those files beyond that.
  • A saved entry is a single text string of Author "Title". There is no book id, so the same book reached through a different query can be stored twice.
  • Every book you open is written to recently viewed, whether you wanted it there or not.
  • All interface text is hard-coded in Russian.
  • It is one 856-line file with no tests, and main.txt is a stale duplicate of it.

Built by Amirkhan Sagyndyk.

About

Desktop app in Python and Flet for searching books through the Google Books API and saving them to favourites, want-to-read and recently-viewed lists in local SQLite.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages