Skip to main content

A wrapper for couchsurfing.org API

Project description

Couchsurfing.org Python API

Installation:

pip install couchsurfing

Usage:

  • Initialize API with couchsurfing.org username and password:

    from couchsurfing import Api api = Api(login, password)

  • Retrieve all your couchrequests between certain dates (in unixtime), e.g. for the current month:

    from couchsurfing import Requests import datetime

    now = datetime.now() start_month = int(datetime(now.year, now.month, 1).timestamp()) end_month = int(datetime(now.year, now.month+1, 1).timestamp())

    requests = Requests(api, start_month, end_month)

  • Get all accepted and pending couchrequests:

    print(requests.accepted) print(requests.new)

  • Get send/received messages:

    from couchsurfing import Messages messages = Messages(api, “inbox”) messages.get_unread()

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

couchsurfing-0.2.0.tar.gz (3.5 kB view hashes)

Uploaded Source

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