Package csb :: Package bio :: Package io :: Module clans :: Class ClansParser
[frames] | no frames]

Class ClansParser

source code

object --+
         |
        ClansParser

CLANS file format aware parser.

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__repr__(self)
str(x)
source code
 
__str__(self)
str(x)
source code
Clans instance
parse_file(self, filename, permissive=True)
Create a Clans instance by parsing the CLANS format file filename
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Properties
Clans instance clans_instance
the Clans instance that resulted from parsing a CLANS file.

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

str(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

parse_file(self, filename, permissive=True)

source code 

Create a Clans instance by parsing the CLANS format file filename

Parameters:
  • filename (str) - name of the CLANS file.
  • permissive (bool) - if True, tolerate missing non-essential or unknown blocks.
Returns: Clans instance
a Clans instance containing the parsed data
Raises:
  • MissingBlockError - if permissive == True and any essential block is missing. if permissive == False and any block is missing
  • UnknownTagError - if permissive == False and an unknown tag/ data block is encountered

Property Details

clans_instance

the Clans instance that resulted from parsing a CLANS file.

raises a ValueError if no CLANS file has been parsed yet

Get Method:
unreachable.clans_instance(self) - the Clans instance that resulted from parsing a CLANS file.
Type:
Clans instance