Skip to content
This repository was archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
[FEATURE] Prepare for first release (#49)
Browse files Browse the repository at this point in the history
* [FEATURE] Made the page dynamic

* [LICENSE] Added License doc strings as suggested by AGPLv3 License

* predicts score

* crawler complete

* Website and crawler integrated

* SEO tags

* Cleaned query params(#57)

* Dockerfiles set up(#59)

* Improved UI

* [TEST] Added basic tests

Co-authored-by: Shreyas Raviprasad <[email protected]>
Co-authored-by: Sammith S Bharadwaj <[email protected]>
Co-authored-by: scientes <[email protected]>
Co-authored-by: Bastian <[email protected]>
Co-authored-by: Daniel <[email protected]>
Co-authored-by: SammithSB <[email protected]>

Former-commit-id: 1a95407 [formerly 4d22229 [formerly 19ef365]]
Former-commit-id: 6a8e5a2abbea36930e12b44b534ec5e6e69762d0
Former-commit-id: d045b2e
Former-commit-id: b4fe904
  • Loading branch information
roysti10 committed Jan 7, 2021
1 parent 130d150 commit 95870b1
Show file tree
Hide file tree
Showing 417 changed files with 1,969 additions and 3,429 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
- name: Lint with pylint
run: |
# stop the build if there are Python syntax errors or undefined names
pylint *.py -E
pylint app -E
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
pylint *.py --exit-zero
pylint app --exit-zero
- name: Test with pytest
run: |
pytest
149 changes: 0 additions & 149 deletions Dataset.md

This file was deleted.

15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim as compile-image

WORKDIR /app
RUN apt-get update && \
apt-get -y install gcc mono-mcs && \
rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --user -r /app/requirements.txt; rm -r /tmp

FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
COPY --from=compile-image /root/.local /root/.local
COPY ./app /app/app
COPY ./crawler /app/crawler
COPY ./scrapy.cfg /app/scrapy.cfg
ENV PYTHONPATH=/app
16 changes: 16 additions & 0 deletions Dockerfile.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

FROM python:3.8-slim as build

WORKDIR /

COPY ./requirements.txt ./requirements.txt
RUN apt-get update && \
apt-get -y install gcc mono-mcs && \
rm -rf /var/lib/apt/lists/*
RUN pip install -r requirements.txt

COPY ./app /app
COPY ./crawler /crawler
COPY ./scrapy.cfg /scrapy.cfg

ENTRYPOINT ["uvicorn", "app.main:app"]
58 changes: 26 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ In the past year or so fantasy cricket has been getting a lot of traction and wi

## Requirements

1. FastAPI
2. Uvicorn
3. sklearn
1. [FastAPI](https://fastapi.tiangolo.com/)
2. [sklearn](https://scikit-learn.org/stable/)
3. [pycricbuzz](https://github.com/codophobia/pycricbuzz)
4. [scrapy](https://docs.scrapy.org/en/latest/)

Install using </br>
```bash
Expand All @@ -28,38 +29,23 @@ cd Best11-Fantasycricket

3. Run the model :

`uvicorn main:app --reload`
`uvicorn app.main:app`

5. Open http://127.0.0.1:8000/ and voila!!
5. `Open http://localhost:8000/` and voila!!

## How do you verify your model??
### Docker

We use six matches from the World Cup 2019 for our verification as of now,namely
1. Follow the steps:
```bash
docker build -t best11fantasycricket:latest "."
```

* England vs Australia League Stage
* England vs Australia SemiFinal
* India vs New Zealand SemiFinal
* India vs Australia
* India vs Bangladesh QuarterFinal
* England vs India
```bash
docker-compose up
```

During the ICC World Cup the winners of the fantasy cricket league was shown and their respective scores were also showed.
</br>We use those scores to match our models score.
2. Visit `http://localhost:8080/`

We predict the team and calculate the dream 11 score of each player for that match and match it with the winning score and calculate loss.
</br>

To check how our model worked in our test data run :

```bash
python3 fantasy_cricket/check.py

```
## Dataset

Confused by the dataset, Dont Worry I would be too if I were you, dont worry I'll walk you through it in detail

Check out [Dataset.md](https://github.com/lucasace/Best11-Fantasycricket/blob/master/Dataset.md) to understand the dataset, the scoring system and any other doubts you might have

## How do I contribute to this project????

Expand All @@ -71,11 +57,19 @@ If you have any questions regarding our project , you can contact any of the mai

## Thank You

Project made by: Royston([lucasace](https://github.com/lucasace)),Shreyas ([SRP457](https://github.com/SRP457)), Sammith([SammithSB](https://github.com/SammithSB))</br>
### Maintainers

1. [Royston](https://github.com/lucasace)

2. [Shreyas](https://github.com/SRP457)

3. [Sammith](https://github.com/SammithSB)</br>

### Acknowledgements

Special thanks to [scientes](https://github.com/scientes) for setting up the webcrawler
1. Special thanks to [scientes](https://github.com/scientes) for setting up the basic webcrawler

We would like to thank [Howstat](http://www.howstat.com/cricket/home.asp) for their amazing website with daily updates and availabilty to scrape
2. We would like to thank [Howstat](http://www.howstat.com/cricket/home.asp) for their amazing website with daily updates and availabilty to scrape

If you liked our project we would really appreciate you starring this repo.

Expand Down
22 changes: 22 additions & 0 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""
Module which runs the web server for the project
Copyright (C) 2020 Royston E Tauro & Sammith S Bharadwaj & Shreyas Raviprasad
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""

import sys

sys.path.insert(1, "..")
20 changes: 20 additions & 0 deletions app/fantasy_cricket/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
"""
Module to set path of files in the directory
Copyright (C) 2020 Royston E Tauro & Sammith S Bharadwaj & Shreyas Raviprasad
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
import sys

sys.path.insert(1, "fantasy_cricket/")
Loading

0 comments on commit 95870b1

Please sign in to comment.