From RapNet to Excel: Automating Diamond Listing Exports Using Python

# 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
Tool | Purpose |
Python | Core automation logic |
requests | API integration |
jproperties | Load .txt config as properties |
pandas | Data manipulation |
openpyxl | Excel 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
GitHub: RapNet Diamond Exporter
Medium Blog: How I Automated Diamond Data Extraction from RapNet Using Python and Excel
π 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:
Suggest improvements
Drop a comment β Iβd love to connect with fellow automation nerds π
#Python #API #Automation #Excel #DataEngineering #RapNet #PortfolioProject
Subscribe to my newsletter
Read articles from satya bolloju directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
