wme-models
Type definitions for the Wikimedia Enterprise API.
This crate provides complete Rust type definitions for all Wikimedia Enterprise API endpoints including On-demand, Snapshot, and Realtime APIs. All types implement Serialize and Deserialize for seamless JSON/NDJSON handling.
Overview
Wikimedia Enterprise provides three main API services:
- On-demand API - Query individual articles by name across all projects
- Snapshot API - Download complete project dumps as compressed tarballs
- Realtime API - Stream article updates via SSE or download hourly batches
Features
- Complete type coverage - All API response types including articles, versions, events, and metadata
- Consistent schema - Same
Articletype works across all three APIs - Forward compatibility - Schema envelope for handling API evolution
- Structured content - Parsed infoboxes, sections, and tables (BETA)
- Zero-copy parsing - Optional
borrowedfeature forCow<str>support
Quick Start
use ;
use serde_json;
Core Types
Article Types
Article- Complete article from any APIStructuredArticle- Article with parsed content (BETA)
Version & Edit Information
Version- Revision metadata with credibility signalsEditor- Editor information including groups and rightsScores- Quality scores (revert risk, reference risk, reference need)
Event Types (Realtime API)
EventMetadata- Event tracking with partition/offsetEventType-update,delete, orvisibility-change
Request Parameters
RequestParams- Build API requests with fields, filters, and limitsFilter- Field-based filtering using dot notation
Metadata Types
Language- Language code, name, and directionNamespace- Namespace ID with descriptionProjectInfo- Full project metadataSnapshotInfo- Snapshot metadata with chunksChunkInfo- Download chunk information
API-Specific Notes
On-demand API
Returns single articles or arrays. Use RequestParams to filter by language/project:
use ;
let params = new
.field
.field
.filter
.limit;
Snapshot API
Returns NDJSON in tar.gz files. Articles may contain duplicates (< 1%) - use the one with the highest version.identifier:
use Article;
Realtime API
Streaming endpoint returns SSE or NDJSON. Events include partition/offset for resumability:
use Article;
Data Dictionary Compliance
All types follow the Wikimedia Enterprise Data Dictionary:
- Required fields are non-optional in structs
- Optional fields use
Option<T> - Omitempty fields use
Option<T>withskip_serializing_ifwhere appropriate - Credibility signals marked in documentation (scores, editor info, maintenance tags)
Feature Flags
borrowed- Enable borrowed deserialization withCow<str>for zero-copy parsing (reduces allocations when processing large NDJSON files)
License
This project is licensed under the terms of the workspace license.