diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 701b467..7c54bef 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -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 diff --git a/README.md b/README.md index 4c75eb2..d90867d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/api.py b/api.py index 577c947..c7aeab9 100644 --- a/api.py +++ b/api.py @@ -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)} @@ -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)} diff --git a/static/index.html b/static/index.html index 0c589ec..1b3d735 100644 --- a/static/index.html +++ b/static/index.html @@ -1,10 +1,10 @@ - + - Vite + React + Redis & Postgres ETL
diff --git a/static/src/App.css b/static/src/App.css deleted file mode 100644 index b9d355d..0000000 --- a/static/src/App.css +++ /dev/null @@ -1,42 +0,0 @@ -#root { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; - text-align: center; -} - -.logo { - height: 6em; - padding: 1.5em; - will-change: filter; - transition: filter 300ms; -} -.logo:hover { - filter: drop-shadow(0 0 2em #646cffaa); -} -.logo.react:hover { - filter: drop-shadow(0 0 2em #61dafbaa); -} - -@keyframes logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } -} - -@media (prefers-reduced-motion: no-preference) { - a:nth-of-type(2) .logo { - animation: logo-spin infinite 20s linear; - } -} - -.card { - padding: 2em; -} - -.read-the-docs { - color: #888; -} diff --git a/static/src/App.jsx b/static/src/App.jsx index 7e1cf6e..0cde83f 100644 --- a/static/src/App.jsx +++ b/static/src/App.jsx @@ -61,20 +61,18 @@ function App() { return (
-
+

Current users

- {Object.entries(users).map(([key, array]) => ( -
    - {array.map(item => ( -
  1. getUser(item)} - > - {item} -
  2. - ))} + {users.map(item => ( +
      +
    1. getUser(item)} + > + {item} +
    ))}