Snapshot Converter Service
Overview
snapshot_converter_service
service utilizes the snapshot_converter
Python library,
designed for converting snapshot documents into various formats such as CSV, JSON, Excel, and ODD (Open Document Format).
The service leverages aiohttp for handling HTTP and WebSocket connections, providing real-time updates on the conversion process.
For more details about snapshot_converter
, please refer to the documentation of Snapshot Converter Package.
Installation
Install the required dependencies using pip along with the FURY_AUTH authentication token:
FURY_AUTH=${FURY_AUTH} pip install -r requirements.txt
Running the Service Locally
Launching the Server:
python server.py
Monitoring Service Progress via WebSocket [Optional]
- Set the request type to
WebSocket
- Enter the WebSocket URL:
ws://localhost:8000/snapshot-converter/ws
- Click
Connect
Uploading a Snapshot File to Process To upload a snapshot file for processing, follow these steps:
- Open Postman
- Set the request type to
http
- Set the method to
POST
- Use the URL: http://localhost:8000/snapshot-converter
- Add the necessary query parameters (optional)
- outputFormat: The desired output format (csv, json, xlsx, odd) (default: csv)
- preferableSpreads: Comma-separated list of preferred spreads to include (optional)
- includeTRS: Include text representations (default: true)
- includePythonNames: Include Python names for each field (default: true)
- includeSpreadValuesParsed: Include parsed spread values (default: true)
- includeSpreadValuesRaw: Include raw spread values (default: true)
- includeGroupName: Include group name for each field (default: true)
- includeGroupID: Include group IDs for each field (default: true)
- includeTagCoordinates: Include coordinates information (default: true)
- includeMatchingTableIndex: Include matching table index (default: true)
- includeCellLocationInTable: Include cell location in table (default: true)
- includePage: Include page number (default: true)
- nProcesses: Number of processes for multiprocessing (default: 10)
- Add a key with the type
File
and name itfile
- Select the ZIP file from your computer that you wish to upload
- Click Send to upload the snapshot and start the Snapshot Conversion process
Viewing the Output:
-
Response Format: The response will appear in
CSV
,JSON
,XLSX
,ODD
formats that you can download. -
WebSocket Updates: If connected via WebSocket, you'll receive real-time updates on the process of creating Converted Snapshot.