ogt.ags4.*¶
-
class
ogt.ags4.
AGS4GroupDataDict
(group_code)[source]¶ Data dictionary of an ags GROUP, reads the JSON definiton file
Parameters: group_code (str) -- The four character group code -
group
()[source]¶ Return the group details; description, status, suggested type etc
Return type: dict Returns: A dictionary of the group details
-
heading
(head_code)[source]¶ Return data on a heading (see HEADER)
Parameters: head_code (str) -- The Returns: a tuple with: - A `dict` with the heading details if found, else `None`
- `True` if heading found, else `False`
-
-
ogt.ags4.
AGS4_DD
= None¶ This dict contains all the ags4 data, loaded in utils.initialise()
-
class
ogt.ags4.
AGS4_DESCRIPTOR
[source]¶ Constants defining the data descriptors (See Rule 3 - Data Descriptors)
-
data
= 'DATA'¶
-
group
= 'GROUP'¶
-
static
group_header
()[source]¶ List of header defined in Rule 2a - CRLF New Line
Returns: A list of descriptions in order
-
heading
= 'HEADING'¶
-
type
= 'TYPE'¶
-
unit
= 'UNIT'¶
-
-
class
ogt.ags4.
Problem
(row=None, column=None, field=None, rule=None, group_code=None, head_code=None, message=None, type=None, data=None)[source]¶ A container for ags validation problems and issues
-
column
= None¶ The column in the source line
-
data
= None¶ The data message
-
field
= None¶ The csv field index
-
message
= None¶ A quick message
-
row
= None¶ The row index in the csv file, ie line_no - 1
-
rule
= None¶ The ags rule (AGS4 - Rules)
-
-
ogt.ags4.
abbrs
()[source]¶ Return all abbreviations in the ags4 data dict
Return type: dict Returns: the data if succesful, else None
-
ogt.ags4.
all
()[source]¶ Return everything in the ags4 data dict
Return type: dict Returns: the data if succesful, else None
-
ogt.ags4.
doc_to_ags4_csv
(doc)[source]¶ Serialize a document to ags4 format CSV
Parameters: doc (ogt.ogt_doc.OGTDocument) -- The document to convert Return type: tuple Returns:
-
ogt.ags4.
group
(group_code)[source]¶ Return all GROUP s in the ags4 data dict
Parameters: group_code (str) -- The four character group code to initialize with Return type: dict Returns: the data if successful, else None
-
ogt.ags4.
groups
()[source]¶ Return all GROUP s in the ags4 data dict
Return type: dict Returns: the data if succesful, else None
-
ogt.ags4.
rule_1
(doc)[source]¶ Validate Rule 1 - Character Set
Parameters: raw_str -- Return type: tuple Returns: - A list of ags_errors
- A list of sys_errors
-
ogt.ags4.
rule_10
(doc)[source]¶ Validate Rule 10 - Validation
Todo
Rule 10 validation
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_2
(doc)[source]¶ Validate Rule 2 - GROUP's required
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_3
(doc)[source]¶ Validate Rule 3 - Data Descriptors
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_4
(doc)[source]¶ Validate Rule 4 - FIELD's
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_5
(doc)[source]¶ Validate Rule 5 - Double Quotes
Todo
Rule 5 validation
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_6
(doc)[source]¶ Validate Rule 6 - Comma Separated
Todo
Rule 6 validation
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_7
(doc)[source]¶ Validate Rule 7 - Field Ordering
Todo
Rule 7 Field ordering
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_8
(doc)[source]¶ Validate Rule 8 - Units
Todo
Rule 8 Units
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors
-
ogt.ags4.
rule_9
(doc)[source]¶ Validate Rule 9 - Data Dictionary
Todo
Rule 9 Data Dictionary
Parameters: doc ( OGTDocument
) --Return type: tuple Returns: - a list of ags_errors
- a list of sys errors