Highly configurable and permissive library to generate ACH files
Project description
ach-file
Generates ACH files. Highly configurable and permissive enough to be able to generate a valid ACH file for any originating bank.
Example
Here is an example of how to use the file builder:
from ach.files import ACHFileBuilder
from ach.constants import AutoDateInput, BatchStandardEntryClassCode, TransactionCode
b = ACHFileBuilder(
destination_routing='012345678',
origin_routing='102345678',
destination_name='YOUR BANK',
origin_name='YOUR FINANCIAL INSTITUTION',
)
b.add_batch(
company_name='YOUR COMPANY', company_identification='1234567890', company_entry_description='Test',
effective_entry_date=AutoDateInput.TOMORROW, standard_entry_class_code=BatchStandardEntryClassCode.CCD,
)
b.add_entries_and_addendas([
{
'transaction_code': TransactionCode.CHECKING_CREDIT,
'rdfi_routing': '123456789',
'rdfi_account_number': '65656565',
'amount': '300',
'individual_name': 'Janey Test',
},
{
'transaction_code': TransactionCode.CHECKING_DEBIT,
'rdfi_routing': '123456789',
'rdfi_account_number': '65656565',
'amount': '300',
'individual_name': 'Janey Test',
'addendas': [
{'payment_related_information': 'Reversing the last transaction pls and thx'},
]
},
{
'transaction_code': TransactionCode.CHECKING_CREDIT,
'rdfi_routing': '023456789',
'rdfi_account_number': '45656565',
'amount': '7000',
'individual_name': 'Mackey Shawnderson',
'addendas': [
{'payment_related_information': 'Where\'s my money'},
]
},
])
It has this result:
101 012345678 102345678221110 A094101YOUR BANK YOUR FINANCIAL INSTITUT
5200YOUR COMPANY 1234567890CCDTest 221111 1102345670000001
62212345678965656565 0000000300 Janey Test 0102345670000001
62712345678965656565 0000000300 Janey Test 1102345670000002
705Reversing the last transaction pls and thx 00010000002
62202345678945656565 0000007000 Mackey Shawnderson 1102345670000003
705Where's my money 00010000003
820000000500270370340000000003000000000073001234567890 102345670000001
9000001000001000000050027037034000000000300000000007300
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
Valid Keyword Arguments
Below are tables describing all of the valid input arguments for the callables in the above example.
File Setting Fields (ACHFileBuilder(...))
Key Name | FieldType | Required | Default |
---|---|---|---|
record_type_code | IntegerFieldType | True | 1 |
priority_code | IntegerFieldType | True | 1 |
destination_routing | BlankPaddedRoutingNumberFieldType | True | None |
origin_routing | BlankPaddedRoutingNumberFieldType | True | None |
file_creation_date | DateFieldType | True | "NOW" |
file_creation_time | TimeFieldType | False | None |
file_id_modifier | AlphaNumFieldType | True | "A" |
record size | IntegerFieldType | True | 94 |
blocking_factor | IntegerFieldType | True | 10 |
format_code | IntegerFieldType | True | 1 |
destination_name | AlphaNumFieldType | True | None |
origin_name | AlphaNumFieldType | True | None |
reference_code | AlphaNumFieldType | True | "" |
Batch Fields (b.add_batch(...))
Key Name | FieldType | Required | Default |
---|---|---|---|
record_type_code | IntegerFieldType | True | 5 |
service_class_code | IntegerFieldType | True | 200 |
company_name | AlphaNumFieldType | True | None |
company_discretionary_data | AlphaNumFieldType | False | None |
company_identification | IntegerFieldType | True | None |
standard_entry_class_code | AlphaNumFieldType | True | "PPD" |
company_entry_description | AlphaNumFieldType | True | None |
company_descriptive_date | DateFieldType | False | None |
effective_entry_date | DateFieldType | True | "TOMORROW" |
settlement_date | AlphaNumFieldType | False | None |
originator_status_code | IntegerFieldType | True | 1 |
odfi_identification | IntegerFieldType | True | (auto-set) |
batch_number | IntegerFieldType | True | (auto-set) |
Entry Fields (b.add_entries_and_addendas([{...}]))
Key Name | FieldType | Required | Default |
---|---|---|---|
record_type_code | IntegerFieldType | True | 6 |
transaction_code | IntegerFieldType | True | None |
rdfi_routing | IntegerFieldType | True | None |
rdfi_account_number | AlphaNumFieldType | True | None |
amount | IntegerFieldType | True | None |
individual_identification_number | AlphaNumFieldType | False | None |
individual_name | AlphaNumFieldType | True | None |
discretionary_data | AlphaNumFieldType | False | None |
addenda_record_indicator | IntegerFieldType | True | (auto-set) |
trace_odfi_identifier | IntegerFieldType | True | (auto-set) |
trace_sequence_number | IntegerFieldType | True | (auto-set) |
addendas | List[Dict[Addenda Fields]] | False | None |
Addenda Fields (b.add_entries_and_addendas([{'addendas': [{...}]}]))
Key Name | FieldType | Required | Default |
---|---|---|---|
record_type_code | IntegerFieldType | True | 7 |
addenda_type_code | IntegerFieldType | True | 5 |
payment_related_information | AlphaNumFieldType | False | None |
addenda_sequence_number | IntegerFieldType | True | (auto-set) |
entry_detail_sequence_number | IntegerFieldType | True | (auto-set) |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ach-file-0.1.6b0.tar.gz
(19.6 kB
view details)
Built Distribution
File details
Details for the file ach-file-0.1.6b0.tar.gz
.
File metadata
- Download URL: ach-file-0.1.6b0.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 145ad94291c97f917f1ef83226d2fd5d2ade98b96fc5b0f76e696db15d1a826c |
|
MD5 | c9780f966e7f504405b635a700602e8e |
|
BLAKE2b-256 | be3427aa865752bb870bd662fbf0d5127da0457ae3d3611ce72a51122937f8d0 |
File details
Details for the file ach_file-0.1.6b0-py3-none-any.whl
.
File metadata
- Download URL: ach_file-0.1.6b0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00274114e0b6e772f4fcadc5b7b1fb3edbb078ce1f541bb32d3490fda454fbba |
|
MD5 | 1620739525c934641386ff3f2123c5f6 |
|
BLAKE2b-256 | b6dd4ecf6632ef6c3a7b9682136026f21ed21f5d50e6be82401c5508915e460d |