This small library was created to provide an easy interface to YOURLS from a python program.
Simple example of shortening a URL:
import yourls.client
c = yourls.client.YourlsClient('http://localhost/yourls/yourls-api.php', username='username', password='password')
url = c.shorten('http://autoqa.fedorahosted.org/autoqa', custom='autoqa')
There has been a change in how errors are thrown in 0.2.0, please see the API documenatation for details.
Expand a shortened URL to its original form
Parameters: | shorturl – The URL to expand |
---|---|
Returns: | str – The expanded URL |
Raises : | YourlsOperationError |
Get statistics about a shortened URL
Parameters: | shorturl – The URL to expand |
---|---|
Returns: | a list of stuff - FIXME, this isn’t complete |
Raises : | YourlsOperationError |
Request a shortened URL from YOURLS with an optional keyword request
Parameters: |
|
---|---|
Returns: | str – The short URL |
Raises : | YourlsOperationError |