antares_get_data/README.md

72 lines
1.7 KiB
Markdown

<div align="center">
# Antares Data Exporter
![Octopus ERP Converter](docs/images/Octopus8.ico)
Rust utility to fetch product data from Antares B2B and export to Excel.
</div>
## Quick Start
```bash
cp .env.example .env
# Edit .env with your credentials and output path
cargo build --release
./target/release/antares_get_data
```
## Configuration
`.env` file:
```env
ANTARES_USERCODE=your_usercode
ANTARES_PASSWORD=your_password_hash
OUT=out
```
`OUT` can be:
- Directory: `out` → creates `out/antares.xlsx`
- File path: `exports/data.xlsx` → creates file there
- Must be `.xlsx` extension if file path
## How It Works
1. Load credentials from `.env`
2. Fetch product data from Antares B2B API (300s timeout)
3. Save raw JSON to `antares.json`
4. Export filtered data to Excel
5. Log all operations to `log/YYYY-MM-DD.log`
## Excel Output
8 columns with selective field mapping and row filtering:
| Column | Source |
|--------|--------|
| BESZCIKKSZAM | [cikkszam](./src/template/antares.rs#L15) (required) |
| GYCIKKSZAM | [cikkszam](./src/template/antares.rs#L15) |
| BESZCIKKNEV | [cikk_megnevezes_rovid](./src/template/antares.rs#L14) or [cikk_megnevezes](./src/template/antares.rs#L13) (required) |
| GYARTO | "EGYEB" |
| CIKKAZON | [vonalkod](./src/template/antares.rs#L26) |
| KESZLET | [szabad_keszlet](./src/template/antares.rs#L22) |
| ME | [mennyisegi_egyseg_kod](./src/template/antares.rs#L17) |
| EGYSEGAR | [netto_kisker_ar](./src/template/antares.rs#L19) or "Alap ár" [jellemzo](./src/template/antares.rs#L34) |
Rows skipped if `cikkszam` or product name missing.
## Development
```bash
cargo build
cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo test
```
## License
MIT License © 2026 Orink Hungary Kft.