Coder Social home page Coder Social logo

payswarm-python's Introduction

payswarm-python

Introduction

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:

Requirements

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.

Installation

The easiest installation method is to use pip:

pip install payswarm

To install testing requirements:

pip install -r test-requirements.txt

Usage

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

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

Authors

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

License

Please see the LICENSE file for full license details.

payswarm-python's People

Contributors

msporny avatar davidlehn avatar

Stargazers

 avatar  avatar Wes Turner avatar deknos avatar Andrew Mahon avatar Dave Longley avatar Mark Eichin avatar Brad Jones avatar Lee Azzarello avatar

Watchers

 avatar  avatar Dave Longley avatar Andrew Jones avatar James Cloos avatar  avatar Dmitri Zagidulin avatar Amit Ishairzay avatar  avatar Omar Malik avatar Mark Cherbaka avatar Ganesh Annan avatar  avatar  avatar  avatar Tashi D. Gyeltshen avatar

Forkers

admin-pumpkin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.