Project Overview
Extract comprehensive service data from the UK Digital Marketplace website with lot-aware classification that detects service types and extracts appropriate sections.
What is the Digital Marketplace?
The UK Digital Marketplace is the government's official procurement platform for digital services, connecting public sector buyers with suppliers of cloud technology and specialist support.
G-Cloud 14 Framework
This extractor currently focuses on services from G-Cloud 14, the latest iteration of the government's cloud services framework. G-Cloud 14 organises services into three main categories:
- Lot 1: Cloud Hosting - Infrastructure and hosting services
- Lot 2: Cloud Software - Software applications and SaaS solutions
- Lot 3: Cloud Support - Consultancy, training, and implementation services
Quick Facts
- Official UK government platform
- 44,448+ services available
- ยฃ1+ billion annual spend
- Serving central government, local authorities, NHS, and education sector
- Transparent pricing and terms
Key Features
๐ง Lot-Aware Extraction
Automatically detects service types (cloud-support, cloud-software, cloud-hosting) and extracts appropriate sections with 100% accuracy.
๐ท๏ธ Hierarchical Category Detection
API-based classification with complete taxonomy paths (e.g., "Cloud software > CRM > forms and surveys") into 18+ main categories and 280+ subcategories.
๐ค Intelligent Keyword Extraction
Weighted field analysis with frequency-based ranking, semantic categorization, and configurable source fields for content analysis.
๐ Comprehensive Data Coverage
Extracts 100+ data fields including common sections, lot-specific content, pricing, documents, and contact information.
๐ฏ Precise Extraction Methods
Uses reliable web scraping techniques with multiple backup methods to ensure consistent data extraction from any service page.
๐ Document Download
Automatically downloads and classifies pricing, service definition, terms & conditions, and skills framework documents.
๐ Search Functionality
Search marketplace services with filtering, pagination, and bulk extraction capabilities.
๐ก๏ธ Production Ready
Comprehensive error handling, rate limiting, validation, and a complete test suite with 100% reliability.
Lot-Aware Classification
The library automatically detects and classifies services into three lot types based on analysis of 44,448 marketplace services:
Lot 3: Cloud Support Services
62.7% of marketplace (27,848 services)
Consultancy, training, and implementation services
Extracted sections:
- Planning (implementation planning)
- Training (knowledge transfer & delivery)
- Setup and migration (service setup)
- Quality assurance and performance testing
- Security testing (validation & compliance)
- Ongoing support (maintenance & helpdesk)
- Plus universal sections (service scope, pricing, contact)
Lot 2: Cloud Software Services
29.1% of marketplace (12,928 services)
SaaS applications and software solutions
Extracted sections:
- Onboarding and offboarding (user lifecycle)
- Service usage (guidelines & best practices)
- Scaling (capacity management & elasticity)
- Analytics (reporting & metrics)
- Enhanced security framework (8 detailed sections)
- Data import and export (data management)
- Public sector networks (PSN connectivity)
- Plus universal sections (standards, certifications, social value)
Lot 1: Cloud Hosting Services
8.3% of marketplace (3,672 services)
Infrastructure, hosting, and cloud services
Extracted sections:
- Universal sections (service scope, user support, staff security)
- Standards and certifications (compliance frameworks)
- Social value (community impact & commitments)
- Pricing (structured cost information)
- Framework details (G-Cloud compliance)
- Contact information (supplier details)
- Service documents (terms, pricing docs, service definitions)
Installation
Installation methods
Install from GitHub Release (Recommended)
# Install from specific release tag
pip install git+https://github.com/tractorjuice/marketplace-data-extractor.git@v0.6.0
# Or download and install wheel directly
wget https://github.com/tractorjuice/marketplace-data-extractor/releases/download/v0.6.0/marketplace_data_extractor-0.6.0-py3-none-any.whl
pip install marketplace_data_extractor-0.6.0-py3-none-any.whl
Benefits: Stable, tested version with guaranteed compatibility and full release notes.
pip install marketplace-data-extractor
git clone https://github.com/tractorjuice/marketplace-data-extractor.git
cd marketplace-data-extractor
pip install .
# Clone and install in development mode
git clone https://github.com/tractorjuice/marketplace-data-extractor.git
cd marketplace-data-extractor
pip install -e ".[dev]"
# Run tests
python tests/runner.py --unit
Code Examples
Quick Start
from marketplace_extractor import extract_service
# Extract comprehensive service data
service_url = "https://www.applytosupply.digitalmarketplace.service.gov.uk/g-cloud/services/123456789"
service_data = extract_service(service_url)
print(f"Service: {service_data.service_name}")
print(f"Supplier: {service_data.supplier_name}")
print(f"Lot Type: {service_data.detected_lot_type}")
print(f"Features: {len(service_data.features)} items")
print(f"Common Sections: {bool(service_data.service_scope)} available")
Hierarchical Category Detection
# Extract with hierarchical category detection (API-based)
service_data = extract_service(service_url, enable_categories=True)
print(f"Category Hierarchy: {service_data.category_hierarchy}")
print(f"Category Tree: {service_data.category_tree}")
# Example output:
# Category Hierarchy: ['Cloud software > Analytics and business intelligence > analytics',
# 'Cloud software > Collaborative working > workflow']
# Category Tree: {'Analytics and business intelligence': ['analytics', 'business intelligence'],
# 'Collaborative working': ['workflow', 'document management']}
Keyword Extraction
# Extract keywords from service content with semantic categorization
service_data = extract_service(service_url, enable_keyword_extraction=True)
print(f"Total keywords: {len(service_data.extracted_keywords)}")
print(f"Top 10 keywords: {service_data.extracted_keywords[:10]}")
print(f"Keyword themes: {list(service_data.keyword_categories.keys())}")
# Example output:
# Total keywords: 1091
# Top 10 keywords: ['cloud', 'service', 'data', 'security', 'management']
# Keyword themes: ['service_core', 'security', 'support_training', 'technical', 'business']
Advanced Features
from marketplace_extractor import MarketplaceExtractor
# Enable all features: lot-aware extraction, categories, and keywords
extractor = MarketplaceExtractor(
enable_category_detection=True,
enable_keyword_extraction=True
)
service_data = extractor.extract_service_data(service_url)
# Or use convenience function with all features
service_data = extract_service(
service_url,
enable_categories=True,
enable_keyword_extraction=True,
keyword_fields=['title', 'description', 'benefits', 'features']
)
# Access lot-specific sections
if service_data.detected_lot_type == 'cloud-support':
print("Support Service Capabilities:")
if service_data.planning and service_data.planning.get('items'):
print(f" Planning: {len(service_data.planning['items'])} items")
if service_data.training and service_data.training.get('items'):
print(f" Training: {len(service_data.training['items'])} items")
elif service_data.detected_lot_type == 'cloud-software':
print("Software Service Features:")
if service_data.scaling and service_data.scaling.get('items'):
print(f" Scaling: {len(service_data.scaling['items'])} options")
if service_data.analytics and service_data.analytics.get('items'):
print(f" Analytics: {len(service_data.analytics['items'])} capabilities")
Data Model
The ServiceData class captures 100+ data points organized into logical categories:
Core Information
- Service ID & Name
- Supplier Information
- Framework & Lot Category
- Detected Lot Type
- Hierarchical Category Taxonomy
- Keyword Analysis & Themes
- Service URL
Service Content
- Description & Title
- Features List
- Benefits List
- Pricing Information
- Contact Details
- Extracted Keywords (1000+ per service)
- Semantic Keyword Categories
Common Sections
- Service Scope
- User Support
- Staff Security
- Standards & Certifications
- Social Value
Service Documents
- Pricing Documents
- Service Definition
- Terms & Conditions
- Skills Framework (SFIA)
Support Services (Lot 3)
- Planning & Strategy
- Training Services
- Setup & Migration
- QA & Performance Testing
- Security Testing
- Ongoing Support
Software Services (Lot 2)
- User Onboarding/Offboarding
- Scaling Capabilities
- Analytics & Reporting
- Enhanced Security Framework
- Data Management
- PSN Connectivity
Documentation
๐ API Reference
Complete API documentation with all functions, classes, and parameters.
View API Docs๐งช Testing Guide
Test suite documentation with unit, integration, and performance tests.
View Testingโ๏ธ Development Guide
Setup instructions, contribution guidelines, and development workflow.
View Dev Guide๐ Performance Metrics
Validation results, coverage statistics, and performance benchmarks.
View Metrics