Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
dotunpeters committed Apr 17, 2020
0 parents commit 7232f0b
Show file tree
Hide file tree
Showing 10 changed files with 3,146 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2.1

orbs:
python: circleci/[email protected]

jobs:
build-and-test:
executor: python/default
steps:
- checkout
- python/load-cache
- python/install-deps
- python/save-cache
- run:
name: Run Unit run_tests
command: |
python -m pytest
workflows:
main:
jobs:
- build-and-test
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
db_details.txt
custom.py
.vs
__pycache__
.vscode
.coverage
Dockerfile
htmlcov/
.pytest_cache/
22 changes: 22 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

MIT License

Copyright (c) 2020 Oyelakin Dotun Peter

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Scrape Script
#### Scrpe data from jumia and konga

* Surf through online products from popular eCommerce site in Nigeria with ease.
* It filters away fake products.
* Gives you a super friendly user interface.
* Add products to favourite list for later buy.
* User authentication with no stress of imputing username /or password.
* easily share product via twetter
* Share products url
23 changes: 23 additions & 0 deletions db_create.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

"""
Create database table
"""

#import packages
from flask import Flask
from models import *

app = Flask(__name__)

#database configuration
app.config["SQLALCHEMY_DATABASE_URI"] = os.getenv("DATABASE_URL")
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db.init_app(app)

#create database once
try:
with app.app_context():
db.create_all()
print("Database and Tables created successfully")
except Exception as e:
print(f"Could not create database: {e}")
23 changes: 23 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

"""
Create database schema
"""

from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()


class Products(db.Model):
__tablename__ = "products"
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String, nullable=False)
sku = db.Column(db.String, nullable=False)
price = db.Column(db.String, nullable=False)
stars = db.Column(db.String, nullable=False)
link = db.Column(db.String, nullable=False)
image_url = db.Column(db.String, nullable=False)
reviews = db.Column(db.Integer, nullable=False)
seller = db.Column(db.String, nullable=False)
category = db.Column(db.String, nullable=False)
description = db.Column(db.String, nullable=False)
2,612 changes: 2,612 additions & 0 deletions products.csv

Large diffs are not rendered by default.

Binary file added requirements.txt
Binary file not shown.
Loading

0 comments on commit 7232f0b

Please sign in to comment.