Giter Site home page Giter Site logo

chiesax / python-sepa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from verenigingcampuskabel/python-sepa

0.0 0.0 0.0 101 KB

Python library for parsing and building SEPA Direct Debit and SEPA eMandate schemas.

License: MIT License

Python 100.00%

python-sepa's Introduction

Python SEPA library

Python library for parsing and building SEPA Direct Debit and SEPA eMandate schemas.

The ultimate goal of this library is to support all ISO 20022 Payments messages, however in practice SEPA only uses a subset of these messages.

Supported messages

  • Cash Management (CAMT)
    • Bank To Customer Account Report v6 (camt.052.001.06)
    • Bank To Customer Statement v6 (camt.053.001.06)
    • Bank To Customer Debit Credit Notification v6 (camt.054.001.06)
    • Account Reporting Request v3 (camt.060.001.03)
  • Payments Initiation (PAIN)
    • Customer Credit Transfer Initiation v8 (pain.001.001.08)
    • Customer Payment Status Report v8 (pain.002.001.08)
    • Customer Payment Reversal v7 (pain.007.001.07)
    • Customer Direct Debit Initiation v7 (pain.008.001.07)
    • Mandate Initiation Request v5 (pain.009.001.05)
    • Mandate Amendment Request v5 (pain.010.001.05)
    • Mandate Cancellation Request v5 (pain.011.001.05)
    • Mandate Acceptance Report v5 (pain.012.001.05)
    • Creditor Payment Activation Request v6 (pain.013.001.06)
    • Creditor Payment Activation Request Status Report v6 (pain.014.001.06)
    • Mandate Copy Request v1 (pain.017.001.01)
    • Mandate Suspension Request v1 (pain.018.001.01)

Usage

Building messages

from sepa import builder

data_in = {
    'group_header': {},
    'mandate': [{
        'id': '78904536',
        'request_id': '9823701',
        'authentication': {
            'date': '2017-03-05',
            'channel': {
                'code': 'ABC'
            }
        }
    }]
}

# Returns an lxml etree object
data_out = builder.build(builder.mandate_initiation_request, data_in)

# Returns a byte string
str_data_out = builder.build_string(builder.mandate_initiation_request, data_in)
print(str_data_out)

Parsing messages

from sepa import parser

data_in = ('<MndtInitnReq>'
    '<GrpHdr></GrpHdr>'
    '<Mndt>'
        '<MndtId>78904536</MndtdId>'
        '<MndtReqId>9823701</MndtReqId>'
        '<Authntcn>'
            '<Dt>2017-03-05</Dt>'
            '<Chanl><Cd>ABC</Cd></Chanl>'
        '</Authntcn>'
    '</Mndt>'
'</MndtInitnReq>')

data_out = parser.parse_string(parser.mandate_initiation_request, data_in)
print(data_out)

Verifying messages

This feature is still work in progress.

Signing messages

This feature is still work in progress.

python-sepa's People

Contributors

daniellehuisman avatar alpeslasers avatar yoeori avatar

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.