Skip to content

Latest commit

 

History

History
102 lines (80 loc) · 2.25 KB

File metadata and controls

102 lines (80 loc) · 2.25 KB

project #2: Using Python Basics for Market Analysis

Goals:

Ultimately, our goal will be to track book prices at Book To Scrape, an online bookstore .

version: 1.7.2

Summary

Install

Use

Todo

Changelog


Install

This setup is for a development environment.

Prerequisite:

  • >= python3,9

Through a terminal(Debian linux) or Powershell(Windows) :

Position yourself in the local directory in which you want to position the sources of the application

 cd [path_to_source_directory]
  • Clone the repository via the clone command in ssh mode ssh, via la commande suivante
 git clone git@github.com:DelphinePythonique/projet2.git
  • Position yourself in the project directory, create a virtual environment
 cd projet2
 python -m venv env
  • Activate virtual environment

    If OS is Debian Linux:

 source env/bin/activate

If OS is Windows:

 .\env\Scripts\activate
  • Install the python packages useful for the script
 pip install -r requirements.txt 

Uses

Extract book's datas

Enter the following command

 python main.py --url=[book's url] --impact=book

Add option --csv to generate a csv file in the data directory

 python main.py --url=[book's url] --impact=book --csv

Extract a category's books's data

Enter the following command

 python main.py --url=[category's url] --impact=cat

Add option --csv to generate a csv file in the data directory

 python main.py --url=[category's url] --impact=cat --csv

Extraction all books's datas

Enter the following command

 python main.py --all

Add option --csv to generate a csv file in the data directory per category

 python main.py --all --csv

Download et save book's image in data/images directory

Before to execute this command, you must ensure to have download csv files; indeed, this command is based on the images's urls present in the files. Enter the following command

 python main.py --images

File's format is [book's upc].jpg