├── .dockerignore ├── .vscode └── settings.json ├── .slugignore ├── requirements.txt ├── LICENSE ├── Dockerfile ├── .gitignore └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | README.md 2 | LICENSE 3 | docker-compose.yml -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "python.pythonPath": "/bin/python3.9" 3 | } -------------------------------------------------------------------------------- /.slugignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | *.md 3 | LICENSE 4 | .dockerignore 5 | .devcontainer 6 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | asgiref==3.3.4 3 | backcall==0.2.0 4 | black==21.5b2 5 | click==8.0.1 6 | decorator==5.0.9 7 | fastapi==0.65.1 8 | Flask==2.0.1 9 | gunicorn==20.1.0 10 | h11==0.12.0 11 | httptools==0.2.0 12 | ipykernel==5.5.5 13 | ipython==7.24.0 14 | ipython-genutils==0.2.0 15 | itsdangerous==2.0.1 16 | jedi==0.18.0 17 | Jinja2==3.0.1 18 | jupyter-client==6.1.12 19 | jupyter-core==4.7.1 20 | MarkupSafe==2.0.1 21 | matplotlib-inline==0.1.2 22 | mypy-extensions==0.4.3 23 | parso==0.8.2 24 | pathspec==0.8.1 25 | pexpect==4.8.0 26 | pickleshare==0.7.5 27 | Pillow==8.2.0 28 | prompt-toolkit==3.0.18 29 | ptyprocess==0.7.0 30 | pydantic==1.8.2 31 | Pygments==2.9.0 32 | python-dateutil==2.8.1 33 | python-dotenv==0.17.1 34 | python-multipart==0.0.5 35 | PyYAML==5.4.1 36 | pyzmq==22.1.0 37 | regex==2021.4.4 38 | six==1.16.0 39 | starlette==0.14.2 40 | toml==0.10.2 41 | tornado==6.1 42 | traitlets==5.0.5 43 | typing-extensions==3.10.0.0 44 | uvicorn==0.14.0 45 | uvloop==0.15.2 46 | watchgod==0.7 47 | wcwidth==0.2.5 48 | websockets==9.1 49 | Werkzeug==2.0.1 50 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 UberPython 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.177.0/containers/python-3/.devcontainer/base.Dockerfile 2 | 3 | # [Choice] Python version: 3, 3.9, 3.8, 3.7, 3.6 4 | ARG VARIANT="3.9" 5 | FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT} 6 | 7 | # [Option] Install Node.js 8 | #ARG INSTALL_NODE="true" 9 | #ARG NODE_VERSION="lts/*" 10 | #RUN if [ "${INSTALL_NODE}" = "true" ]; then su vscode -c "umask 0002 && . /usr/local/share/nvm/nvm.sh && nvm install ${NODE_VERSION} 2>&1"; fi 11 | 12 | # [Optional] If your pip requirements rarely change, uncomment this section to add them to the image. 13 | COPY requirements.txt /tmp/pip-tmp/ 14 | RUN pip3 --disable-pip-version-check --no-cache-dir install -r /tmp/pip-tmp/requirements.txt \ 15 | && rm -rf /tmp/pip-tmp 16 | 17 | # [Optional] Uncomment this section to install additional OS packages. 18 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 19 | # && apt-get -y install --no-install-recommends 20 | 21 | # [Optional] Uncomment this line to install global node packages. 22 | # RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g " 2>&1 23 | 24 | # Change user to vscode 25 | USER vscode:vscode 26 | 27 | # COPY * /workspaces/image-filter-api-python-flask/ 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | 132 | # Custom 133 | .devcontainer -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > For help and support open a topic in [Discussions](https://github.com/CloudBytesDotDev/web-apis-with-python/discussions) above. 2 | 3 | # Starter Kit: Web APIs with Python 4 | 5 | This is the starter kit associate with "Building Web APIs with Python" which the following version available 6 | 7 | 1. Kindle Edition: [Get it here](https://kdp.amazon.com/amazon-dp-action/us/dualbookshelf.marketplacelink/B09BJLKM6F) 8 | 9 | ## Usage Instructions 10 | 11 | This repository contains the starter kit for each exercise in a separate branch. 12 | 13 | If you are unfamiliar with Git and GitHub, please read the instructions on usage below carefully and follow the steps. 14 | 15 | ### 1. Fork to create your own copy of the repository 16 | 17 | **Step 1**: Login to [GitHub](https://github.com) and navigate to [this repository](https://github.com/CloudBytesDotDev/web-apis-with-python) 18 | 19 | ```http 20 | https://github.com/CloudBytesDotDev/web-apis-with-python 21 | ``` 22 | 23 | **Step 2**: Create a Fork of the repository by clicking on the fork button on top right side of the webpage as shown below 24 | 25 | ![image-20210604203326830](https://user-images.githubusercontent.com/4152163/120856800-f96ade80-c59d-11eb-9f8a-7a217dd98767.png) 26 | 27 | This will create a copy of the repository in your account. 28 | 29 | **Step 3**: Clone this new repository in your account. To Copy the Git URL press on the Green "Code" button and then click on the clipboard icon as shown below 30 | 31 | ![image-20210604204305086](https://user-images.githubusercontent.com/4152163/120856928-27502300-c59e-11eb-9826-eb7777efe3f2.png) 32 | 33 | Or you can run the following command from your terminal with Git installed, replacing "" with our actual GitHub username 34 | 35 | ```bash 36 | git clone https://github.com//web-apis-with-python.git 37 | ``` 38 | 39 | ### 2. Navigate to the starter kit 40 | 41 | From the terminal, run the below command to navigate to a particular branch, replace "" with the name of the branch (typically provided in the exercise) 42 | 43 | ```bash 44 | git checkout 45 | ``` 46 | 47 | The "branch-name" should match exactly to the branch specified in the exercises. 48 | 49 | You should also set the upstream (online) branch by running 50 | 51 | ```bash 52 | git push --set-upstream origin 53 | ``` 54 | 55 | ### 3. Track the changes and push it to your repository on GitHub 56 | 57 | This involves 4 steps. 58 | 59 | **Step 1**: Check the changes you have made by running 60 | 61 | ```bash 62 | git status 63 | ``` 64 | 65 | This will highlight the files that been added, deleted or changed. 66 | 67 | **Step 2**: Add the changes to the working tree 68 | 69 | ```bash 70 | git add 71 | ``` 72 | 73 | `git status` will provide you will list of files, you will need to do this with each file that has been added or changed. 74 | 75 | **Step 3**: Record and commit the changes 76 | 77 | ```bash 78 | git commit -m "" 79 | ``` 80 | 81 | **Step 4**: Push your changes to GitHub (origin) 82 | 83 | ```bash 84 | git push 85 | ``` 86 | 87 | This requires the `git push --set-upstream origin ` completed as specified in section 2 above 88 | --------------------------------------------------------------------------------