This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| services: | |
| server: | |
| depends_on: | |
| - "mongodb" | |
| build: . | |
| ports: | |
| - "3030:3030" | |
| volumes: | |
| - .:/usr/src/app | |
| command: air ./cmd/main.go -b 0.0.0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # syntax=docker/dockerfile:1 | |
| # Comments are provided throughout this file to help you get started. | |
| # If you need more help, visit the Dockerfile reference guide at | |
| # https://docs.docker.com/engine/reference/builder/ | |
| ################################################################################ | |
| # Create a stage for building the application. | |
| ARG GO_VERSION=1.22.0 | |
| FROM golang:${GO_VERSION} AS build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from pathlib import Path | |
| from urllib.parse import urlparse | |
| from bs4 import BeautifulSoup | |
| MAIN_LINK = 'https://datos.cdmx.gob.mx/dataset/afluencia-diaria-de-metrobus-cdmx' | |
| def download_data(link_path: str = "www.google.com", i: int = 0) -> str: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bs4 import BeautifulSoup | |
| from urllib.parse import urlparse | |
| import requests | |
| from pathlib import Path | |
| import json | |
| main_link = 'https://datos.cdmx.gob.mx/dataset/inmuebles-catalogados' | |
| r = requests.get(main_link) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This is a basic workflow to help you implement flake8, tool that will help you to | |
| # check your code base against coding style (PEP8), programming errors | |
| # (like “library imported but unused” and “Undefined name”) and to check cyclomatic complexity. | |
| name: flake8 Lint | |
| # Controls when the workflow will run | |
| on: | |
| # Triggers the workflow on push or pull request events but only for the main branch | |
| push: | |
| branches: [ docker ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3" | |
| services: | |
| api: | |
| build: ./ | |
| image: myimage | |
| command: uvicorn main:app --reload --workers 1 --host 0.0.0.0 --port 8000 | |
| ports: | |
| - 8000:8000 | |
| networks: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM python:3.8 | |
| WORKDIR /app | |
| COPY requirements.txt ./ | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| EXPOSE 8000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| from typing import Optional | |
| from fastapi import FastAPI | |
| logging.basicConfig(filename='api_logs.log', level=logging.DEBUG, | |
| format='%(asctime)s:%(name)s:%(module)s:%(levelname)s:%(message)s') | |
| app = FastAPI() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """This module's docstring summary line. | |
| This is a multi-line docstring. Paragraphs are separated with blank lines. | |
| Lines conform to 79-column limit. | |
| Module and packages names should be short, lower_case_with_underscores. | |
| Notice that this in not PEP8-cheatsheet.py |