Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated readme #3

Merged
merged 1 commit into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ['3.11']

steps:
- uses: actions/checkout@v3
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# ETL Data Pipeline

![Python](https://img.shields.io/badge/python-3776AB.svg?&style=for-the-badge&logo=python&logoColor=white)
![FastAPI](https://img.shields.io/badge/fastapi-009688.svg?&style=for-the-badge&logo=fastapi&logoColor=white)
![Pandas](https://img.shields.io/badge/pandas-150458.svg?&style=for-the-badge&logo=pandas&logoColor=white)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)

![Redis](https://img.shields.io/badge/redis-DC382D.svg?&style=for-the-badge&logo=redis&logoColor=white)
![Postgres](https://img.shields.io/badge/postgresql-4169E1.svg?&style=for-the-badge&logo=postgresql&logoColor=white)
![Docker](https://img.shields.io/badge/docker-2496ED.svg?&style=for-the-badge&logo=docker&logoColor=white)

![React](https://img.shields.io/badge/react-35495e.svg?&style=for-the-badge&logo=react&logoColor=61DAFB)
![TailwindCSS](https://img.shields.io/badge/tailwindcss-gray.svg?&style=for-the-badge&logo=tailwindcss&logoColor=06B6D4)

## Objective

Create a data pipeline that ingests user data via an API, processes and stores it, and then retrieves it in a serialized format.
Expand Down
9 changes: 5 additions & 4 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ async def list_users():
SELECT uid FROM users;
"""
)
result = curs.fetchall()
user_list = curs.fetchall()

return {"postgres_data": result}
return user_list

except psycopg2.Error as e:
return {"message": str(e)}
Expand Down Expand Up @@ -87,9 +87,10 @@ async def get_user(user_id: str):
""",
(user_id,),
)
result = curs.fetchall()

return result
postgres = curs.fetchall()

return postgres

except psycopg2.Error as e:
return {"message": str(e)}
Expand Down
4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React</title>
<title>Redis & Postgres ETL</title>
</head>
<body>
<div id="root"></div>
Expand Down
42 changes: 0 additions & 42 deletions static/src/App.css

This file was deleted.

22 changes: 10 additions & 12 deletions static/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,18 @@ function App() {

return (
<div className="container mx-auto">
<div className="grid grid-cols-2 gap-4 mt-10">
<div className="grid grid-cols-2 gap-8 mt-10">
<div>
<h1 className="font-bold mb-4">Current users</h1>
{Object.entries(users).map(([key, array]) => (
<ol key={key}>
{array.map(item => (
<li
key={item}
className="font-mono hover:cursor-pointer hover:text-blue-500"
onClick={() => getUser(item)}
>
{item}
</li>
))}
{users.map(item => (
<ol key={item}>
<li
key={item}
className="font-mono hover:cursor-pointer hover:text-blue-500"
onClick={() => getUser(item)}
>
{item}
</li>
</ol>
))}
</div>
Expand Down