Metadata-Version: 2.1
Name: epubedit
Version: 0.0.1
Summary: a python package to read ePub infos and edit it.
Author: Youyu
License: Copyright (c) 2024 The Python Packaging Authority
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: homepage, https://github.com/childeyouyu/epubedit
Project-URL: repository, https://github.com/childeyouyu/epubedit
Project-URL: issues, https://github.com/childeyouyu/epubedit/issues
Keywords: epub,ebook,metadata search,content.opf,ebook-reader,ebook-editor,epub-tools,digital-publishing,ebook-converter,ebook-management,ebook-library,metadata,metadata-editor,epub-metadata
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Requires-Python: >=3.0
Description-Content-Type: text/markdown
License-File: LICENSE

<!--
 * @Date: 2024-07-18 21:44:17
 * @LastEditors: youyu 2000601104@cjlu.edu.cn
 * @LastEditTime: 2024-07-22 23:47:12
-->
# EpubEdit

> Regarding epubedit, this is a Python package for viewing and editing epub file metadata

## Installation and Usage

* Installation:

``` Python
pip install epubedit
```

* Usage

``` Python

from epubedit import read_epub_info


book = read_epub_info('book_name')
book.get_infos()
```

## Functions

### read_info(str) -> str | list

Read the value of a single metadata
Supported parameters:
            [
                'epub_version',
                "book_name",
                "author_name",
                "publisher_name",
                "ISBN",
                "ASIN",
                "bookid",
                "describe",
                "language",
                "rights",
                "publication_date",
            ]

Example:

``` Python
from epubedit import read_epub_info

book = read_epub_info("Moby Dick.epub")
print(book.get_info('book_name'))
```

Running results

```Python
Moby Dick; Or, The Whale
```

### read_infos(list) -> list

Pass a list and transmit the corresponding metadata values

``` Python
from epubedit import read_epub_info

book = read_epub_info("Moby Dick.epub")
print(book.get_infos(["book_name", "epub_version", "language"]))
```

Running results

```Python
{"book_name": "Moby Dick; Or, The Whale", "epub_version": "3.0", "language": "en"}
```

### read_all_infos() -> dict

No input value, all metadata information is transmitted. If there is a lack of relevant information in EPUB, it will return str: "" or list: []

``` Python
book = read_epub_info('Moby Dick.epub')
print(book.get_all_infos())
```

Running results

```Python
{
    "epub_version": "3.0",
    "rights": "Public domain in the USA.",
    "book_name": "Moby Dick; Or, The Whale",
    "author": ["Herman Melville"],
    "isbn": "",
    "asin": "",
    "publisher": "",
    "published_date": "",
    "modified_date": "2024-07-20T22:24:39Z",
    "language": "en",
    "subject": [
        "Whaling -- Fiction",
        "Sea stories",
        "Psychological fiction",
        "Ship captains -- Fiction",
        "Adventure stories",
        "Mentally ill -- Fiction",
        "Ahab, Captain (Fictitious character) -- Fiction",
        "Whales -- Fiction",
        "Whaling ships -- Fiction",
    ],
}
```

## Links

* **GitHub Repository :** [EpubEdit](https://github.com/childeyouyu/epubedit)
