├── README.md ├── phishing.pkl ├── XGBoostClassifier.pickle.dat ├── main.py ├── main.ipynb └── .github └── workflows └── python-package.yml /README.md: -------------------------------------------------------------------------------- 1 | # Phishing-Website-Detection-using-Machine-Learning -------------------------------------------------------------------------------- /phishing.pkl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BegangN/Phishing-Website-Detection-using-Machine-Learning/HEAD/phishing.pkl -------------------------------------------------------------------------------- /XGBoostClassifier.pickle.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BegangN/Phishing-Website-Detection-using-Machine-Learning/HEAD/XGBoostClassifier.pickle.dat -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import uvicorn 2 | from fastapi import FastAPI 3 | import joblib,os 4 | 5 | app = FastAPI() 6 | 7 | #pkl 8 | phish_model = open('phishing.pkl','rb') 9 | phish_model_ls = joblib.load(phish_model) 10 | 11 | # ML Aspect 12 | @app.get('/predict/{feature}') 13 | async def predict(features): 14 | X_predict = [] 15 | X_predict.append(str(features)) 16 | y_Predict = phish_model_ls.predict(X_predict) 17 | if y_Predict == 'good': 18 | result = "This is a Phishing Site" 19 | else: 20 | result = "This is not a Phishing Site" 21 | 22 | return (features, result) 23 | if __name__ == '__main__': 24 | uvicorn.run(app,host="127.0.0.1",port=8000) -------------------------------------------------------------------------------- /main.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "from fastapi import FastAPI\n", 10 | "\n", 11 | "app = FastAPI()\n", 12 | "\n", 13 | "\n", 14 | "@app.get(\"/\")\n", 15 | "async def root():\n", 16 | " return {\"message\": \"Hello World\"}" 17 | ] 18 | }, 19 | { 20 | "cell_type": "code", 21 | "execution_count": null, 22 | "metadata": {}, 23 | "outputs": [], 24 | "source": [] 25 | } 26 | ], 27 | "metadata": { 28 | "kernelspec": { 29 | "display_name": "Python 3", 30 | "language": "python", 31 | "name": "python3" 32 | }, 33 | "language_info": { 34 | "codemirror_mode": { 35 | "name": "ipython", 36 | "version": 3 37 | }, 38 | "file_extension": ".py", 39 | "mimetype": "text/x-python", 40 | "name": "python", 41 | "nbconvert_exporter": "python", 42 | "pygments_lexer": "ipython3", 43 | "version": "3.8.5" 44 | } 45 | }, 46 | "nbformat": 4, 47 | "nbformat_minor": 4 48 | } 49 | -------------------------------------------------------------------------------- /.github/workflows/python-package.yml: -------------------------------------------------------------------------------- 1 | # This workflow will install Python dependencies, run tests and lint with a variety of Python versions 2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python 3 | 4 | name: Python package 5 | 6 | on: 7 | push: 8 | branches: [ "main" ] 9 | pull_request: 10 | branches: [ "main" ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | python-version: ["3.9", "3.10", "3.11"] 20 | 21 | steps: 22 | - uses: actions/checkout@v4 23 | - name: Set up Python ${{ matrix.python-version }} 24 | uses: actions/setup-python@v3 25 | with: 26 | python-version: ${{ matrix.python-version }} 27 | - name: Install dependencies 28 | run: | 29 | python -m pip install --upgrade pip 30 | python -m pip install flake8 pytest 31 | if [ -f requirements.txt ]; then pip install -r requirements.txt; fi 32 | - name: Lint with flake8 33 | run: | 34 | # stop the build if there are Python syntax errors or undefined names 35 | flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics 36 | # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide 37 | flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics 38 | - name: Test with pytest 39 | run: | 40 | pytest 41 | --------------------------------------------------------------------------------