Skip to content

SanchezFelipe01/globant_coding_challenge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Globant Coding Challenge

This project reads data from three .CSV files and store it in a local PostgreSQL database. Once the data is ingested some operations are made to generate two specific outputs required by the stakeholders.

This project uses popular libraries like Flask, SQLAlchemy and Pandas.

Follow the next steps to execute the project:

Clone the Project

Select a folder to store the code, the use the following command to clone the repository:

git clone https://github.com/SanchezFelipe01/globant_coding_challenge.git

Traditional way

Database Setup

  1. Install PostgreSQL: Ensure that PostgreSQL is installed on your machine. You can download it from the PostgreSQL Official Website.

  2. Create the Database: Create a database in PostgreSQL with the name of your choice. You can use the command-line interface (psql) or a graphical tool like PgAdmin.

  3. Username and Password: Make sure you have a user and password with sufficient privileges to access and modify the database you created.

Setting up a Virtual Environment

It's recommended to set up a virtual environment to manage project dependencies. Follow these steps:

  1. Install virtualenv (if not installed):

    pip install virtualenv
  2. Navigate to your project directory:

    cd path\to\your\project
  3. Create a new environment:

    python -m venv .\venv

    o

    py -m venv .\venv
  4. Activate the new environment:

    .\venv\Scripts\Activate

Installing Dependencies

Use the following command to install the project dependencies. It's recommended to set up a virtual environment before installing dependencies.

pip install -r requirements.txt

Setting up the db_config.py File

The db_config.py file contains the connection information for the database, modify it if necessary.

In this case, the first postgres is the username, 12345 is the password and the second postgres is the database name.

# db_config.py
class Config:
    SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:12345@localhost/postgres'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

Start the application

Open a terminal and go to your project root folder, then execute this command:

python .\app\__main__.py

After that, in your browser go to http://127.0.0.1:5000/. Now you can interact with the application.

Using Docker

alternatively, you can use docker to build the application in less steps (you need docker to be installed in your computer):

  1. Once you have cloned the repository, go to the root folder
cd /../../globant_coding_challenge
  1. Use the following command to build the docker image
docker-compose build
  1. Execute the container
docker-compose up

After that, in your browser go to http://127.0.0.1:5000/. Now you can interact with the application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published