Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Python client library for PaySwarm
Python JavaScript
branch: master
Failed to load latest commit information.
examples [examples] Added unfinished publish-asset-for-sale example.
lib/payswarm [lib] Use isinstance vs type==type.
listings Start of update to newer PaySwarm and JSON-LD.
tests Start of update to newer PaySwarm and JSON-LD.
LICENSE Added license to software. Start of update to newer PaySwarm and JSON-LD.
Makefile Start of update to newer PaySwarm and JSON-LD.
README.rst Fix formatting.
README.txt Use README.rst vs
requirements.txt [package] Less strict requirement versions.
test-requirements.txt Start of update to newer PaySwarm and JSON-LD.




This is a Python implementation of a PaySwarm client. Some features of this client:

  • Generating and public/private key pairs.
  • Registering public keys with a PaySwarm Authority.
  • Digitally signing and verifying JSON-LD data such as assets and listings.
  • Registering assets for sale.
  • Registering listings.
  • Performing purchases.

You may also be interested in the similar JavaScript project. It includes a node.js based command line client with addtional features:


urllib3 is used by default instead of standard modules due to the Python 2.x series not supporting SNI. The SNI support in urllib3 requires pyOpenSSL, ndg-httpsclient, and pyasn1. The code will fallback to using urllib2 if urllib3 is not available but be aware that SNI support will silently be absent which can cause confusing errors when fetching network resources.

Test Requirements

Tests can be run with the standard unittest module or nose. Coverage testing requires nose and coverage.


The easiest installation method is to use pip:

pip install payswarm

To install testing requirements:

pip install -r test-requirements.txt


To configure a PaySwarm client run the following command:

./payswarm config

To register a listing:

./payswarm register listings/test.json

To perform a purchase of the listing:

./payswarm purchase listings/test.json

Once you purchase a listing, future purchases of that listing will not charge you any money. You may re-purchase the item by re-registering the asset and listing, which will force a new digital signature on the items, thus allowing you to purchase the newly registered item.


Testing with nose:

make test

Coverage testing with nose and coverage with results in ./cover/:

make cover

Testing with standard unittest module:

make unittest-test

Cleaning up coverage output:

make clean


This software was written by Digital Bazaar and friends. Please see the AUTHORS file for full credits.


Please see the LICENSE file for full license details.

Something went wrong with that request. Please try again.