Giter Site home page Giter Site logo

paypal-reporter's Introduction

PayPal Reporter

A python library to generate reports about activity in a PayPal account. Currently supports listing transactions from the previous month.

I was looking for a way to get scheduled monthly summaries from PayPal, but could not find an existing solution. So I created this project, which retrieves transaction information via PayPal's NVP API.

NOTE: This module is not created by, endorsed by, or in any way affiliated with PayPal.

Installation

To install paypal_reporter:

pip install paypal_reporter

Usage

To get a printout of the transactions from the previous month, first create a json file containing your PayPal account's credentials:

{
    "USER": "...",
    "PWD": "...",
    "SIGNATURE": "..."
}

Then run:

python -m paypal_reporter.transactions <path-to-credentials-file>

Limitations

PayPal's API returns a maximum of 100 transactions. Currently this library does not handle pagination, therefore only 100 transactions are retrieved.

Dependencies

API

The following methods are defined in paypal_reporter.transactions and can be used to create your own reports.

get_transactions(credentials, start_datetime, end_datetime)
Gets the list of transactions from PayPal in the given date range. credentials should be a dictionary containing USER, PWD and SIGNATURE. Returns a list of dicts, sorted by ascending timestamp. In case of a problem the method raises paypal_reporter.transactions.PayPalError.
print_transactions(txns, format='simple', columns=DEFAULT_COLUMNS)
Given a list of transaction dicts, this method formats them using the tabulate library and prints then to stdout. format could be any format supported by tabulate, such as plain / simple / html / tsv. columns is a list of column names to take from the transaction dicts. The default columns are TIMESTAMP, TRANSACTIONID, STATUS, TYPE, NAME, AMT, FEEAMT, NETAMT, and CURRENCYCODE.

paypal-reporter's People

Contributors

ishirav avatar

Stargazers

 avatar Andres Vargas avatar

Watchers

 avatar

Forkers

zodman

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.