QuickStart¶
Please check out the conceptual overview for an overview of what can be done with the Pipes API.
Start by initializing the API, using a filesystem path:
import pipes
api = pipes.platformAPI(path)
This path is managed completely by the API, and should not be edited outside the API.
In order to connect, you’ll need a Network and an Identity. For the identity, for example:
if api.hasLocalIdentity():
identity = api.localIdentity()
else:
identity = api.addIdentity("Alice")
For the network, either you’ve created or been given a “network file” – or, you’ll need to connect to the bootstrap network and pick one of the available networks. Then you can connect, for example:
if networkId:
network = api.networkWithId(networkId)
else:
network = api.bootstrapNetwork()
node = network.nodeWithIdentity(identity)
node.addConnectionListener(self._handleNodeConnection)
node.connect()
The Pipes API is asynchronous: for almost all operations, you’ll want
to attach listeners, as is done with node.addConnectionListener
above.