Skip to main content

Python interface for szurubooru

Project description

pyszuru

Python interface for szurubooru

Usage

Creating API Instance

import pyszuru
mybooru = pyszuru.API(
    "https://example.com/booru",
    username="alice",
    # Authenticate with a password
    password="hunter2",
    # Or use a token
    token="my-token-string",
    # Optionally specify a API base URL if it differs from the default configuration
    # api_url="/booru-api", <-- relative to base URL
    # api_url="https://api.example.com/booru", <-- new absolute base
)

Working with tags

Note: it is reccomended to use the factory functions outlined below instead of calling the Tag constructor directly.

Get existing tag

Get an existing tag from the booru by referencing it by name

marvel_comics_tag = pyszuru.Tag.from_name(mybooru, "marvel_comics")

Create new tag

Create a new tag, must specifiy a primary name only

spiderman_tag = pyszuru.Tag.new(mybooru, "spiderman")

Alter properties of tag

spiderman_tag.implications = spiderman_tag.implications + [marvel_comics_tag]

Working with posts

Searching

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

pyszuru-0.1.0.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

pyszuru-0.1.0-py3-none-any.whl (20.4 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