The development outlined was carried out within a dev container to solve the Globant Data Engineer exercise. The goal was to ingest CSV files through a REST API.
To run this project locally, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/IgnacioNicolasAlvarez/GlobantDE-Challenge
-
Navigate to the project directory:
cd <project-directory>
-
Install the project dependencies from
requirements.txt
:pip install -r requirements.txt
-
Create a
.env
file in the project root directory and configure the following environment variables:CHUNK_SIZE=1000 SECRET_KEY=non_secret_key ALGORITHM=HS256 ACCESS_TOKEN_EXPIRE_MINUTES=30 DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres BACKUP_BASE_PATH=/workspaces/GlobantDE/backup
Replace the values with your specific configuration.
- Endpoint:
/uploadfile/upload/
- Method:
POST
- Parameters:
file
: Upload a CSV file.column_names
: List of column names.sep
: Separator for the CSV file (default:,
).is_full_load
: Whether to perform a full load (default:True
).table_type
: Type of table (Department, etc.).
-
Endpoint:
/backup/write/
-
Method:
POST
-
Parameters:
table_type
: Type of table for backup (Department, etc.).
-
Endpoint:
/backup/restore/
-
Method:
POST
-
Parameters:
table_type
: Type of table for restoration (Department, etc.).date
: Date for restoration (default: today's date).
- Endpoint:
/auth/token
- Method:
POST
- Parameters:
username
: Username for authentication.password
: Password for authentication.