Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython

tentapp is unavailable in PyPM, because there aren't any builds for it in the package repositories. Click the linked icons to find out why.

 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
0.1.0dev6 Failed View build log
Linux (64-bit)
0.1.0dev6 Failed View build log
 
Links
Author
License
MIT License
Dependencies
Lastest release
version 0.1.0dev6 on Nov 23rd, 2012

A command-line client for talking to [Tent](http://tent.io/) servers such as [tent.is](https://tent.is/).

Current Status

We're in the "move fast and break things" phase right now.

What works: * Discovery of the tent server's API root using link headers * Registering an app with the server and requesting permissions using OAuth * Auth keys are saved to a local config file for use next time * API methods (both public ones and auth-requiring ones)

It should be possible to register a notification URL using this code, but since it's not necessarily running a webserver it won't be able to be notified of incoming posts. In that case it can poll for new updates.

What needs attention: * Some API methods have not been written yet. Most of them should be quick to write by starting with copies of the methods that are already done. * Write tests * Error handling. Should add a few exception types and also pay closer attention to errors from the requests module. * Documentation * Find elegant ways to deal with the JSON we get back from the Tent server. Maybe add some classes representing posts, profiles, etc. * Package this up as a real Python module that can be installed in the usual way

Dependencies

Installation of dependencies:

``` # get requests using pip pip install requests

System Message: WARNING/2 (<string>, line 34); backlink

Inline literal start-string without end-string.

# you might already have an old version of requests that's missing the link headers feature. If so: pip install --update requests ```

System Message: WARNING/2 (<string>, line 38); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 38); backlink

Inline interpreted text or phrase reference start-string without end-string.

Quick Start

Run example.py and it will launch your browser, have the Tent server ask you to approve the app, and then post a hello world message. The OAuth process is awkward when run from a command line, so read the prompt when it asks you to copy and paste things from your browser. You only have to do this once; after that your auth details are saved in 'auth.cfg' and reused in future runs.

example_dashboard.py will get your latest posts and followings' posts and print them to the shell.

Here's a quick overview:

``` import tentapp tentapp.debug = False # Turn this on if you want to see verbose debugging info while # the app is running. Defaults to False.

System Message: WARNING/2 (<string>, line 51); backlink

Inline literal start-string without end-string.

# "entity" is the Tent version of a username. It's a full URL. entityUrl = 'https://pythonclienttest.tent.is' app = tentapp.TentApp(entityUrl)

# Get your profile info as a JSON-style Python dictionary print app.getProfile()

# Send the user to their tent server to approve this app # and save the resulting keys in a local file app.authorizeFromCommandLine('keystore.js')

# Post a new post. For now you need to supply the JSON dictionary yourself. app.putPost(yourPostJsonHere) ```

System Message: WARNING/2 (<string>, line 68); backlink

Inline literal start-string without end-string.

System Message: WARNING/2 (<string>, line 68); backlink

Inline interpreted text or phrase reference start-string without end-string.

You'll need to work directly with the JSON types described here: http://tent.io/docs/app-server

Subscribe to package updates

Last updated Nov 23rd, 2012

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.