Skip to main content

Unofficial SDK for interacting with Stockholm Library.

Project description

Stockholm-Library

License Latest PyPI version PyPI status

Unofficial SDK for interacting with Stockholm Library

Currently the project is in very early development and very little functionality can be used. But if you are eager to get stuff going, please consider helping out by contributing!

Usage

Connecting

The simplest way to connect with the client is through credentials.

from stockholm_library import Client

client = Client()
success: bool = client.login(
    user="8705061234",
    pin="1234"
)
print(success)  # True

Fetching loaned books

loans = client.get_loans()

for loan in loans:
    print(loan)  # {id: 123456, book: ...}

Below is the structure of a Loan object:

{
    "id": 123456,
    "book": models.Book(
        "id": 129716,
        "title": "Liftarens guide till galaxen",
        "author": "Douglas Adams"
    ),
    "borrowed_from": "Telefonplans bibliotek",
    "borrowed_date": datetime.date(2022, 3, 5),
    "due_date": datetime.date(2022, 4, 3),
    "can_re_borrow": True
}

Beware that not all loans have an ID at every given moment. If it's not possible to re-borrow a book it won't yield an ID.

Contributing

Contributions are always welcome!

To contribute, please take the following steps:

  1. Fork the repo
  2. Add your change
  3. Make a pull request with a short description of the change you're proposing.

Authors

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

stockholm-library-0.2.0.tar.gz (6.9 kB view hashes)

Uploaded source

Built Distribution

stockholm_library-0.2.0-py3-none-any.whl (7.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page