-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- .idea ! yield super-category due to some goods have no category, only a super-category + readme + examples ! requirements + notifications via knockknock ! moved all os variables to constants ! expanded constants to os variables + Dockerfile + docker image deploy script + crontab ! optimization ! refactoring
- Loading branch information
Showing
31 changed files
with
845 additions
and
757 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*logs/ | ||
venv/ | ||
.idea/ | ||
__pycache__ | ||
.env | ||
.idea |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
======= | ||
Credits | ||
======= | ||
|
||
Developer | ||
--------- | ||
|
||
* Alexey Rubasheff <[email protected]> | ||
|
||
Contributors | ||
------------ | ||
|
||
None yet. Why not be the first? |
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,28 @@ | ||
FROM python | ||
MAINTAINER ALERT <[email protected]> | ||
|
||
RUN apt-get update && apt-get -y install cron vim | ||
|
||
WORKDIR /app | ||
|
||
COPY rozetka/requirements/requirements.txt /app/ | ||
RUN pip install --user --progress-bar=off -U pip setuptools wheel && pip install --user --progress-bar=off -r /app/requirements.txt | ||
|
||
COPY crontab /etc/cron.d/crontab | ||
RUN chmod 0644 /etc/cron.d/crontab | ||
|
||
COPY entrypoint.sh /app/ | ||
RUN chmod +x /app/entrypoint.sh | ||
|
||
COPY rozetka /app/rozetka/ | ||
|
||
RUN /usr/bin/crontab /etc/cron.d/crontab | ||
|
||
ENV PYTHONIOENCODING=utf-8 | ||
ENV LC_ALL=en_US.UTF-8 | ||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US.UTF-8 | ||
|
||
# run crond as main process of container | ||
# CMD ["cron", "-f"] | ||
CMD ["/app/entrypoint.sh"] |
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,8 @@ | ||
======= | ||
History | ||
======= | ||
|
||
0.1.0 (2022-09-03) | ||
------------------ | ||
|
||
* First release |
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,12 +1,9 @@ | ||
Rozetka.ua Python API | ||
--------------------- | ||
|
||
Usage | ||
^^^^^ | ||
Examples | ||
^^^^^^^^ | ||
|
||
.. code:: py | ||
rozetka/examples/example_item.py | ||
|
||
from rozetka.entities.grid import Grid | ||
grid = Grid.get('(your filter url)') | ||
print(f"Parsed {len(grid.parsed_cells)} cells") | ||
print(f"Cheapest one: {grid.cheapest_cell}") | ||
rozetka/examples/example_category.py |
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,2 @@ | ||
0 1,12 * * * /entrypoint.sh > /proc/1/fd/1 2>/proc/1/fd/2 | ||
# * * * * * /entrypoint.sh > /proc/1/fd/1 2>/proc/1/fd/2 |
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,16 @@ | ||
@echo off | ||
set REGISTRY_IP=192.168.1.3 | ||
set REGISTRY_PORT=5001 | ||
set IMAGE_NAME=rozetka | ||
set IMAGE_TAG=latest | ||
set BUILD_TAG=%REGISTRY_IP%:%REGISTRY_PORT%/%IMAGE_NAME%:%IMAGE_TAG% | ||
set BUILD_PATH=. | ||
|
||
set "_DOCKER=docker" | ||
@REM set "_DOCKER=C:\Program Files\Docker\Docker\resources\bin\docker.exe" | ||
|
||
pushd %~dp0 | ||
@REM net start com.docker.service || exit /b | ||
"%_DOCKER%" build -t %BUILD_TAG% %BUILD_PATH% || exit /b | ||
"%_DOCKER%" push %REGISTRY_IP%:%REGISTRY_PORT%/%IMAGE_NAME% || exit /b | ||
@REM net stop com.docker.service || exit /b |
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,6 @@ | ||
#!/bin/bash | ||
echo "start rozetka @ $(pwd)" | ||
python -c "from rozetka.runners.parse_api import main; main()" | ||
echo "done rozetka" | ||
# crontab -f | ||
# echo "rozetka cron done" |
Oops, something went wrong.