Skip to main content

A small asynchronous wrapper for the FicHub API, made to retrieve story metadata and download stories from various websites.

Project description

FicHub API Wrapper

A small asynchronous wrapper for the FicHub API, made to retrieve story data from various fanfiction and original fiction sites. For more information about FicHub, see their website and git repos.

Installing

fichub-api-wrapper currently requires Python 3.8 or higher.

To install the library, run one of the following commands:

# Linux/macOS
python3 -m pip install -U git+https://github.com/Sachaa-Thanasius/fichub-api-wrapper

# Windows
py -3 -m pip install -U git+https://github.com/Sachaa-Thanasius/fichub-api-wrapper

Example

For more examples, see the examples folder.

import asyncio
import aiohttp
import fichub_api as fichub

async def main():
    async with aiohttp.ClientSession() as session:
        client = fichub.Client(session=session)
        url = "https://www.fanfiction.net/s/13912800/1/Magical-Marvel"
        story_metadata = await client.get_story_metadata(url)
        print(
            f"Story Metadata (link: '{story_metadata.url}')\n",
            f"    {story_metadata.title}\n",
            f"        {story_metadata.description}\n"
        )

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fichub_api-0.2.2.tar.gz (9.2 kB view hashes)

Uploaded Source

Built Distribution

fichub_api-0.2.2-py3-none-any.whl (8.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page