MicroFreshener-core
is the core python module of microFreshener that permits to discover architecturl smells affectinng microservices.
microfreshener-core
has 3 stages: Importer, Analyser and Exporter. Each Stage should have well defined interface so it is easy to write new Importer, Analyser or Exporters and plug it in. Currently only Importer and Exporter interfaces are defined.
MicroFreshener-core
is a python module distributed in PyPi.
In order to use MicroFreshener-core
install the python package
$ pip install microfreshener-core
You can use microfreshener-core
in your project by importing the class of the module.
In the following example, the YML file of the helloworld is imported and analysed. The result of the analysis is a dictionary, where for each node are listed the smells and the refactorigns to be applied.
from microfreshener.core.importer import YMLImporter
from microfreshener.core.analyser import MicroToscaAnalyserBuilder
yml_importer = YMLImporter()
model = yml_importer.Import("helloworld.yml")
builder = MicroToscaAnalyserBuilder(model)
builder.add_all_sniffers()
analyser = builder.build()
res = analyser.run()
print(res)