bank_import Package

models Module

Models related to Bank Accounts & Imports.

class bank_import.models.BankAccount(*args, **kwargs)[source]

An Accountant-Visible Wrapper for an Account.

This lets us keep track of the importer class to use for each Account.

account

The Account the BankAccount is linked to. This is the Account that will have it’s Entries imported.

name

A name for the Bank Account, used in forms.

bank

The module/function path to the statement importer to use for this account.

get_importer_class()[source]

Import and return the Importer to use for the Bank Account.

class bank_import.models.CheckRange(*args, **kwargs)[source]

Store a Default Account/Memo/Payee for a BankAccount’s Checks.

When importing a bank statement, any expense checks that fall within a CheckRange should be pre-filled with the default_account, default_payee, & default_memo of the CheckRange.

bank_account

The BankAccount that the CheckRange applies to.

start_number

The starting check number of the range.

end_number

The ending check number of the range.

default_account

The Account to use for checks that fall within the range.

default_payee

The Payee to use for checks that fall within the range.

default_memo

The Memo to use for checks that fall within the range.

forms Module

Forms & Formsets Used in the import_bank Views.

class bank_import.forms.BankAccountForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.util.ErrorList'>, label_suffix=':', empty_permitted=False)[source]

A Form to Select a BankAccount and Upload an Import File.

class bank_import.forms.ImportFormMixin[source]

A mixin to help customize Import specific Forms.

class bank_import.forms.ReceivingImportForm(*args, **kwargs)[source]

A form for importing unmatched BankReceivingEntries.

class Meta[source]

Customize the field order & widgets.

model

alias of BankReceivingEntry

ReceivingImportForm.save(*args, **kwargs)[source]

Create the BankReceivingEntry and it’s Transactions.

class bank_import.forms.SpendingImportForm(*args, **kwargs)[source]

A form for importing unmatched BankSpendingEntries.

class Meta[source]

Remove the comments field from the base BankSpendingForm.

model

alias of BankSpendingEntry

SpendingImportForm.save(*args, **kwargs)[source]

Create the BankSpendingEntry and it’s Transactions.

class bank_import.forms.TransferImportForm(*args, **kwargs)[source]

A form for importing unmatched Transfers.

save()[source]

Save the Transfer by Creating a General Journal Entry.

views Module

Views for Importing Bank Statements.

bank_import.views.import_bank_statement(request, *args, **kwargs)[source]

Render the Import Upload Form, & the FormSets.

importers.base Module

Abstract Classes that Custom Importers Should Inherit From.

class bank_import.importers.base.BaseImporter(file_object, *args, **kwargs)[source]

An abstract class for the import_bank_statement view.

Descendants of this class handle parsing the file_object and returning the parsed transaction dictionaries.

get_data()[source]

Return the parsed data.

process_file(file_object)[source]

Process the File & Return a list of Dictionaries.

class bank_import.importers.base.CSVImporter(file_object, *args, **kwargs)[source]

An abstact Bank Statement Importer to process CSV Files.

The file_object passed to the constructor should point to a CSV file whose first row are headers for the columns.

Implementations must specify two class attributes:

  1. CSV_TO_DATA_FIELDS - a dictionary mapping from CSV column names to data field names. Required field names are date, amount, check_number, type`, & ``memo.
  1. CSV_TYPE_TO_DATA_TYPE - a dictionary mapping from CSV type column values to data type values. Valid data type values are transfer_deposit, transfer_withdrawal`, ``deposit, or withdrawal.

An optional CSV_DATE_FORMAT class attribute may modify the format string used to parse the date field. By default, MM/DD/YYYY is expected.

process_file(file_object)[source]

Read the CSV file and Return the Data using CSV_TO_DATA_FIELDS.

class bank_import.importers.base.QFXImporter(file_object, *args, **kwargs)[source]

A Bank Statement importer to process QFX files.

Bank-specific implementations of this importer may want to cleanup the memo field, by overriding the clean_memo function.

clean_memo(memo)[source]

Clean the memo field.

process_file(file_object)[source]

Read the QFX file & Return the standardized data.

importers.vcb Module

Implements the Importers for Virginia Community Bank.

class bank_import.importers.vcb.CSVImporter(file_object, *args, **kwargs)[source]

Specify the Field Conversion & Type Conversion for VCB CSV Exports.

get_data()[source]

Reverse the data, imported lines are in descending order by date.

importers.city_first_dc Module

Implements the Importers for City First - Bank of DC.

class bank_import.importers.city_first_dc.QFXImporter(file_object, *args, **kwargs)[source]

Clean up the memo field.