diff --git a/README.md b/README.md index 7d7f7c3..e3b232b 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ python3 main.py # App Project +Se agrego el comando para intalar el entorno virtual ```sh git clone diff --git a/app/chart_pie.png b/app/chart_pie.png new file mode 100644 index 0000000..cf6ea15 Binary files /dev/null and b/app/chart_pie.png differ diff --git a/app/imgs/Colombia.png b/app/imgs/Colombia.png index c6ac4e8..d802b34 100644 Binary files a/app/imgs/Colombia.png and b/app/imgs/Colombia.png differ diff --git a/app/main.py b/app/main.py index 22f1370..12fc4f0 100644 --- a/app/main.py +++ b/app/main.py @@ -9,13 +9,15 @@ def run(): countries = list(map(lambda x: x['Country'], data)) percentages = list(map(lambda x: x['World Population Percentage'], data)) ''' - + + #dataframe df = pd.read_csv('data.csv') df = df[df['Continent'] == 'Africa'] - + countries = df['Country'].values - percentages = df['World Population Percentage'].values - charts.generate_pie_chart(countries, percentages) + percetages = df['World Population Percentage'].values + charts.generate_pie_chart(countries, percetages) + data = read_csv.read_csv('data.csv') country = input('Type Country => ') diff --git a/app/requirements.txt b/app/requirements.txt index 064b60e..875171b 100644 --- a/app/requirements.txt +++ b/app/requirements.txt @@ -1,13 +1,14 @@ -contourpy==1.0.5 -cycler==0.11.0 -fonttools==4.37.4 -kiwisolver==1.4.4 -matplotlib==3.6.0 -numpy==1.23.3 -packaging==21.3 -pandas==1.5.0 -Pillow==9.2.0 -pyparsing==3.0.9 -python-dateutil==2.8.2 -pytz==2022.4 -six==1.16.0 +contourpy==1.3.1 +cycler==0.12.1 +fonttools==4.56.0 +kiwisolver==1.4.8 +matplotlib==3.10.0 +numpy==2.2.3 +packaging==24.2 +pandas==2.2.3 +pillow==11.1.0 +pyparsing==3.2.1 +python-dateutil==2.9.0.post0 +pytz==2025.1 +six==1.17.0 +tzdata==2025.1 diff --git a/web-server/Dockerfile b/web-server/Dockerfile deleted file mode 100644 index c5b9bcc..0000000 --- a/web-server/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM python:3.10 - -WORKDIR /app -COPY requirements.txt /app/requirements.txt - -RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt - -COPY . /app - -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/web-server/docker-compose.yml b/web-server/docker-compose.yml deleted file mode 100644 index c7d9a54..0000000 --- a/web-server/docker-compose.yml +++ /dev/null @@ -1,9 +0,0 @@ -services: - web-server: - build: - context: . - dockerfile: Dockerfile - volumes: - - .:/app - ports: - - '80:80' \ No newline at end of file diff --git a/web-server/main.py b/web-server/main.py index 12e283d..1ce1fc4 100644 --- a/web-server/main.py +++ b/web-server/main.py @@ -1,22 +1,7 @@ import store -from fastapi import FastAPI -from fastapi.responses import HTMLResponse - -app = FastAPI() - -@app.get('/') -def get_list(): - return [1,2,3,] - -@app.get('/contact', response_class=HTMLResponse) -def get_list(): - return """ -
soy un parrafo
- """ def run(): store.get_categories() - -if __name__ == '__main__': + +if __name__ == "__main__": run() \ No newline at end of file diff --git a/web-server/requeriments.txt b/web-server/requeriments.txt new file mode 100644 index 0000000..107cb33 --- /dev/null +++ b/web-server/requeriments.txt @@ -0,0 +1,5 @@ +certifi==2025.1.31 +charset-normalizer==3.4.1 +idna==3.10 +requests==2.32.3 +urllib3==2.3.0 diff --git a/web-server/requirements.txt b/web-server/requirements.txt deleted file mode 100644 index 1ad030e..0000000 --- a/web-server/requirements.txt +++ /dev/null @@ -1,20 +0,0 @@ -anyio==3.6.1 -certifi==2022.9.24 -charset-normalizer==2.1.1 -click==8.1.3 -fastapi==0.85.0 -h11==0.14.0 -httptools==0.5.0 -idna==3.4 -pydantic==1.10.2 -python-dotenv==0.21.0 -PyYAML==6.0 -requests==2.28.1 -sniffio==1.3.0 -starlette==0.20.4 -typing-extensions==4.4.0 -urllib3==1.26.12 -uvicorn==0.18.3 -uvloop==0.17.0 -watchfiles==0.17.0 -websockets==10.3 diff --git a/web-server/store.py b/web-server/store.py index c6d076e..23efa34 100644 --- a/web-server/store.py +++ b/web-server/store.py @@ -2,9 +2,10 @@ def get_categories(): r = requests.get('https://api.escuelajs.co/api/v1/categories') - print(r.status_code) - print(r.text) - print(type(r.text)) categories = r.json() + print(categories) + print(type(categories)) + for category in categories: - print(category['name']) \ No newline at end of file + title = category['name'] + print(title) \ No newline at end of file