Skip to content

Commit 43e9aac

Browse files
committed
First release!
1 parent 534fd20 commit 43e9aac

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ jobs:
2222
TWINE_USERNAME: __token__
2323
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
2424
run: |
25-
python setup.py sdist bdist_wheel
25+
python -m build
2626
twine upload --repository pypi dist/*

README.md

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,70 @@
11
# py-gutenberg
22

3-
[![Install from PyPi](https://img.shields.io/badge/pip%20install-py-gutenberg-brightgreen)](https://pypi.org/project/py-gutenberg/) [![Version Number](https://img.shields.io/pypi/v/py-gutenberg?label=version)](https://pypi.org/project/py-gutenberg/releases) [![Tests Status](https://github.com/peterrauscher/py-gutenberg/workflows/Test/badge.svg)](https://github.com/peterrauscher/py-gutenberg/actions) [![License](https://img.shields.io/github/license/peterrauscher/py-gutenberg)](https://github.com/peterrauscher/py-gutenberg/blob/main/LICENSE)
3+
[![Install from pip](https://img.shields.io/badge/pip%20install-py--gutenberg-brightgreen)](https://pypi.org/project/py-gutenberg/) [![Tests Status](https://img.shields.io/github/actions/workflow/status/peterrauscher/py-gutenberg/test.yml?branch=main&label=tests)](https://github.com/peterrauscher/py-gutenberg/actions) [![Build Status](https://img.shields.io/github/actions/workflow/status/peterrauscher/py-gutenberg/release.yml?branch=main&label=build)](https://github.com/peterrauscher/py-gutenberg/actions) [![License](https://img.shields.io/github/license/peterrauscher/py-gutenberg)](https://github.com/peterrauscher/py-gutenberg/blob/main/LICENSE) [![Latest Release Version Number](https://img.shields.io/pypi/v/py-gutenberg)](https://pypi.org/project/py-gutenberg/releases) [![Supported Python Versions](https://img.shields.io/pypi/pyversions/py-gutenberg)](https://pypi.org/project/py-gutenberg)
4+
5+
## Overview
6+
7+
The **py-gutenberg** package is a Python library that provides methods to access the [Project Gutenberg](https://www.gutenberg.org/) library. Users can search for books based on a variety of metadata, get full texts in various formats, and retrieve metadata for books by their ID number.
8+
9+
## Installation
10+
11+
> **_⚠️_** This package has only been tested on Python 3.7 and above. There are no plans for a Python 2 version.
12+
13+
The package can be installed using the pip package manager:
14+
15+
```sh
16+
pip install py-gutenberg
17+
```
18+
19+
## Usage
20+
21+
You should import the module like so:
22+
23+
```python
24+
from gutenberg import GutenbergAPI
25+
```
26+
27+
> The `GutenbergAPI` constructor defaults to using the public instance of the Gutendex API, `https://gutendex.com`. If you are [self-hosting the API](#thanks), you can specify the IP address or URL of your instance with the `instance_url` parameter.
28+
29+
```python
30+
# Uses the public instance
31+
gb = GutenbergAPI()
32+
# Uses a self-hosted instance
33+
gb_private = GutenbergAPI(instance_url="https://gutendex-two.com")
34+
```
35+
36+
### Book Lists and Searching
37+
38+
Here's a simple example to get a list of the most recently uploaded books:
39+
40+
```python
41+
gb.get_all_books()
42+
```
43+
44+
Or, to get only public domain books:
45+
46+
```python
47+
gb.get_public_domain_books()
48+
```
49+
50+
### Individual Books
51+
52+
To get an individual book's metadata:
53+
54+
```python
55+
gb.get_book_metadata()
56+
```
57+
58+
Or, to get the full text of a book:
59+
60+
```python
61+
gb.get_book_text()
62+
```
63+
64+
Full usage information is available in [the documentation](https://github.com/peterrauscher/py-gutenberg/wiki/Documentation)
65+
66+
## Thanks
67+
68+
This module is built on the **wonderful** but unofficial API built by [@garethbjohnson](https://github.com/garethbjohnson) over at [gutendex.com](https://gutendex.com). I have no reason to believe the hosting they've setup is meant to sustain more than a few concurrent users, so please be kind a limit your requests where possible. Additionally, if you intend to use this in a production environment, it is highly encouraged that you self-host.
69+
70+
### Read about [self-hosting the API here!](https://github.com/garethbjohnson/gutendex/wiki/Installation-Guide)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "py-gutenberg"
7-
version = "0.0.1"
7+
version = "1.0.0"
88
authors = [
99
{ name="Peter Rauscher", email="[email protected]" },
1010
]

0 commit comments

Comments
 (0)