A hand-crafted asynchronous MediaWiki API client library for wiki sites (including Wikipedia and its sister projects, as well as Wikia). The library targets at .NET Standard 1.1 & 2.0 (See Supported Platforms), and focuses on the API compatibility with MediaWiki 1.19 (Wikia), as well as the latest version of MediaWiki (i.e. 1.32-wmf, as in 2018-08). Other versions in between are hopefully also compatible.
The packages CXuesong.MW.WikiClientLibrary.*
are now available on NuGet. E.g. you may install the main package using the following command
# Package Management Console
Install-Package CXuesong.MW.WikiClientLibrary
# .NET CLI
dotnet add package CXuesong.MW.WikiClientLibrary
Package | Status |
---|---|
CXuesong.MW.WikiClientLibrary | |
CXuesong.MW.WikiClientLibrary.Flow | |
CXuesong.MW.WikiClientLibrary.Wikia | |
CXuesong.MW.WikiClientLibrary.Wikibase |
If you bump into bugs, have any suggestions or feature requests, feel free to open an issue. Any contributions on documentations (code annotations & repository wiki) are also welcomed. Thank you.
- Repository Wiki (getting started & conceptual documentations)
- Library References (latest pre-release)
- Releases
Developed in Visual Studio 2017, this portable & asynchronous MediaWiki API client provides an easy and asynchronous access to commonly-used MediaWiki API. The library has the following features
-
Queries for and edits to pages, categories, and files; page information inspection; file uploading.
-
Login/logout via simple asynchronous functions.
- Client code has access to
CookieContainer
, and therefore has chance to persist it.
- Client code has access to
-
Tokens are encapsulated in the library functions, so that client won't bother to retrieve them over and over again.
-
Query continuations are encapsulated by
IAsyncEnumerable
, which will ease the pain when using page generators. -
Other miscellaneous MediaWiki API, such as
- OpenSearch
- Page parsing
- Patrol
-
StructuredDiscussions (aka. Flow) support
-
Basic Wikibase (Wikidata's back-end) API support; the library provides facility to consume Wikibase JSON dump
-
Basic Wikia API (Nirvana, Wikia AJAX, and Wikia REST-ful API v1) support