Skip to main content

Python client to interface with Seatsurfing

Project description

python-seatsurfing

A Python client and library to interact with the Seatsurfing API.

[!IMPORTANT] The library is a work in progress, not all functionality is available yet, or finalized.

Installation

pip install python-seatsurfing

Usage

Usage with known organization ID and credentials:

from datetime import datetime
import seatsurfing

# Create client with authentication information
client = seatsurfing.Client(
    base_url="https://seatsurfing.example.com",
    organization_id = "9a2184f9-671f-440b-81f0-18e217af34f8",
    username="admin@seatsurfing.local",
    password="12345678",
)

# Get bookings for the next 30 days
from_date = datetime.today()
to_date = datetime.today() + timedelta(days=30)
bookings = client.booking.get_filtered_org_bookings(from_date, to_date)

print(bookings)

Usage with fetching data dynamically:

from datetime import datetime
import seatsurfing

# Create unauthenticated client
client = seatsurfing.Client(base_url="https://seatsurfing.example.com")
# Fetch organization information
org = client.authentication.get_singleorg()

# Authenticate to the organization
client.login(organization_id=org.organization.id, username="admin@seatsurfing.local", password="1234678")

# Get bookings for the next 30 days
from_date = datetime.today()
to_date = datetime.today() + timedelta(days=30)
bookings = client.booking.get_filtered_org_bookings(from_date, to_date)

print(bookings)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

python_seatsurfing-0.4.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file python_seatsurfing-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for python_seatsurfing-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b6133a055cbb8509fae9941227310560efd2eb35d150e0d5f2a56be74f9e7a5
MD5 f3e9337586f5e755da2168bd0d4016e3
BLAKE2b-256 403b28595e75af714bfac6f7683c138700890865eeb9bca3f0f252663c28b3a9

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