https://github.com/setlog/iata-hackathon-2025
https://github.com/setlog/iata-hackathon-2025
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/setlog/iata-hackathon-2025
- Owner: setlog
- Created: 2025-02-24T16:25:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-24T19:24:34.000Z (over 1 year ago)
- Last Synced: 2025-02-24T20:20:34.992Z (over 1 year ago)
- Language: Go
- Size: 76.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HAWB to IATA One Record Converter
This Golang project parses unstructured HAWB documents in PDF format and converts extracted data into the [IATA One Record API](https://www.iata.org/en/programs/cargo/one-record/) using [Vertex AI](https://cloud.google.com/vertex-ai) as an LLM.
## Prerequisites
1. **Golang**: Ensure that [Go](https://go.dev/doc/install) is installed on your system.
2. **Google Cloud Account**: The project uses Google Cloud services such as Vertex AI and Cloud Storage.
3. **.env File**: Create a `.env` file with the required configuration values.
## Configuration
Create a `.env` file in the root directory of the project with the following content:
```ini
GOOGLE_APPLICATION_CREDENTIALS=
GCLOUD_PROJECT_ID=
GCLOUD_LOCATION=
GCLOUD_BUCKETNAME=
AI_MODEL=
```
## Installation
1. Clone this repository:
```bash
git clone https://github.com/setlog/iata-hackathon-2025.git
cd iata-hackathon-2025
```
2. Install dependencies:
```bash
go mod tidy
```
## Running the Application
Start the service using the following command:
```bash
go run -o iata-hackathon-2025 .
```
## API Endpoints
The application provides the following REST API endpoints:
### 1. PDF Analysis
- `GET /hwbreportanalysis/all`
- Description: Parses all PDF documents (HAWBs) stored in the Google Cloud Storage bucket GCLOUD_BUCKETNAME and returns the output in JSON format.
- `GET /hwbreportanalysis?fileName=`
- Description: Parses the specified PDF document from the bucket GCLOUD_BUCKETNAME and returns the output in JSON format.
### 2. Convert JSON to IATA One Record API
- `GET /json2iata/all`
- Description: Converts all generated JSON data into IATA format and uploads it to the One Record Server via API.
- `POST /json2iata`
- Description: Converts a single HAWB JSON into IATA format and uploads it to the One Record Server via API.
- Request Body: JSON containing the data to be converted.
## Contact
For any questions or issues, please contact the project maintainer or create an Issue.