From RapNet to Excel: Automating Diamond Listing Exports Using Python

satya bollojusatya bolloju
3 min read
# From RapNet to Excel: Automating Diamond Listing Exports Using Python

πŸ“Œ **Problem**: We were manually filtering, copying, and structuring diamond listing data from RapNet across multiple size, color, and clarity combinations β€” wasting hours every week.

πŸ’‘ **Solution**: I built a Python automation tool that connects to the RapNet API, applies dynamic filters, and exports clean Excel files for each filter combo.

This blog breaks down the tech behind the tool, how it works, and why it’s now a core part of our internal process.

---

## πŸš€ What This Tool Does

- Connects to RapNet's API using secure token authentication
- Applies custom filters: saved search ID, size, color, clarity
- Parses JSON responses into structured datasets
- Outputs multi-sheet Excel files β€” each sheet represents a unique combination

---

## 🧠 Architecture Overview

```plaintext
+----------------------+       +----------------------+
|  market_input.txt    | ----> |  Filter Controller   |
|  (config file)       |       |  (Python logic)      |
+----------------------+       +----------------------+
                                     |
                             Fetch Saved Searches
                                     ↓
                          Apply filters: Size, Color, Clarity
                                     ↓
                          Fetch Listings from RapNet API
                                     ↓
                           Extract, transform, and structure
                                     ↓
                        Export Excel using pandas + openpyxl

πŸ› οΈ Tech Stack

ToolPurpose
PythonCore automation logic
requestsAPI integration
jpropertiesLoad .txt config as properties
pandasData manipulation
openpyxlExcel file export and formatting

πŸ§ͺ Sample Config Input (market_input_sample.txt)

load_saved_search = EMERALD LG (GD)
size_range = 1.50:1.69
colors = D,E,F,G,H,I,J,K,L,M
clarities = IF,VVS1,VVS2,VS1,VS2,SI1,SI2
token = YOUR_API_TOKEN_HERE

⚠️ token must be kept private β€” never commit this file to GitHub. Use .gitignore.


πŸ“‚ Sample Output

Each Excel file is named using the filter set and timestamp, e.g.:

EMERALD_1.50_1.69_2025-04-24_14-22-01.xlsx

Each sheet in the file contains:

  • Diamond attributes (cut, polish, symmetry, color, clarity, lab comment)

  • Tabular listing data with prices, sizes, and measurements


πŸ’‘ Technical Highlights

  • Handled nested JSON structures with extract_nested_data()

  • Modularized filter building, separating saved search logic from the fetcher

  • Exported Excel files with multiple dynamic sheets, mapped using filter keys

  • Implemented fallback logic for key errors and empty payloads


πŸ“¦ Real-World Value

  • βœ… Saved 8–10 hours/week in manual searching and formatting

  • βœ… Enabled batch downloads of listings with multiple filter sets

  • βœ… Provided reusable, config-driven scripts for other team members


πŸ”— Live Project


πŸ”„ Next Steps

  • Convert the script into a Streamlit UI

  • Add logging & error reporting via logging

  • Integrate with email service for automated weekly reports


πŸ‘¨β€πŸ’» About Me

I’m a Data Analyst at Sheetal Manufacturing Co.
Currently pursuing MSc in Data Science from Symbiosis.
I enjoy automating real-world workflows with clean, scalable Python code.

πŸ”— Connect with me on LinkedIn


πŸ™Œ Let’s Collaborate

If you liked this, feel free to:

  • Fork the repo

  • Suggest improvements

  • Drop a comment β€” I’d love to connect with fellow automation nerds πŸ˜„

#Python #API #Automation #Excel #DataEngineering #RapNet #PortfolioProject

0
Subscribe to my newsletter

Read articles from satya bolloju directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

satya bolloju
satya bolloju