In this article, I perform a comparative study on building a basic REST API using major Python-based frameworks — Django, Flask, and FastAPI.
But first, what is REST?
REpresentational State Transfer is a set of standards that defines how operations on web-apps access data following a group of predefined operations. It has been accepted ubiquitously due to its simplicity and efficiency.
REST API provides various options for a request depending on the type of operation. The two most common requests are:
Working in a team of developers requires consistency and correctness. As we are transitioning into more of an automated world of development, it is important to automate the process of merging the collaborations into an accurate and uniform standard.
CI/CD — Continuous Integration and Continuous Deployment, have been hot topics for a while now. There is obviously no doubt in their benefits. In this article, I will cover setting up a basic CI workflow in your GitHub repo. CD is out of scope for this article, but will surely be covered in the upcoming articles.
Let’s start by installing Django in our virtual environment
pip install django
Let’s define the schema of our data in models.py in an App — MyApp.
REMEMBER: In Django, only apps are migrated, you need to create an app (a python package- a folder with __init__.py) just to put models file in the app so that Django can migrate it into the DB and perform queries.
Now, since we want to use Django’s ORM, we have to have Django running for which we need a manage.py file. Let’s create a default manage.py by copying it from one of the…
This tutorial will cover the GUI, Initialization and Data sinks for the project. The official documentation by the Repast Team is attached in part 1 of this tutorial.
In Part 1, we define the agents and their behaviour. Now we will initialize our agents, build the context.
Let’s create a Builder file, right-click on the project (src) in the navigator>new>Class. Write SocialIsolationBuilder in file name, click on ‘Add’ in Interfaces and search ContextBuilder and select OK.
Click on Finish.
Replace ContextBuilder<T> with ContextBuilder<Object>.
Right-click on the workspace>Source>Override/Implement Methods..
COVID-2019 has been spreading around the world. Many countries are on lockdown to mitigate the spread of this deadly virus. Everyone around the world has adopted the practice of social distancing( or isolation). In this article, We will be going through a popular agent-based modelling Java framework — Repast Simphony. We will attempt to build a basic simulation to monitor the spread of coronavirus in various settings. The only prerequisite is the basic knowledge of object-oriented programming.
Repast Simphony downloads are available here. A getting started documentation is provided by the Repast Development Team which can be viewed in the…
MSc in CS. AI Researcher. Problem Solver