-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from krflorian/feature/stackoverflow
Feature/stackoverflow
- Loading branch information
Showing
22 changed files
with
228,906 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ description = "rest service for mtg data" | |
authors = ["dataflo <[email protected]>"] | ||
license = "mit" | ||
readme = "README.md" | ||
packages = [{ include = "src" }] | ||
packages = [{ from = "src", include = "*" }] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
@@ -16,6 +16,7 @@ fastapi = "^0.105.0" | |
matplotlib = "^3.8.2" | ||
wikipedia = "^1.4.0" | ||
ipykernel = "^6.29.2" | ||
stackapi = "^0.3.0" | ||
|
||
|
||
[tool.poetry.group.dev.dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +0,0 @@ | ||
from .extract_rulesguru import RulesGuru | ||
from .extract_rules import Rules | ||
from .load import RulesDB | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# %% | ||
from src.etl.extractors import ( | ||
RulesGuruExtractor, | ||
ComprehensiveRulesExtractor, | ||
StackExchangeExtractor, | ||
WikipediaExtractor, | ||
) | ||
from src.etl.loaders import DocumentLoader | ||
from pathlib import Path | ||
import logging | ||
|
||
|
||
logging.basicConfig( | ||
level=logging.INFO, | ||
format="%(asctime)s [%(levelname)s] %(message)s", | ||
) | ||
|
||
# %% | ||
# setup extractors | ||
DATA_RAW = Path("../data/etl/raw/documents") | ||
DATA_PROCESSED = Path("../data/etl/processed/documents") | ||
|
||
rules_guru = RulesGuruExtractor( | ||
path_data_raw=DATA_RAW / "rulesguru.json", | ||
path_data_processed=DATA_PROCESSED / "rulesguru.json", | ||
) | ||
comprehensive_rules = ComprehensiveRulesExtractor( | ||
path_data_raw=DATA_RAW / "comprehensive_rules.txt", | ||
path_data_processed=DATA_PROCESSED / "comprehensive_rules.json", | ||
) | ||
|
||
stack_exchange = StackExchangeExtractor( | ||
path_data_raw=DATA_RAW / "stackexchange.json", | ||
path_data_processed=DATA_PROCESSED / "stackexchange.json", | ||
) | ||
|
||
wikipedia = WikipediaExtractor( | ||
path_data_raw=DATA_RAW / "wikipedia.txt", | ||
path_data_processed=DATA_PROCESSED / "wikipedia.json", | ||
) | ||
|
||
|
||
extractors = [rules_guru, comprehensive_rules, stack_exchange, wikipedia] | ||
|
||
# extractors = [rules_guru] | ||
|
||
# %% | ||
# fire extractors | ||
|
||
for extractor in extractors: | ||
extractor.get_data_raw() | ||
extractor.get_data_processed() | ||
|
||
|
||
# %% | ||
# setup rules db | ||
|
||
rules_db = DocumentLoader( | ||
path_data_processed=DATA_PROCESSED, | ||
path_database=Path("../data/artifacts/rules_db_gte.p"), | ||
) | ||
rules_db.load_data() | ||
|
||
# %% |
Oops, something went wrong.