
NOTICE: All information contained herein is, and remains
the property of TechnoCore.
The intellectual and technical concepts contained
herein are proprietary to TechnoCore and dissemination of this information or reproduction of this material
is strictly forbidden unless prior written permission is obtained
from TechnoCore.
The ObjImportApi class in ObjDataImportCSV.py is a specialized data import tool designed to handle CSV (Comma-Separated Values) files. It extends the core ObjData.ObjData class, providing functionalities to open, read, and process data from CSV files efficiently.
,), semicolon (;), pipe (|), and tab ( ).__init__(self, db_connection=0)Initializes the ObjImportApi object, setting up initial properties like file_header and input_file.
detect_separator(self, filename: str) -> strAnalyzes a sample of the given file to determine the delimiter. It uses Python's csv.Sniffer for robust detection.
prep_file(self, filename: str) -> strPrepares the file for import. For CSV files, this method currently returns the filename without any modifications but can be overridden.
open_file(self, filename: str)Opens the specified CSV file for reading. It determines the delimiter and quote character, handles file encoding, and sets up a CSV reader. It also reads the header to populate the column list.
close_file(self)Closes the currently opened file, releasing any associated resources.
column_list(self)Returns the list of column names extracted from the CSV file's header.
next_row(self)Retrieves the next row from the CSV file. It returns the row as a list of values. If there are no more rows, it returns the string 'EOF'.
# Create an instance of the importer
csv_importer = ObjImportApi()
# Open a CSV file
csv_importer.open_file("data.csv")
# Get the list of columns
columns = csv_importer.column_list()
print("Columns:", columns)
# Iterate over the rows
while True:
row = csv_importer.next_row()
if row == 'EOF':
break
print("Row data:", row)
# Close the file
csv_importer.close_file()
A quantitative measure of the number of linearly independent
paths through a program's source code.
M 80:4 ObjImportApi.open_file - B
C 32:0 ObjImportApi - A
M 129:4 ObjImportApi.next_row - A
M 55:4 ObjImportApi.prep_file - A
M 120:4 ObjImportApi.close_file - A
M 35:4 ObjImportApi.__init__ - A
M 44:4 ObjImportApi.detect_separator - A
M 125:4 ObjImportApi.column_list - A
Halstead’s goal was to identify measurable properties of software, and the
relations between them. These numbers are statically computed from the source code
η1 = the number of distinct operators
η2 = the number of distinct operands
N1 = the total number of operators
N2 = the total number of operands
h1: 7
h2: 17
N1: 12
N2: 21
vocabulary: 24
length: 33
calculated_length: 89.13835275565901
volume: 151.30376252379818
difficulty: 4.323529411764706
effort: 654.1662673823039
time: 36.34257041012799
bugs: 0.05043458750793273
Maintainability Index is a software metric which measures how maintainable
factory.import/ObjDataImportCSV.py - A
Updated : 2025-11-26