Simple scraper / dictionary app with an intuitive interface.
To run migrations, run:
alembic upgrade head
/api/translations/<word>
: get all the translations in all languages for a word/api/translations?q=so*
: get all english words that can be used. You can search through them by using a * operator. Or something likeq=*o*
Install all dependencies (will initiate a new virtualenvironment)
pipenv install
If any issues are encountered:
pipenv lock --pre --clear
pipenv install
To run:
FLASK_DEBUG=1 FLASK_APP="run.py" flask run --host 0.0.0.0
To run on windows (powershell):
$env:FLASK_DEBUG=1; $env:FLASK_APP="run.py"; flask run
To add a new crawler:
- in the crawlers module add a
<language>_crawler.py
file, which contains the crawler itself. - in
__init__.py
follow the example: ``
Use the crawler_cli.py
script in the root folder:
usage: crawler_cli [-h] [--crawlers CRAWLERS] name
Seed things as fast as possible using this simple tool
positional arguments:
name The name of the language
optional arguments:
-h, --help show this help message and exit
--crawlers CRAWLERS Module from where the crawlers should be loaded
To populate the DB for a language based on the seed data:
python crawler_cli.py "Romanian"
or on Windows:
python .\crawler_cli.py "Romanian"