Anyone know of a MICR parser algorithm written in Python?

Paul McGuire ptmcg at austin.rr.com
Sat Mar 24 18:55:23 EDT 2007


On Mar 24, 2:05 pm, "mkppk" <barnaclej... at gmail.com> wrote:
> MICR = The line of digits printed using magnetic ink at the bottom of
> a check.
>
> Does anyone know of a Python function that has been written to parse a
> line of MICR data?
> Or, some financial package that may contain such a thing?
> Or, in general, where I should be looking when looking for a piece of
> Python code that may have already been written by someone?
>
> I'm working on a project that involves a check scanner the produces
> the raw MICR line as text.
>
> Now, that raw MICR needs to be parsed for the various pieces of info.
> The problem with MICR is that there is no standard layout. There are
> some general rules for item placement, but beyond that it is up to the
> individual banks to define how they choose to position the
> information.
>
> I did find an old C program written by someone at IBM... But I've read
> it and it is Not code that would nicely convert to Python (maybe its
> all the Python I'm used to, be it seems very poorly written).
>
> Here is the link to that C code:ftp://ftp.software.ibm.com/software/retail/poseng/4610/4610micr.zip
>
> I've even tried using boost to generate a Python module, but that
> didn't go well, and in the end is not going to be a solution for me
> anyway.. really need access to the Python source.
>
> Any help at all would be appreciated,
>
> -mkp

Is there a spec somewhere for this data?  Googling for "MICR data
format specification" and similar gives links to specifications for
the MICR character *fonts*, but not for the data content.

And you are right, reverse-engineering this code is more than a 10-
minute exercise.  (However, the zip file *does* include a nice set of
test cases, which might be better than the C code as a starting point
for new code.)

-- Paul




More information about the Python-list mailing list