Package: ach-file
ach-fileGenerates ACH files. Highly configurable and permissive enough to be able to generate a valid ACH file for any originating bank.ExampleHere 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                                       
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999Valid Keyword ArgumentsBelow are tables describing all of the valid input arguments for the callables in the above example.File Setting Fields (ACHFileBuilder(...))Key NameFieldTypeRequiredDefaultrecord_type_codeIntegerFieldTypeTrue1priority_codeIntegerFieldTypeTrue1destination_routingBlankPaddedRoutingNumberFieldTypeTrueNoneorigin_routingBlankPaddedRoutingNumberFieldTypeTrueNonefile_creation_dateDateFieldTypeTrue"NOW"file_creation_timeTimeFieldTypeFalseNonefile_id_modifierAlphaNumFieldTypeTrue"A"record sizeIntegerFieldTypeTrue94blocking_factorIntegerFieldTypeTrue10format_codeIntegerFieldTypeTrue1destination_nameAlphaNumFieldTypeTrueNoneorigin_nameAlphaNumFieldTypeTrueNonereference_codeAlphaNumFieldTypeTrue""Batch Fields (b.add_batch(...))Key NameFieldTypeRequiredDefaultrecord_type_codeIntegerFieldTypeTrue5service_class_codeIntegerFieldTypeTrue200company_nameAlphaNumFieldTypeTrueNonecompany_discretionary_dataAlphaNumFieldTypeFalseNonecompany_identificationIntegerFieldTypeTrueNonestandard_entry_class_codeAlphaNumFieldTypeTrue"PPD"company_entry_descriptionAlphaNumFieldTypeTrueNonecompany_descriptive_dateDateFieldTypeFalseNoneeffective_entry_dateDateFieldTypeTrue"TOMORROW"settlement_dateAlphaNumFieldTypeFalseNoneoriginator_status_codeIntegerFieldTypeTrue1odfi_identificationIntegerFieldTypeTrue(auto-set)batch_numberIntegerFieldTypeTrue(auto-set)Entry Fields (b.add_entries_and_addendas([{...}]))Key NameFieldTypeRequiredDefaultrecord_type_codeIntegerFieldTypeTrue6transaction_codeIntegerFieldTypeTrueNonerdfi_routingIntegerFieldTypeTrueNonerdfi_account_numberAlphaNumFieldTypeTrueNoneamountIntegerFieldTypeTrueNoneindividual_identification_numberAlphaNumFieldTypeFalseNoneindividual_nameAlphaNumFieldTypeTrueNonediscretionary_dataAlphaNumFieldTypeFalseNoneaddenda_record_indicatorIntegerFieldTypeTrue(auto-set)trace_odfi_identifierIntegerFieldTypeTrue(auto-set)trace_sequence_numberIntegerFieldTypeTrue(auto-set)addendasList[Dict[Addenda Fields]]FalseNoneAddenda Fields (b.add_entries_and_addendas([{'addendas': [{...}]}]))Key NameFieldTypeRequiredDefaultrecord_type_codeIntegerFieldTypeTrue7addenda_type_codeIntegerFieldTypeTrue5payment_related_informationAlphaNumFieldTypeFalseNoneaddenda_sequence_numberIntegerFieldTypeTrue(auto-set)entry_detail_sequence_numberIntegerFieldTypeTrue(auto-set)