diff --git a/protocolAggregator/anjunaEnclave/cython_test.py b/protocolAggregator/anjunaEnclave/cython_test.py new file mode 100644 index 0000000..f33f873 --- /dev/null +++ b/protocolAggregator/anjunaEnclave/cython_test.py @@ -0,0 +1 @@ +import fastavro_deserialisation \ No newline at end of file diff --git a/protocolAggregator/anjunaEnclave/fastavro_deserialisation.pyx b/protocolAggregator/anjunaEnclave/fastavro_deserialisation.pyx new file mode 100644 index 0000000..5bc59d0 --- /dev/null +++ b/protocolAggregator/anjunaEnclave/fastavro_deserialisation.pyx @@ -0,0 +1,16 @@ +import avro.schema +import convertCsvToJson +import datetime +from avro.datafile import DataFileReader, DataFileWriter +from avro.io import DatumReader, DatumWriter +from fastavro import writer, reader, parse_schema + +start = datetime.datetime.now() + +# Reading +with open('dataOutput.avro', 'rb') as fo: + for record in reader(fo): + print(record) + +print(start) +print(datetime.datetime.now()) \ No newline at end of file diff --git a/protocolAggregator/anjunaEnclave/fastavro_schema.avsc b/protocolAggregator/anjunaEnclave/fastavro_schema.avsc new file mode 100644 index 0000000..d445aeb --- /dev/null +++ b/protocolAggregator/anjunaEnclave/fastavro_schema.avsc @@ -0,0 +1,27 @@ +{ + "type": "record", + "name": "AggregateInput", + "fields": [ + { + "name": "anzsic06", + "type": "string" + }, + { + "name": "Area", + "type": "string" + }, + { + "name": "year", + "type": "string" + }, + { + "name": "geo_count", + "type": "string" + }, + { + "name": "ec_count", + "type": "string" + } + ] + +} \ No newline at end of file diff --git a/protocolAggregator/anjunaEnclave/setup.py b/protocolAggregator/anjunaEnclave/setup.py new file mode 100644 index 0000000..30479a1 --- /dev/null +++ b/protocolAggregator/anjunaEnclave/setup.py @@ -0,0 +1,6 @@ +from setuptools import setup +from Cython.Build import cythonize + +setup( + ext_modules = cythonize("temp.pyx") +) \ No newline at end of file