https://github.com/sir-go/rkn-revizor-reports
rkn-revizor reports maker
https://github.com/sir-go/rkn-revizor-reports
captcha-solving docker python scraping without-api
Last synced: 10 days ago
JSON representation
rkn-revizor reports maker
- Host: GitHub
- URL: https://github.com/sir-go/rkn-revizor-reports
- Owner: sir-go
- License: mit
- Created: 2022-10-22T06:46:43.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-06T07:46:18.000Z (over 2 years ago)
- Last Synced: 2025-05-15T17:09:54.519Z (10 days ago)
- Topics: captcha-solving, docker, python, scraping, without-api
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://github.com/sir-go/rkn-revizor-reports/actions/workflows/python-app.yml)
# RKN reports getting automation
## What this script does:
- login to "revizor" portal
- resolve a captcha
- request a report
- wait for it
- get the report files
- check it for a "bad" content## Install
### to Virtualenv
> Note: For captcha resolving uses Tesseract OCR ([Installation](https://tesseract-ocr.github.io/tessdoc/Installation.html))```bash
virtualenv venv
source ./venv/bin/activate
pip install -r requirements.txt
```### or build a Docker image
| build-arg | meaning | default |
|-----------|-------------------|----------|
| UID | running user ID | 1000 |
| GID | running group ID | 1000 |
| OUT | report saving dir | /app/out |```bash
docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) . -t rkn-reports
```### Config
Env variables| variable | meaning |
|-------------------|----------------------------------------|
| RKN_REP_URL | report portal host |
| RKN_REP_WAIT | how long to wait for report generation |
| RKN_REP_EMAIL | report portal account email |
| RKN_REP_PASSWORD | report portal account password |
| RKN_REP_YESTERDAY | make the report for yesterday's date |
| RKN_REP_OUT | where to store unpacked report |### Test
```bash
python -m pytest
```### Run
#### Standalone
```bash
python check_revizor.py
```#### or Docker container (variables are in the `.env` file here)
```bash
docker run --rm -it --env-file .env -v ${PWD}/out:/app/out rkn-reports
```