Skip to main content

Library to create and parse ACH files (NACHA)

Project description

carta-ach

ACH file generator module for python. So far, this has been tested with “PPD” and “CCD” batches with addenda records. Forked from python-ach by Travis Hathaway and released on PyPI as carta-ach.

Example

Below is an example of how to use the module:

from ach.builder import AchFile

settings = {
    'immediate_dest' : '123456789', # Your bank's routing number
    'immediate_org' : '123456789', # Bank assigned routing number
    'immediate_dest_name' : 'YOUR BANK',
    'immediate_org_name' : 'YOUR COMPANY',
    'company_id' : '1234567890', #tax number
}

ach_file = AchFile('A',settings) #file Id mod

entries = [
    {
        'type'           : '22', # type of
        'routing_number' : '12345678',
        'account_number' : '11232132',
        'amount'         : '10.00',
        'name'           : 'Alice Wanderdust',
        'addenda' : [
            {
                'payment_related_info': 'Here is some additional information',
            },
        ],
    },
    {
        'type'           : '27',
        'routing_number' : '12345678',
        'account_number' : '234234234',
        'amount'         : '150.00',
        'name'           : 'Billy Holiday',
    },
    {
        'type'           : '22',
        'routing_number' : '12323231',
        'account_number' : '123123123',
        'amount'         : '12.13',
        'name'           : 'Rachel Welch',
    },
]

ach_file.add_batch('PPD', entries, credits=True, debits=True)

print ach_file.render_to_string()

This returns the following NACHA file:

101 123456780 1234567801409020123A094101YOUR BANK              YOUR COMPANY
5200YOUR COMPANY                        1234567890PPDPAYROLL         140903   1123456780000001
62212345678011232132         0000001000               ALICE WANDERDUST        1123456780000001
705HERE IS SOME ADDITIONAL INFORMATION                                             00000000001
627123456780234234234        0000015000               BILLY HOLIDAY           0123456780000002
622123232318123123123        0000001213               RACHEL WELCH            0123456780000003
820000000400370145870000000150000000000022131234567890                         123456780000001
9000001000001000000040037014587000000015000000000002213
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carta-ach-0.4.5.tar.gz (11.6 kB view details)

Uploaded Source

File details

Details for the file carta-ach-0.4.5.tar.gz.

File metadata

  • Download URL: carta-ach-0.4.5.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.20.0 setuptools/36.0.1 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.2

File hashes

Hashes for carta-ach-0.4.5.tar.gz
Algorithm Hash digest
SHA256 d5be4f50f1c940bce44449b7aa45bd1288674c006379467c51692db9f8d0bce9
MD5 6b7272b53e438a3793b593c95aff6409
BLAKE2b-256 af61363bbfb608fcd92381ea838d0001cebbc3af91a25648e6ae287734c2d21f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page