Just uploaded a Discourse API wrapper for Twisted/Python.
It includes some tests and an example to help you get started. You can find it right here. Have fun!
(for those wondering Twisted is an event-driven network programming framework written in Python. Check it out!
txDiscourse - Twisted Discourse Client
Discourse API wrapper written for Twisted, the event-driven network programming framework written in Python.
pip install txDiscourse
- Twisted > 14.0.0
- nosetests == 1.3.4
Try it out!
Add your Discourse Hostname and Api Key and run:
this should give you your latest posts.
Create a new client and give it your discourse host, api key and username:
from txDiscoure import DiscourseClient
client = DiscourseClient(host, api_key, username)
Get latest topics:
Create a new topic:
client.create_topic('title', 'text text text')
Get all topics created:
returns a list of topics in a json string.
For more examples check out the test_api_calls.
At the moment tests only cover topics. To run tests:
export DC_HOST="test.discourse.com" export DC_API_KEY="1234567890" export DC_USERNAME="system" nosetest txDiscourse.test_api_calls
Copyright 2015 Anouk Ruhaak
Licensed under the Apache License, Version 2.0 (the “License”);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.