Compare commits
15 Commits
BIN
.gitea/readme/icon.png
Normal file
BIN
.gitea/readme/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -5,13 +5,15 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "dev"
|
- "dev"
|
||||||
paths:
|
paths:
|
||||||
- "cdl_downloader**"
|
- "src**"
|
||||||
|
- "requirements.txt"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "dev"
|
- "dev"
|
||||||
- "main"
|
- "main"
|
||||||
paths:
|
paths:
|
||||||
- "cdl_downloader**"
|
- "src**"
|
||||||
|
- "requirements.txt"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
@@ -26,7 +28,7 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r cdl_downloader/requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pylint
|
pip install pylint
|
||||||
- name: Analysing the code with pylint
|
- name: Analysing the code with pylint
|
||||||
run: pylint --exit-zero $(git ls-files 'cdl_downloader/*.py')
|
run: pylint --exit-zero $(git ls-files 'src/*.py')
|
||||||
@@ -5,7 +5,8 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
paths:
|
paths:
|
||||||
- "cdl_downloader**"
|
- "src**"
|
||||||
|
- "requirements.txt"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
analyze:
|
analyze:
|
||||||
@@ -20,10 +21,10 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install -r cdl_downloader/requirements.txt
|
pip install -r requirements.txt
|
||||||
pip install pylint
|
pip install pylint
|
||||||
- name: Analysing the code with pylint
|
- name: Analysing the code with pylint
|
||||||
run: pylint --exit-zero $(git ls-files 'cdl_downloader/*.py')
|
run: pylint --exit-zero $(git ls-files 'src/*.py')
|
||||||
publish:
|
publish:
|
||||||
name: Publish script
|
name: Publish script
|
||||||
needs: analyze
|
needs: analyze
|
||||||
@@ -45,18 +46,24 @@ jobs:
|
|||||||
id: gitversion
|
id: gitversion
|
||||||
with:
|
with:
|
||||||
configFilePath: ./.gitea/config/gitversion.yml
|
configFilePath: ./.gitea/config/gitversion.yml
|
||||||
|
- name: Create package root directory
|
||||||
|
run: |
|
||||||
|
mkdir package
|
||||||
|
mkdir package/cdl_downloader
|
||||||
|
cp -r src/* package/cdl_downloader/
|
||||||
|
cp requirements.txt package/requirements.txt
|
||||||
- name: Create .TAR.GZ archive
|
- name: Create .TAR.GZ archive
|
||||||
uses: ksm2/archive-action@v1
|
uses: ksm2/archive-action@v1
|
||||||
with:
|
with:
|
||||||
format: "tar.gz"
|
format: "tar.gz"
|
||||||
name: cdl_downloader_${{steps.gitversion.outputs.SemVer}}
|
name: cdl_downloader_${{steps.gitversion.outputs.SemVer}}
|
||||||
include: "./cdl_downloader"
|
root-directory: "package"
|
||||||
- name: Create .ZIP archive
|
- name: Create .ZIP archive
|
||||||
uses: ksm2/archive-action@v1
|
uses: ksm2/archive-action@v1
|
||||||
with:
|
with:
|
||||||
format: "zip"
|
format: "zip"
|
||||||
name: cdl_downloader_${{steps.gitversion.outputs.SemVer}}
|
name: cdl_downloader_${{steps.gitversion.outputs.SemVer}}
|
||||||
include: "./cdl_downloader"
|
root-directory: "package"
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2026 mateuszskoczek
|
Copyright (c) 2026 Mateusz Skoczek
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||||
|
|||||||
28
README.md
28
README.md
@@ -1,3 +1,5 @@
|
|||||||
|
<p align="center"><img src=".gitea/readme/icon.png"/></p>
|
||||||
|
|
||||||
<h1 align="center">CDL Downloader</h1>
|
<h1 align="center">CDL Downloader</h1>
|
||||||
|
|
||||||
<h3 align="center"><b>Automation script for downloading medical test results files from <a href="ewyniki.cdl.pl">ewyniki.cdl.pl</a></b></h3>
|
<h3 align="center"><b>Automation script for downloading medical test results files from <a href="ewyniki.cdl.pl">ewyniki.cdl.pl</a></b></h3>
|
||||||
@@ -8,12 +10,18 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
|
- Download medical test results files from <a href="ewyniki.cdl.pl">ewyniki.cdl.pl</a> automatically.
|
||||||
- Headless mode - can be used entirely without graphical interface
|
- Headless mode - can be used entirely without graphical interface
|
||||||
- Returns basic information after download - script returns basic data in JSON format, such as failure/success status and tests results as html table
|
- Return basic information after download in JSON format, such as failure/success status and tests results as html table
|
||||||
|
|
||||||
## Requirements
|
## Installation
|
||||||
|
|
||||||
|
Download latest package version from <a href="https://repos.mateuszskoczek.com/MateuszSkoczek/CDLDownloader/releases">Releases</a> tab, unpack, install requirements and you good to go
|
||||||
|
|
||||||
|
**Requirements**
|
||||||
|
|
||||||
- Chrome Driver installed
|
- Chrome Driver installed
|
||||||
|
- Python installed
|
||||||
- PIP packages:
|
- PIP packages:
|
||||||
- `selenium`
|
- `selenium`
|
||||||
- `webdriver-manager`
|
- `webdriver-manager`
|
||||||
@@ -22,13 +30,13 @@
|
|||||||
You can also use `requirements.txt` file to install PIP dependencies
|
You can also use `requirements.txt` file to install PIP dependencies
|
||||||
|
|
||||||
```
|
```
|
||||||
pip install -r cdl_downloader/requirements.txt
|
pip install -r requirements.txt
|
||||||
```
|
```
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```
|
```
|
||||||
python cdl_downloader <pesel> <barcode>
|
python cdl_downloader <pesel> <barcode> [additional_options]
|
||||||
```
|
```
|
||||||
|
|
||||||
**Additional options:**
|
**Additional options:**
|
||||||
@@ -62,8 +70,18 @@ In case of success:
|
|||||||
{
|
{
|
||||||
"success": true,
|
"success": true,
|
||||||
"id": "e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0",
|
"id": "e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0",
|
||||||
"fileName": "/mnt/example/download_dir/e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0/TEST_FILE.pdf",
|
"fileName": "TEST_FILE.pdf",
|
||||||
"formattedDate": "2026.01.31",
|
"formattedDate": "2026.01.31",
|
||||||
"resultTableHTML": "<table>...</table>"
|
"resultTableHTML": "<table>...</table>"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
With `--path /mnt/example/download_dir/` file will be saved as `/mnt/example/download_dir/e1ce9235-9c36-4b7a-b245-e2f1c3d3b1c0/TEST_FILE.pdf`
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
You can copy this repository and create your own version of the app freely. However, it would be nice if you included URL to this repository in the description to your repository or in README file.
|
||||||
|
|
||||||
|
**Other sources:**
|
||||||
|
|
||||||
|
- Icon by <a href="icons8.com">Icons8</a>
|
||||||
@@ -37,6 +37,7 @@ options.add_experimental_option("prefs", {"download.default_directory": director
|
|||||||
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
|
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=options)
|
||||||
driver.get("https://ewyniki.cdl.pl/kl322-n/index.php?page=logowanie&barcodeLogin=true")
|
driver.get("https://ewyniki.cdl.pl/kl322-n/index.php?page=logowanie&barcodeLogin=true")
|
||||||
|
|
||||||
|
|
||||||
def click(element):
|
def click(element):
|
||||||
driver.execute_script("arguments[0].click();", element)
|
driver.execute_script("arguments[0].click();", element)
|
||||||
|
|
||||||
Reference in New Issue
Block a user