Permalink
Browse files

updated README

  • Loading branch information...
1 parent ffd6855 commit 314193d7ff5c023be032e9318bb3d9cb427fb660 @devjones committed Aug 26, 2011
Showing with 52 additions and 20 deletions.
  1. +32 −0 README.md
  2. +20 −20 py_etherpad.py
View
32 README.md
@@ -0,0 +1,32 @@
+This python api enables easy interaction with the Etherpad Lite API. Etherpad Lite is a collaborative editor provided by the Etherpad Foundation. http://etherpad.org
+
+
+#1 Preparation
+
+If you are using a self hosted Etherpad Lite server, you will need to specify an API Key after installation before using the API. (See https://github.com/Pita/etherpad-lite for installation details).
+
+Your secret api key should be placed in the base installation (etherpad-client folder) in a text file named APIKEY.txt. Many linux text editors automatically create a newline character, so I recommend simply executing the following command to set your api key without a newline character:
+
+ echo -n "myapikey" > APIKEY.txt
+
+#2 Basic usage
+
+ <pre>
+ from py_etherpad import EtherpadLiteClient
+ myPad = EtherpadLiteClient('EtherpadFTW','http://beta.etherpad.org/api')
+
+ #Change the text of the etherpad
+ myPad.setText('testPad','New text from the python wrapper!')
+
+ </pre>
+
+#3 More details
+
+See the py_etherpad.py file for further details on the methods and parameters available for the API
+
+#3 License
+
+Apache License
+
+#4 Credit
+This python client was inspired by TomNomNom's php client which can be found at: https://github.com/TomNomNom/etherpad-lite-client
View
40 py_etherpad.py
@@ -99,21 +99,21 @@ def createGroupIfNotExistsFor(self,groupMapper):
})
- # deletes a group
+ # deletes a group
def deleteGroup(self,groupID):
return self.call("deleteGroup", {
"groupID": groupID
})
- # returns all pads of this group
+ # returns all pads of this group
def listPads(self,groupID):
return self.call("listPads", {
"groupID": groupID
})
- # creates a new pad in this group
+ # creates a new pad in this group
def createGroupPad(self,groupID, padName, text):
return self.call("createGroupPad", {
"groupID": groupID,
@@ -122,7 +122,7 @@ def createGroupPad(self,groupID, padName, text):
})
- # AUTHORS
+ # AUTHORS
# Theses authors are bind to the attributes the users choose (color and name).
# creates a new author
@@ -132,15 +132,15 @@ def createAuthor(self,name):
})
- # this functions helps you to map your application author ids to etherpad lite author ids
+ # this functions helps you to map your application author ids to etherpad lite author ids
def createAuthorIfNotExistsFor(self,authorMapper, name):
return self.call("createAuthorIfNotExistsFor", {
"authorMapper": authorMapper,
"name": name
})
- # SESSIONS
+ # SESSIONS
# Sessions can be created between a group and a author. This allows
# an author to access more than one group. The sessionID will be set as
# a cookie to the client and is valid until a certian date.
@@ -154,35 +154,35 @@ def createSession(self,groupID, authorID, validUntil):
})
- # deletes a session
+ # deletes a session
def deleteSession(self,sessionID):
return self.call("deleteSession", {
"sessionID": sessionID
})
- # returns informations about a session
+ # returns informations about a session
def getSessionInfo(self,sessionID):
return self.call("getSessionInfo", {
"sessionID": sessionID
})
- # returns all sessions of a group
+ # returns all sessions of a group
def listSessionsOfGroup(self,groupID):
return self.call("listSessionsOfGroup", {
"groupID": groupID
})
- # returns all sessions of an author
+ # returns all sessions of an author
def listSessionsOfAuthor(self,authorID):
return self.call("listSessionsOfAuthor", {
"authorID": authorID
})
- # PAD CONTENT
+ # PAD CONTENT
# Pad content can be updated and retrieved through the API
# returns the text of a pad
@@ -193,15 +193,15 @@ def getText(self,padID):
})
- # sets the text of a pad
+ # sets the text of a pad
def setText(self,padID, text):
return self.call("setText", {
"padID": padID,
"text": text
})
- # PAD
+ # PAD
# Group pads are normal pads, but with the name schema
# GROUPIDPADNAME. A security manager controls access of them and its
# forbidden for normal pads to include a in the name.
@@ -214,51 +214,51 @@ def createPad(self,padID, text):
})
- # returns the number of revisions of this pad
+ # returns the number of revisions of this pad
def getRevisionsCount(self,padID):
return self.call("getRevisionsCount", {
"padID": padID
})
- # deletes a pad
+ # deletes a pad
def deletePad(self,padID):
return self.call("deletePad", {
"padID": padID
})
- # returns the read only link of a pad
+ # returns the read only link of a pad
def getReadOnlyID(self,padID):
return self.call("getReadOnlyID", {
"padID": padID
})
- # sets a boolean for the public status of a pad
+ # sets a boolean for the public status of a pad
def setPublicStatus(self,padID, publicStatus):
return self.call("setPublicStatus", {
"padID": padID,
"publicStatus": publicStatus
})
- # return true of false
+ # return true of false
def getPublicStatus(self,padID):
return self.call("getPublicStatus", {
"padID": padID
})
- # returns ok or a error message
+ # returns ok or a error message
def setPassword(self,padID, password):
return self.call("setPassword", {
"padID": padID,
"password": password
})
- # returns true or false
+ # returns true or false
def isPasswordProtected(self,padID):
return self.call("isPasswordProtected", {
"padID": padID

0 comments on commit 314193d

Please sign in to comment.