Skip to main content

A wrapper for couchsurfing.org API

Project description

couchsurfing-python
===================

Couchsurfing.org Python API

Usage:

* Initialize API with couchsurfing.org username and password:

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

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

```python
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:

```python
print(requests.accepted)
print(requests.new)
```

* Get send/received messages:

```python
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.1.1.tar.gz (3.2 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