Skip to content

Commit

Permalink
generate_file_meta_df method added
Browse files Browse the repository at this point in the history
  • Loading branch information
pdr-z committed Feb 22, 2024
1 parent ea35fa6 commit c4e5825
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 40 deletions.
28 changes: 14 additions & 14 deletions data2rdf/csv_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,20 @@ def generate_column_df(self):
# def generate_file_uuid(self):
# self.id_uuid = str(uuid.uuid4())

# def generate_file_meta_df(self):
# self.file_meta_df = pd.Series()
# # self.file_meta_df["encoding"] = self.encoding
# # self.file_meta_df["headerRowCount"] = self.header_length
# # self.file_meta_df["delimiter"] = self.column_sep
# # self.file_meta_df["skipRows"] = 1
# self.file_meta_df["file_path"] = self.f_path
# self.file_meta_df["server_file_path"] = self.server_f_path
# self.file_meta_df["namespace"] = self.namespace
# self.file_meta_df["uuid"] = self.id_uuid

# self.file_meta_df = pd.DataFrame(self.file_meta_df)
# self.file_meta_df.columns = ["value"]
# self.file_meta_df.index.name = "index"
def generate_file_meta_df(self):
self.file_meta_df = pd.Series()
# self.file_meta_df["encoding"] = self.encoding
# self.file_meta_df["headerRowCount"] = self.header_length
# self.file_meta_df["delimiter"] = self.column_sep
# self.file_meta_df["skipRows"] = 1
self.file_meta_df["file_path"] = self.f_path
self.file_meta_df["server_file_path"] = self.server_f_path
self.file_meta_df["namespace"] = self.namespace
self.file_meta_df["uuid"] = self.id_uuid

self.file_meta_df = pd.DataFrame(self.file_meta_df)
self.file_meta_df.columns = ["value"]
self.file_meta_df.index.name = "index"

def clean_table_df(self):
self.df_table = self.df_table.iloc[1:, :]
Expand Down
30 changes: 15 additions & 15 deletions data2rdf/excel_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def __init__(
data_storage_group_name="df",
namespace="http://www.test.de",
):
super.__init__(
super().__init__(
f_path,
server_f_path,
data_storage_path,
Expand Down Expand Up @@ -237,20 +237,20 @@ def generate_column_df(self):
# # with open(f_path, 'r', encoding=encoding) as file:
# self.id_uuid = str(uuid.uuid4())

# def generate_file_meta_df(self):
# self.file_meta_df = pd.Series()
# # self.file_meta_df["encoding"] = self.encoding
# # self.file_meta_df["headerRowCount"] = self.header_length
# # self.file_meta_df["delimiter"] = self.column_sep
# # self.file_meta_df["skipRows"] = 1
# self.file_meta_df["file_path"] = self.f_path
# self.file_meta_df["server_file_path"] = self.server_f_path
# self.file_meta_df["namespace"] = self.namespace
# self.file_meta_df["uuid"] = self.id_uuid

# self.file_meta_df = pd.DataFrame(self.file_meta_df)
# self.file_meta_df.columns = ["value"]
# self.file_meta_df.index.name = "index"
def generate_file_meta_df(self):
self.file_meta_df = pd.Series()
# self.file_meta_df["encoding"] = self.encoding
# self.file_meta_df["headerRowCount"] = self.header_length
# self.file_meta_df["delimiter"] = self.column_sep
# self.file_meta_df["skipRows"] = 1
self.file_meta_df["file_path"] = self.f_path
self.file_meta_df["server_file_path"] = self.server_f_path
self.file_meta_df["namespace"] = self.namespace
self.file_meta_df["uuid"] = self.id_uuid

self.file_meta_df = pd.DataFrame(self.file_meta_df)
self.file_meta_df.columns = ["value"]
self.file_meta_df.index.name = "index"

# def clean_table_df(self):
# self.df_table = self.df_table.iloc[1:,:]
Expand Down
36 changes: 25 additions & 11 deletions data2rdf/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,32 @@ def load_file(self):
def parse_meta_data(self):
pass

# def generate_file_meta_df(self):
# self.file_meta_df = pd.DataFrame(
# {
# "value": [
# self.f_path,
# self.server_f_path,
# self.namespace,
# self.id_uuid,
# ]
# },
# index=["file_path", "server_file_path", "name_space", "uuid"],
# )
# self.file_meta_df.index.name = "index"
def generate_file_meta_df(self):
self.file_meta_df = pd.DataFrame(
{
"value": [
self.f_path,
self.server_f_path,
self.namespace,
self.id_uuid,
]
},
index=["file_path", "server_file_path", "name_space", "uuid"],
)
self.file_meta_df = pd.Series()
# self.file_meta_df["encoding"] = self.encoding
# self.file_meta_df["headerRowCount"] = self.header_length
# self.file_meta_df["delimiter"] = self.column_sep
# self.file_meta_df["skipRows"] = 1
self.file_meta_df["file_path"] = self.f_path
self.file_meta_df["server_file_path"] = self.server_f_path
self.file_meta_df["namespace"] = self.namespace
self.file_meta_df["uuid"] = self.id_uuid

self.file_meta_df = pd.DataFrame(self.file_meta_df)
self.file_meta_df.columns = ["value"]
self.file_meta_df.index.name = "index"

def generate_file_uuid(self):
Expand Down

0 comments on commit c4e5825

Please sign in to comment.