Wiki.Enterprise (mediawiki_client v0.6.0)
View SourceClient for the Wikimedia Enterprise API
Docs: https://enterprise.wikimedia.com/docs/
These APIs are only provided by the Enterprise organization and hit two endpoints: one for authentication and the other for information retrieval. An account is required.
For the moment, only the Snapshot API verbs will be implemented.
Summary
Functions
Retrieve a snapshot chunk as a binary .tar.gz
Lists information about available snapshots, namespaces, and chunks.
Get a list of chunk files for a given snapshot, along with the chunk metadata.
Example
Types
@type client_options() :: [client_option()]
Functions
@spec get_snapshot_chunk(Wiki.Enterprise.Session.t(), binary(), binary()) :: binary()
Retrieve a snapshot chunk as a binary .tar.gz
Example:
ndjson_tgz = Wiki.Enterprise.get_snapshot_chunk(api, "aawiki_namespace_0", "aawiki_namespace_0_chunk_0")
@spec list_available_snapshots(Wiki.Enterprise.Session.t()) :: list()
Lists information about available snapshots, namespaces, and chunks.
Example:
Wiki.Enterprise.list_available_snapshots(api)
@spec list_snapshot_chunks(Wiki.Enterprise.Session.t(), binary()) :: list()
Get a list of chunk files for a given snapshot, along with the chunk metadata.
The order of chunks doesn't matter, each is a self-contained file.
Example:
Wiki.Enterprise.list_snapshot_chunks(api, "aawiki_namespace_0")
@spec new(client_options()) :: {:ok, Wiki.Enterprise.Session.t()} | {:error, term()}
Example:
{:ok, api} = Wiki.Enterprise.new(
username: System.get_env("ENTERPRISE_USERNAME"),
refresh_token: System.get_env("ENTERPRISE_REFRESH_TOKEN"))