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

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()



