Name | lspace JSON |
Version |
0.4.8
JSON |
| download |
home_page | https://github.com/puhoy/lspace |
Summary | ebook manager built around isbnlib |
upload_time | 2024-08-01 11:15:12 |
maintainer | None |
docs_url | None |
author | jan |
requires_python | None |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
|
coveralls test coverage |
No coveralls.
|
# l-space
a cli ebook manager built around [isbnlib](https://github.com/xlcnd/isbnlib)
on import, lspace tries to find isbns in the files metadata and in the text.
with the isbn it tries to fetch metadata about the book from google books and openlibrary.
if no isbn is found, it queries metadata based on the filename.
after this, your properly renamed files will be stored in your library folder.
currently supports epub and pdf.
[![Build Status](https://travis-ci.org/puhoy/lspace.svg?branch=master)](https://travis-ci.org/puhoy/lspace)
[![codecov](https://codecov.io/gh/puhoy/lspace/branch/master/graph/badge.svg)](https://codecov.io/gh/puhoy/lspace)
## requirements
python >=3.5 and pip
## installation
#### from pypi (latest release)
`pip install lspace`
#### from github (probably-not-so-stable-dev-stuff)
`pip install git+https://github.com/puhoy/lspace.git`
## setup
after installation, you should run
`lspace init`
this will setup a new configuration file, which you can edit to specify the structure of your library, for example.
a default config file would look like this:
```
database_path: sqlite:////home/USER/.config/lspace/lspace.db
file_format: '{SHELF}/{AUTHORS}_{TITLE}'
library_path: ~/library
loglevel: error
default_shelf: misc
default_author: no author
default_language: no language
default_publisher: no publisher
```
#### database path
path to your database.
the project uses sqlalchemy, so all databases supported by sqlalchemy should be fine.
#### file_format
template string for storing the plain files in the library.
`{SHELF}/{AUTHORS}_{TITLE}` would produce files like `scifi/cixin-liu_three-body-problem.epub`
author and title will be automatically slugified for this.
possible variables to use are: AUTHORS, TITLE, SHELF, YEAR, LANGUAGE, PUBLISHER
#### library path
where the imported files are stored
#### loglevel
the default python loglevels (debug, info, error, exception)
#### default_{shelf, author, language, publisher}
the default field names, in case nothing is specified in import
## usage
### importing
`lspace import path/to/ebook.epub`
`lspace import path/to/folder/*`
if you already have a folder you are happy with and, for example, just want to use it to serve your books or search through your files, you can add the `--inplace` switch on import, which will not copy them over to your library folder, but instead keep the book as an "external" reference.
`lspace import --inplace path/to/ebook.epub`
#### import from calibre library
`lspace import path/to/calibre_library/metadata.db`
#### import from lspace api
`lspace import http://<some-address>/api/v1/`
the web interface (`lspace web` - scroll down a bit!) generates import strings based on your search!
### searching your library
`lspace list QUERY [--path]`
for example,
`lspace list programming --path`
would return something like
/home/USER/library/donald-e-knuth/art-of-computer-programming-volume-2.pdf
/home/USER/library/donald-e-knuth/the-art-of-computer-programming-volume-1-fascicle-1.pdf
and
`lspace list dwarf`
would return return
Peter Tyson - Getting Started With Dwarf Fortress
### removing stuff
`lspace remove QUERY`
this command will ask you before it actually deletes stuff :)
Peter Tyson - Getting Started With Dwarf Fortress
/home/USER/library/peter-tyson/getting-started-with-dwarf-fortress.epub
delete this book from library? [y/N]:
### exporting books
`lspace export QUERY ~/some/folder/ --format mobi`
would convert all books matching on QUERY to 'mobi' and export them to ~/some/folder
to actually export to another format, you need "ebook-convert", which is part of [calibre](https://calibre-ebook.com/)!
### browse & share your books via webserver
`lspace web --host 0.0.0.0 --port 5000`
![L-Space web interface](https://raw.githubusercontent.com/puhoy/lspace/master/lspace_screenshot.png "screenshot of the L-Space web interface")
this also gives you the import command for your current search results!
(or you can just download them manually..)
## setting up a dev env
#### 1. clone this repo
#### 2. make a virtualenv and activate it
```bash
python -m venv env
source env/bin/activate # for bash
# or
#. env/bin/activate.fish # for fish
```
#### 3. install requirements
```bash
pip install -e .[dev]
```
#### 4. set up a separate config to not mess up your regular installation
```bash
# initialize a new config file at a separate path
LSPACE_CONFIG=~/.config/lspace_dev/config.yml lspace init
# change the database and library path! (otherwise it would still use the regular db)
sed -i 's/lspace\/lspace.db/lspace_dev\/lspace.db/g' ~/.config/lspace_dev/config.yml
sed -i 's/~\/library/~\/library_dev/g' ~/.config/lspace_dev/config.yml
# also, if you want, set the loglevel to something else
```
after this, just set LSPACE_CONFIG to your new config file before you start to try new stuff
```bash
export LSPACE_CONFIG=~/.config/lspace_dev/config.yml # bash
set -gx LSPACE_CONFIG ~/.config/lspace_dev/config.yml # fish
```
#### migrations
the db command is available when running in dev mode.
create a new migration with `LSPACE_DEV=1 lspace db migrate`
afterwards, running any lspace command will automatically update the database
#### making a release
commands to build, test-release and release are wrapped in a `doit` script `dodo.py`.
bumping is requires bump2version, twine is used for uploading to pypi.
## why "L-space"?
its named after discworlds [library-space](https://en.wikipedia.org/wiki/List_of_dimensions_of_the_Discworld#L-space) dimension :)
Raw data
{
"_id": null,
"home_page": "https://github.com/puhoy/lspace",
"name": "lspace",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "jan",
"author_email": "stuff@kwoh.de",
"download_url": "https://files.pythonhosted.org/packages/70/7b/e1d81f28de68d7cf2c2eb8dae8fa8264b265ac0f60194157c8b517950535/lspace-0.4.8.tar.gz",
"platform": null,
"description": "# l-space\n\na cli ebook manager built around [isbnlib](https://github.com/xlcnd/isbnlib)\n\non import, lspace tries to find isbns in the files metadata and in the text. \nwith the isbn it tries to fetch metadata about the book from google books and openlibrary. \nif no isbn is found, it queries metadata based on the filename.\n\nafter this, your properly renamed files will be stored in your library folder.\n\ncurrently supports epub and pdf.\n\n\n[![Build Status](https://travis-ci.org/puhoy/lspace.svg?branch=master)](https://travis-ci.org/puhoy/lspace)\n\n[![codecov](https://codecov.io/gh/puhoy/lspace/branch/master/graph/badge.svg)](https://codecov.io/gh/puhoy/lspace)\n\n## requirements\n\npython >=3.5 and pip\n\n\n## installation\n\n#### from pypi (latest release)\n\n`pip install lspace`\n\n#### from github (probably-not-so-stable-dev-stuff)\n\n`pip install git+https://github.com/puhoy/lspace.git`\n\n\n## setup \n\nafter installation, you should run\n\n`lspace init`\n\nthis will setup a new configuration file, which you can edit to specify the structure of your library, for example.\n\na default config file would look like this:\n```\ndatabase_path: sqlite:////home/USER/.config/lspace/lspace.db\nfile_format: '{SHELF}/{AUTHORS}_{TITLE}'\nlibrary_path: ~/library\nloglevel: error\ndefault_shelf: misc\ndefault_author: no author\ndefault_language: no language\ndefault_publisher: no publisher\n```\n\n#### database path\n\npath to your database. \nthe project uses sqlalchemy, so all databases supported by sqlalchemy should be fine.\n\n#### file_format\n\ntemplate string for storing the plain files in the library.\n\n`{SHELF}/{AUTHORS}_{TITLE}` would produce files like `scifi/cixin-liu_three-body-problem.epub`\n\nauthor and title will be automatically slugified for this.\n\npossible variables to use are: AUTHORS, TITLE, SHELF, YEAR, LANGUAGE, PUBLISHER\n\n#### library path\n\nwhere the imported files are stored\n\n#### loglevel\n\nthe default python loglevels (debug, info, error, exception)\n\n#### default_{shelf, author, language, publisher}\n\nthe default field names, in case nothing is specified in import\n\n\n## usage\n\n### importing\n\n`lspace import path/to/ebook.epub`\n\n`lspace import path/to/folder/*`\n\nif you already have a folder you are happy with and, for example, just want to use it to serve your books or search through your files, you can add the `--inplace` switch on import, which will not copy them over to your library folder, but instead keep the book as an \"external\" reference.\n\n`lspace import --inplace path/to/ebook.epub`\n\n#### import from calibre library\n\n`lspace import path/to/calibre_library/metadata.db`\n\n#### import from lspace api\n\n`lspace import http://<some-address>/api/v1/`\n\nthe web interface (`lspace web` - scroll down a bit!) generates import strings based on your search! \n\n\n### searching your library\n\n`lspace list QUERY [--path]`\n\nfor example, \n\n`lspace list programming --path`\n\nwould return something like\n\n /home/USER/library/donald-e-knuth/art-of-computer-programming-volume-2.pdf\n /home/USER/library/donald-e-knuth/the-art-of-computer-programming-volume-1-fascicle-1.pdf\n\nand \n\n`lspace list dwarf`\n\nwould return return\n\n Peter Tyson - Getting Started With Dwarf Fortress\n\n### removing stuff\n\n`lspace remove QUERY`\n\nthis command will ask you before it actually deletes stuff :)\n\n Peter Tyson - Getting Started With Dwarf Fortress\n /home/USER/library/peter-tyson/getting-started-with-dwarf-fortress.epub\n delete this book from library? [y/N]:\n\n### exporting books\n\n\n`lspace export QUERY ~/some/folder/ --format mobi`\n\nwould convert all books matching on QUERY to 'mobi' and export them to ~/some/folder\n\nto actually export to another format, you need \"ebook-convert\", which is part of [calibre](https://calibre-ebook.com/)!\n\n### browse & share your books via webserver\n\n`lspace web --host 0.0.0.0 --port 5000` \n\n![L-Space web interface](https://raw.githubusercontent.com/puhoy/lspace/master/lspace_screenshot.png \"screenshot of the L-Space web interface\")\n\nthis also gives you the import command for your current search results!\n\n(or you can just download them manually..)\n\n## setting up a dev env\n\n#### 1. clone this repo \n\n#### 2. make a virtualenv and activate it\n\n```bash\npython -m venv env\n\nsource env/bin/activate # for bash\n\n# or\n#. env/bin/activate.fish # for fish\n```\n\n#### 3. install requirements\n\n```bash\npip install -e .[dev]\n```\n\n#### 4. set up a separate config to not mess up your regular installation\n\n```bash\n# initialize a new config file at a separate path\nLSPACE_CONFIG=~/.config/lspace_dev/config.yml lspace init\n\n# change the database and library path! (otherwise it would still use the regular db)\nsed -i 's/lspace\\/lspace.db/lspace_dev\\/lspace.db/g' ~/.config/lspace_dev/config.yml\nsed -i 's/~\\/library/~\\/library_dev/g' ~/.config/lspace_dev/config.yml\n\n# also, if you want, set the loglevel to something else\n\n```\n \nafter this, just set LSPACE_CONFIG to your new config file before you start to try new stuff\n\n```bash\nexport LSPACE_CONFIG=~/.config/lspace_dev/config.yml # bash\nset -gx LSPACE_CONFIG ~/.config/lspace_dev/config.yml # fish \n```\n\n#### migrations\n\nthe db command is available when running in dev mode.\n\ncreate a new migration with `LSPACE_DEV=1 lspace db migrate`\n\nafterwards, running any lspace command will automatically update the database\n\n\n#### making a release\n\ncommands to build, test-release and release are wrapped in a `doit` script `dodo.py`.\n\nbumping is requires bump2version, twine is used for uploading to pypi.\n\n\n## why \"L-space\"?\n\nits named after discworlds [library-space](https://en.wikipedia.org/wiki/List_of_dimensions_of_the_Discworld#L-space) dimension :)\n\n",
"bugtrack_url": null,
"license": null,
"summary": "ebook manager built around isbnlib",
"version": "0.4.8",
"project_urls": {
"Homepage": "https://github.com/puhoy/lspace"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3dd96f6fa58ba9ef6918eebdd59e3742a1f3449bbb38b894509c01ef7f81c1a0",
"md5": "6cde8f78694177c6112d53e322b6450b",
"sha256": "c53292a4e4de0ad891a9f2b5cda0555459a8cfb63c0d50af35172331514f2268"
},
"downloads": -1,
"filename": "lspace-0.4.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6cde8f78694177c6112d53e322b6450b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 93983,
"upload_time": "2024-08-01T11:15:10",
"upload_time_iso_8601": "2024-08-01T11:15:10.220255Z",
"url": "https://files.pythonhosted.org/packages/3d/d9/6f6fa58ba9ef6918eebdd59e3742a1f3449bbb38b894509c01ef7f81c1a0/lspace-0.4.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "707be1d81f28de68d7cf2c2eb8dae8fa8264b265ac0f60194157c8b517950535",
"md5": "2e5ff215a548baaa1bed9f33da3b4bb4",
"sha256": "044311ba450b7e8b152fe3810f2e4188e973eeb35163e98401aee6e10ee885f5"
},
"downloads": -1,
"filename": "lspace-0.4.8.tar.gz",
"has_sig": false,
"md5_digest": "2e5ff215a548baaa1bed9f33da3b4bb4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 76494,
"upload_time": "2024-08-01T11:15:12",
"upload_time_iso_8601": "2024-08-01T11:15:12.373445Z",
"url": "https://files.pythonhosted.org/packages/70/7b/e1d81f28de68d7cf2c2eb8dae8fa8264b265ac0f60194157c8b517950535/lspace-0.4.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-01 11:15:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "puhoy",
"github_project": "lspace",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"lcname": "lspace"
}