reformat, add setup.py

This commit is contained in:
2020-12-27 09:21:30 -05:00
parent 5c295ab1d8
commit 89ce04d3d1
18 changed files with 107 additions and 87 deletions

View File

@@ -1,11 +1,10 @@
class ConversionAPI:
def __init__(self, session, root_url="http://api.parler.com"):
self.root_url = root_url
self.s = session
def convert(self, _type, uuid):
'''
"""
GET /v3/idConversion/{type}/{uuid}
params:
type: one of (user, post, comment, image, video, link)
@@ -14,13 +13,13 @@ class ConversionAPI:
hidden sequential ID, as protobuf varint
rate-limit: none
auth: yes
'''
"""
return self.s.get(
"{}/v3/idConversion/{}/{}".format(self.root_url, _type, uuid)
)
def reverse_convert(self, _type, _id):
'''
"""
GET /v3/uuidConversion/{type}/{id}
(*) this is enumerable
params:
@@ -30,7 +29,7 @@ class ConversionAPI:
public-facing UUID of the entity
rate-limit: none
auth: yes
'''
"""
return self.s.get(
"{}/v3/uuidConversion/{}/{}".format(self.root_url, _type, _id)
)
)