# django-book-manager
**Documentation**: https://django-book-manager.readthedocs.org
This reusable Django application provides models suitable for managing a list of
books with ratings, somewhat like a private [Goodreads](https://goodreads.com).
Its real purpose is to provide sample models, with sample data, for use in
testing other Django libraries. Often, when authoring new Django libraries, we
need a simple example application to use so that we can test out our code.
## Getting It
You can get `django-book-manager` by using pip:
```bash
pip install django-book-manager
```
If you want to install it from source, grab the git repository from GitHub and run `setup.py`:
```bash
git clone git://github.com/caltechads/django-book-manager.git
cd django-book-manager
python setup.py install
```
## Installing It
To enable `book_manager` in your project you need to add it to `INSTALLED_APPS`
in your project's `settings.py` file:
```python
INSTALLED_APPS = (
...
'book_manager',
...
)
```
Then, apply the migrations to add the schema to your database:
```bash
./manage.py migrate
```
## Using It
`django-book-manager` provides these models:
* `book_manager.Book`: a book with title, slug, publishing dates, number of pages, authors, etc.
* `book_manager.Author`: an author. `book_manager.Book` has a many to many relationship with this
* `book_manager.BookAuthor`: this is a many to many through table between `book_manager.Book` and `book_manager.Author` that exists to record billing order of authors on a book (first author, second author, etc.)
* `book_manager.Publisher`: a publisher. `book_manager.Book` has a foreign key relationship with this
* `book_manager.Binding`: a binding (hardcover, softcover, ebook, ...). `book_manager.Book` has a foreign key relationship with this
* `book_manager.Reading`: a reading record of a book by a reader. This is a many to many through table between `book_manager.Book` and the `AUTH_USER_MODEL` that records a rating, review, notes, date read, etc. for a particular user.
* `book_manager.Shelf`: a collection of `book_manager.Reading` objects, used by readers to classify books
`django-book-manager` also supplies a command that can be used to load a
[Goodreads](https://goodreads.com) user library export into Django, splitting
it into all the above models as appropriate.
To generate an export from Goodreads, go to your Goodreads account and:
* Click "My Books"
* At the bottom of that page, click "Import and Export"
* At the top of that page, click "Export Library"
To load the CSV thus generated into Django, first create a user for yourself in Django, then:
```bash
./manage.py import_csv <csvfile> <username>
```
A sample Goodreads export is available in this repository as `sandbox/data/books.csv`.
Raw data
{
"_id": null,
"home_page": "https://github.com/caltechads/django-book-manager",
"name": "django-book-manager",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "django",
"author": "Caltech IMSS ADS",
"author_email": "cmalek@caltech.edu",
"download_url": "https://files.pythonhosted.org/packages/25/fb/ba51421104e01005fef3147b9636788acc9faa3c73c97a9f3734a0ed0c3f/django-book-manager-0.3.2.tar.gz",
"platform": null,
"description": "# django-book-manager\n\n**Documentation**: https://django-book-manager.readthedocs.org\n\nThis reusable Django application provides models suitable for managing a list of\nbooks with ratings, somewhat like a private [Goodreads](https://goodreads.com).\n\nIts real purpose is to provide sample models, with sample data, for use in\ntesting other Django libraries. Often, when authoring new Django libraries, we\nneed a simple example application to use so that we can test out our code.\n\n## Getting It\n\nYou can get `django-book-manager` by using pip:\n\n```bash\npip install django-book-manager\n```\n\nIf you want to install it from source, grab the git repository from GitHub and run `setup.py`:\n\n```bash\ngit clone git://github.com/caltechads/django-book-manager.git\ncd django-book-manager\npython setup.py install\n```\n\n## Installing It\n\nTo enable `book_manager` in your project you need to add it to `INSTALLED_APPS`\nin your project's `settings.py` file:\n\n```python\nINSTALLED_APPS = (\n ...\n 'book_manager',\n ...\n)\n```\n\nThen, apply the migrations to add the schema to your database:\n\n```bash\n./manage.py migrate\n```\n\n## Using It\n\n`django-book-manager` provides these models:\n\n* `book_manager.Book`: a book with title, slug, publishing dates, number of pages, authors, etc.\n* `book_manager.Author`: an author. `book_manager.Book` has a many to many relationship with this\n* `book_manager.BookAuthor`: this is a many to many through table between `book_manager.Book` and `book_manager.Author` that exists to record billing order of authors on a book (first author, second author, etc.)\n* `book_manager.Publisher`: a publisher. `book_manager.Book` has a foreign key relationship with this\n* `book_manager.Binding`: a binding (hardcover, softcover, ebook, ...). `book_manager.Book` has a foreign key relationship with this\n\n* `book_manager.Reading`: a reading record of a book by a reader. This is a many to many through table between `book_manager.Book` and the `AUTH_USER_MODEL` that records a rating, review, notes, date read, etc. for a particular user.\n* `book_manager.Shelf`: a collection of `book_manager.Reading` objects, used by readers to classify books\n\n`django-book-manager` also supplies a command that can be used to load a\n[Goodreads](https://goodreads.com) user library export into Django, splitting\nit into all the above models as appropriate.\n\nTo generate an export from Goodreads, go to your Goodreads account and:\n\n* Click \"My Books\"\n* At the bottom of that page, click \"Import and Export\"\n* At the top of that page, click \"Export Library\"\n\nTo load the CSV thus generated into Django, first create a user for yourself in Django, then:\n\n```bash\n./manage.py import_csv <csvfile> <username>\n```\n\nA sample Goodreads export is available in this repository as `sandbox/data/books.csv`.\n",
"bugtrack_url": null,
"license": "",
"summary": "Reusable Django app for managing lists of books with ratings.",
"version": "0.3.2",
"split_keywords": [
"django"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e1086a4fa038ad2a59d68d58a8d3795a4069dc9cc34c04b8754689d1c667f08f",
"md5": "a5dd24b6c031300fa6fb70ea40cc62d3",
"sha256": "f21faa6131c9df72a68e71b6d5a8319f7bb8b575584f90833be81f026a0893d1"
},
"downloads": -1,
"filename": "django_book_manager-0.3.2-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "a5dd24b6c031300fa6fb70ea40cc62d3",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 17638,
"upload_time": "2023-01-28T00:53:04",
"upload_time_iso_8601": "2023-01-28T00:53:04.926062Z",
"url": "https://files.pythonhosted.org/packages/e1/08/6a4fa038ad2a59d68d58a8d3795a4069dc9cc34c04b8754689d1c667f08f/django_book_manager-0.3.2-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "25fbba51421104e01005fef3147b9636788acc9faa3c73c97a9f3734a0ed0c3f",
"md5": "e72418a69b6f5a16a4bbdec261e80167",
"sha256": "c10c1bdfd0fdc93b60b78f09b7dfe0baf2661e85689bb3ab3b45e8daf2e70986"
},
"downloads": -1,
"filename": "django-book-manager-0.3.2.tar.gz",
"has_sig": false,
"md5_digest": "e72418a69b6f5a16a4bbdec261e80167",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 15604,
"upload_time": "2023-01-28T00:53:07",
"upload_time_iso_8601": "2023-01-28T00:53:07.304962Z",
"url": "https://files.pythonhosted.org/packages/25/fb/ba51421104e01005fef3147b9636788acc9faa3c73c97a9f3734a0ed0c3f/django-book-manager-0.3.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-28 00:53:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "caltechads",
"github_project": "django-book-manager",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": null,
"specs": []
}
],
"lcname": "django-book-manager"
}