Adds Physical Data Model #2 & creates doc folder
Updates README (URL's links), move docs files in new doc folder
This commit is contained in:
parent
650fc334ca
commit
92a3f2b8d7
|
@ -40,7 +40,7 @@ _La dernière version à jour de ce document est disponible sur [github](https:/
|
|||
- [Code source publié sur _Github_][4]
|
||||
- [Tableau agile][5]
|
||||
- [Modèle physique de données][6]
|
||||
- [Script de création de votre base de données][7]
|
||||
- Script de création de votre base de données
|
||||
- [Document texte expliquant la démarche][8]
|
||||
* difficultés rencontrées / solutions trouvées
|
||||
* lien _Github_
|
||||
|
@ -53,7 +53,7 @@ _La dernière version à jour de ce document est disponible sur [github](https:/
|
|||
[3]: https://fr.openfoodfacts.org/
|
||||
[4]: https://github.com/freezed/ocp5/blob/master/README.md
|
||||
[5]: https://github.com/freezed/ocp5/projects/1
|
||||
[6]: https://github.com/freezed/ocp5/blob/master/mpd.png
|
||||
[6]: https://github.com/freezed/ocp5/blob/master/doc/pdm.png
|
||||
[7]: https://github.com/freezed/ocp5/blob/master/create-db.sql
|
||||
[8]: https://github.com/freezed/ocp5/blob/master/approach.md
|
||||
[9]: https://github.com/freezed/ocp5/blob/master/documentation.md#documentation "Project documentation"
|
||||
[8]: https://github.com/freezed/ocp5/blob/master/doc/approach.md
|
||||
[9]: https://github.com/freezed/ocp5/blob/master/doc/documentation.md#documentation "Project documentation"
|
||||
|
|
|
@ -4,32 +4,28 @@ Documentation
|
|||
## Created with
|
||||
|
||||
- `python 3.6.4 `
|
||||
- ~`Requests`~ [`TODO #4`][4]
|
||||
- `Requests`
|
||||
- ~`PyMySQL` or `openfoodfacts-python`~ [`TODO #4`][4]
|
||||
|
||||
## Installation
|
||||
|
||||
1. get the code : `git clone git@github.com:freezed/ocp5.git`
|
||||
2. create a dedicated virtualenv : `python3.7 -m venv .venv; source .venv/bin/activate`
|
||||
3. ~adds dependencies : `cd ocp5; pip install -r requirement.txt`~ [TODO #4][4]
|
||||
2. create a dedicated virtualenv : `python3 -m venv .venv; source .venv/bin/activate`
|
||||
3. adds dependencies : `cd ocp5; pip install -r requirements.txt`
|
||||
|
||||
## Collects data
|
||||
|
||||
1. [OpenFoodFacts data uses more than 170 fields][92]. Here are those we keep localy :
|
||||
```
|
||||
code
|
||||
url
|
||||
last_modified_t
|
||||
product_name
|
||||
categories_fr
|
||||
purchase_places
|
||||
stores
|
||||
nutrition-score-fr_100g
|
||||
```
|
||||
2. Request will only ask for tagged products with `'countries':'france'`
|
||||
3. ~Physical Data Model~ [`TODO #2`][2]
|
||||
3. Physical Data Model
|
||||
|
||||
![-Physical Data Model-][2]
|
||||
![-Physical Data Model-][96]
|
||||
|
||||
4. ~Creates local MariaDB/MySQL : `./create-db.py`~ [`TODO #2`][2]
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -0,0 +1,55 @@
|
|||
@startuml
|
||||
|
||||
title Physical data model\n
|
||||
|
||||
/' = = = = = = = STYLE = = = = = = = '/
|
||||
hide empty methods
|
||||
hide circle
|
||||
skinparam linetype ortho
|
||||
skinparam class {
|
||||
BackgroundColor<<assoc>> lightblue
|
||||
}
|
||||
|
||||
/' = = = = = = = MACRO = = = = = = = '/
|
||||
!define rel(a,b,c,d,e) a c e
|
||||
!define pyk(n,t="MEDIUMINT NOT NULL UNSIGNED") <font color="red">PK:<b>n</b> <size:09>[t]</size></font>
|
||||
!define fnk(n,r,t="MEDIUMINT NOT NULL UNSIGNED") <font color="blue">FK:<b>n</b> <size:09>[t]</size></font>
|
||||
!define pfk(n,r,t="MEDIUMINT NOT NULL UNSIGNED") <font color="orangered">PFK:<b>n</b> <size:09>[t]</size></font>
|
||||
!define att(n,u,s) {field} <b>n</b> [s]
|
||||
|
||||
/' = = = = = = = CLASSE = = = = = = = '/
|
||||
class product
|
||||
class category
|
||||
class prod_category <<assoc>>
|
||||
|
||||
/' = = = = = = = RELATION = = = = = = = '/
|
||||
rel(product,1..,--,1..*,category)
|
||||
|
||||
/' = = = = = = = KEY = = = = = = = '/
|
||||
class product {
|
||||
pyk(id)
|
||||
..
|
||||
}
|
||||
class category {
|
||||
pyk(id)
|
||||
..
|
||||
}
|
||||
class prod_category <<assoc>> {
|
||||
pfk(category_id,category.id)
|
||||
pfk(product_id,product.id)
|
||||
..
|
||||
}
|
||||
/' = = = = = = = ATTRIBUTE = = = = = = = '/
|
||||
class product {
|
||||
att(name,String,VARCHAR(200))
|
||||
att(nutrition_grades,String,VARCHAR(1))
|
||||
}
|
||||
class category {
|
||||
att(name,String,VARCHAR(200))
|
||||
}
|
||||
|
||||
/' = = = = = = = ASSOCIATION = = = = = = = '/
|
||||
rel(product,.,--,.,prod_category)
|
||||
rel(category,.,-,.,prod_category)
|
||||
|
||||
@enduml
|
Loading…
Reference in New Issue