Package pyx12 :: Module x12file :: Class X12file
[hide private]

Class X12file

source code

object --+
         |
        X12file

Interface to an X12 data file

Instance Methods [hide private]
 
__init__(self, src_file_obj)
Initialize the file
source code
 
__del__(self) source code
 
__iter__(self) source code
 
next(self)
Iterate over input file segments
source code
 
get_errors(self)
Get Errors DEPRECATED
source code
 
pop_errors(self)
Pop error list
source code
 
_isa_error(self, err_cde, err_str) source code
 
_gs_error(self, err_cde, err_str) source code
 
_st_error(self, err_cde, err_str) source code
 
_seg_error(self, err_cde, err_str, err_value=None, src_line=None) source code
int
_int(self, str_val)
Converts a string to an integer
source code
 
cleanup(self)
At EOF, check for missing loop trailers
source code
string
get_isa_id(self)
Get the current ISA identifier
source code
string
get_gs_id(self)
Get the current GS identifier
source code
string
get_st_id(self)
Get the current ST identifier
source code
string
get_ls_id(self)
Get the current LS identifier
source code
int
get_seg_count(self)
Get the current segment count
source code
int
get_cur_line(self)
Get the current line
source code
tuple(string, string, string, string)
get_term(self)
Get the original terminators
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, src_file_obj)
(Constructor)

source code 

Initialize the file

Parameters:
  • src_file_obj (string or open file object) - absolute path of source file or fd
Overrides: object.__init__

pop_errors(self)

source code 

Pop error list

Returns:
List of errors

_isa_error(self, err_cde, err_str)

source code 
Parameters:
  • err_cde (string) - ISA level error code
  • err_str (string) - Description of the error

_gs_error(self, err_cde, err_str)

source code 
Parameters:
  • err_cde (string) - GS level error code
  • err_str (string) - Description of the error

_st_error(self, err_cde, err_str)

source code 
Parameters:
  • err_cde (string) - Segment level error code
  • err_str (string) - Description of the error

_seg_error(self, err_cde, err_str, err_value=None, src_line=None)

source code 
Parameters:
  • err_cde (string) - Segment level error code
  • err_str (string) - Description of the error

_int(self, str_val)

source code 

Converts a string to an integer

Parameters:
  • str_val (string)
Returns: int
Int value if successful, None if not