Skip to main content

A Python client for the Newbook API.

Project description

Py-Newbook API Interaction

This project is about interacting with the Newbook API. It provides methods to authenticate, test the API, manage guests, sites and bookings.

Class: NewbookApi

This class is used to interact with the Newbook API.

Methods

init(self, base_url: str,username: str, password: str , region: str) -> None

Initialize the NewbookApi class.

Parameters:

  • username (str): The username for the API.
  • password (str): The password for the API.
  • region (str): The region for the API.

get_api_keys(self) -> dict

Get the API keys.

Returns:

  • dict: The response from the API.

auth_test(self, api_key: str) -> dict

Test the authentication with the API.

Parameters:

  • api_key (str): The API key to test.

Returns:

  • dict: The response from the API.

get_guests_lists(self) -> dict

Get the guests lists.

Returns:

  • dict: The response from the API.

create_new_guest(self, new_guest) -> dict

Create a new guest.

Parameters:

  • new_guest (dict): The new guest details.

Returns:

  • dict: The response from the API.

update_existing_guest(self, updated_guest) -> dict

Update an existing guest.

Parameters:

  • updated_guest (dict): The updated guest details.

Returns:

  • dict: The response from the API.

get_sites_list(self) -> dict

Get the sites list.

Returns:

  • dict: The response from the API.

get_bookings_list(self, booking) -> dict

Get the bookings list.

Parameters:

  • booking (dict): The booking details.

Returns:

  • dict: The response from the API.

create_new_booking(self, new_booking) -> dict

Create a new booking.

Parameters:

  • new_booking (dict): The new booking details.

Returns:

  • dict: The response from the API.

update_existing_booking(self, existing_booking) -> dict

Update an existing booking.

Parameters:

  • existing_booking (dict): The existing booking details.

Returns:

  • dict: The response from the API.

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

newbookapi-0.1.0.tar.gz (2.8 kB view details)

Uploaded Source

Built Distribution

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

newbookapi-0.1.0-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file newbookapi-0.1.0.tar.gz.

File metadata

  • Download URL: newbookapi-0.1.0.tar.gz
  • Upload date:
  • Size: 2.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for newbookapi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 bbc5fccce70cd664f7693943bff282e7cd1df8d856f9ef07ac0190fb5f76a9f3
MD5 29629e7dca96e57b3d1358ed73130b04
BLAKE2b-256 ba97d6ece0ea13088e87711ebf4333fcca17c3c03c58f18afbad051f88bbdf3c

See more details on using hashes here.

File details

Details for the file newbookapi-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: newbookapi-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for newbookapi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a3d73eed511796d4a93ead13ac29e77934dbebd18b42434a30cd157182bc9d3d
MD5 7292ef5c843d88ef573b3066592f285a
BLAKE2b-256 0d6c7ba10bbceb85ca37a68c5ca0df7e3992393da6d19ad1ea8625710abaa2b1

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