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.1.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyszuru-0.1.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file pyszuru-0.1.1.tar.gz.

File metadata

  • Download URL: pyszuru-0.1.1.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pyszuru-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1c77781d47b49fa1aafdbd65f9f8cf4661e92b04af2e3819f795f96d16a7ecb0
MD5 ecbf19f6efbe20f649875cae64ace916
BLAKE2b-256 97646fd16331e2335b38982666e4621a6eac0aca0a22562f0fab31e9d151698d

See more details on using hashes here.

File details

Details for the file pyszuru-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pyszuru-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for pyszuru-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a445138034763b2993fbddb31270c6274fa87b7468f7b9331b327b809ec0c777
MD5 0e7e0ec9ba655ddb6cf608139278675b
BLAKE2b-256 38479fade64832f009be4d320076cc90bdbc5fa0278ed7df90667b3246a9b899

See more details on using hashes here.

Supported by

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