#book #lib #pdf #place

book_lib

A library that provides an API for managing PDFs on your mac device in one place

4 releases

new 0.1.3 Apr 10, 2025
0.1.2 Apr 7, 2025
0.1.1 Apr 7, 2025
0.1.0 Apr 4, 2025

#1424 in Text processing

Download history 277/week @ 2025-04-02

277 downloads per month

MIT license

24KB
550 lines

Book Lib

This library provides an interface for adding, removing and manging existing PDF files stored on your device.

Requirements

  1. unix device
  2. rust
  3. sqlite

Setup

  1. clone the project from the git repository or add it using cargo add book_lib
  2. use the api in your rust project

Usage

  1. Create a connection to the database:
use book_lib::{db, book};

let connection = book_lib::db::setup();

  1. Create a new book
let new_book = book::Book::init("book_name".to_string(), "path_to/your/file.pdf".to_string(), None, false);
book_lib::create_book(&connection, &new_book); //creating new book in the DB
  1. Open your book
book_lib::open_book(&connection, &"book_name".to_string()); // open the book by the default PDF viewer
  1. Make it favourite
book_lib::update_favourite(&connection, &("book_name".to_string()), true); //true to be favourite, false not to be
  1. Remove the book
book_lib::remove_book(&connection, &("book_name".to_string()));

Examples of implementation

  1. cli for managing PDFs
  2. GUI for managing PDFs

Contribution

Feel free to open pull requests!

Dependencies

~36MB
~594K SLoC