Form/Template Fill-in the blanks

Discussion in 'Python' started by allan, Jul 25, 2009.

  1. allan

    allan Guest

    I'm attempting to create a generic python script that will take an EDI
    document specification and a database of transactions and be able to
    generate a raw EDI file (ansi X12).

    I'm looking for ideas on how best to use the strengths of Python to
    implement this. I've initially tackled the EDI 812 specifications and
    narrowed this down to a specific implementation by a company. This
    narrowed down version is what I want to achieve for output. But I want
    the script to be generic enough such that I can plug-in another EDI
    specification + a database transaction set and it will output the
    proper raw file accordingly.

    My initial thought was to use:
    1. .ini files to declare the EDI configuration
    2. Use SQLAlchemy as ORB to simplify access to database objects.

    INI file configuration:
    * A "root" INI file indicates other INI files that define each segment
    of the EDI document.
    * Each segment INI defines the data elements of each segment and the
    behavior of the segment (one instance or multiple-instance as in a
    loop, sequence order, segment code, etc.)
    * Specify data elements as either constant, system function (like
    datetime), database field or object method (object being the
    segment's)
    * Load all the ini configuration into a "template" object. Each
    segment ini maps to its own segment object.

    DB using SQLAlchemy
    Gather a Trading Partner data and Credit Transaction (EDI 812
    remember?) into one dictionary object
    Gather Credit Transaction details into another dictionary object where
    it can generate the multiple instance segments

    The heart of the matter is how to fuse together the template and the
    data from the dictionary objects efficiently. It should be generic
    enough to take another set of data dictionary and another template to
    generate a completely new EDI document.

    I'm stuck at this fusing together thing. Is this a good approach? Is
    there an easier to implement approach?

    Comments, suggestions, questions please.

    Allan
    allan, Jul 25, 2009
    #1
    1. Advertising

  2. allan

    Aahz Guest

    In article <>,
    allan <> wrote:
    >
    >My initial thought was to use:
    >1. .ini files to declare the EDI configuration
    >
    >INI file configuration:
    >* A "root" INI file indicates other INI files that define each segment
    >of the EDI document.
    >* Each segment INI defines the data elements of each segment and the
    >behavior of the segment (one instance or multiple-instance as in a
    >loop, sequence order, segment code, etc.)
    >* Specify data elements as either constant, system function (like
    >datetime), database field or object method (object being the
    >segment's)
    >* Load all the ini configuration into a "template" object. Each
    >segment ini maps to its own segment object.


    This sounds like something you want to use XML for.
    --
    Aahz () <*> http://www.pythoncraft.com/

    "Many customs in this life persist because they ease friction and promote
    productivity as a result of universal agreement, and whether they are
    precisely the optimal choices is much less important." --Henry Spencer
    Aahz, Jul 27, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Hoge
    Replies:
    2
    Views:
    593
    John Hoge
    May 23, 2004
  2. tfs
    Replies:
    1
    Views:
    390
    John Saunders
    Jun 28, 2004
  3. Matt MC
    Replies:
    2
    Views:
    504
    Thomas 'PointedEars' Lahn
    May 25, 2005
  4. John
    Replies:
    2
    Views:
    420
    Harlan Messinger
    Aug 30, 2006
  5. Matt MC
    Replies:
    2
    Views:
    156
    Thomas 'PointedEars' Lahn
    May 25, 2005
Loading...

Share This Page