Package: wikiTools 1.2.7

wikiTools: Tools for Wikidata and Wikipedia

A set of wrappers intended to check, read and download information from the Wikimedia sources. It is specifically created to work with names of celebrities, in which case their information and statistics can be downloaded. Additionally, it also builds links and snippets to use in combination with the function gallery() in netCoin package.

Authors:Modesto Escobar [aut, cph, cre], Ángel Zazo [aut], Carlos Prieto [aut], David Barrios [aut], Cristina Calvo [aut]

wikiTools_1.2.7.tar.gz
wikiTools_1.2.7.zip(r-4.5)wikiTools_1.2.7.zip(r-4.4)wikiTools_1.2.7.zip(r-4.3)
wikiTools_1.2.7.tgz(r-4.4-any)wikiTools_1.2.7.tgz(r-4.3-any)
wikiTools_1.2.7.tar.gz(r-4.5-noble)wikiTools_1.2.7.tar.gz(r-4.4-noble)
wikiTools_1.2.7.tgz(r-4.4-emscripten)wikiTools_1.2.7.tgz(r-4.3-emscripten)
wikiTools.pdf |wikiTools.html
wikiTools/json (API)

# Install 'wikiTools' in R:
install.packages('wikiTools', repos = c('https://modesto-escobar.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/modesto-escobar/wikitools/issues

On CRAN:

35 exports 2 stars 1.53 score 11 dependencies 2 scripts 280 downloads

Last updated 2 months agofrom:2ffb6799b2. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKAug 24 2024
R-4.5-winOKAug 24 2024
R-4.5-linuxOKAug 24 2024
R-4.4-winOKAug 24 2024
R-4.4-macOKAug 24 2024
R-4.3-winOKAug 24 2024
R-4.3-macOKAug 24 2024

Exports:ccextractWikifilextgetFilesgetWikiDatagetWikiFilesgetWikiInfm_Opensearchm_Pageviewsm_reqMediaWikim_XtoolsInfonametoWikiFramenametoWikiHtmlnametoWikiURLpreNamesearchWikiurltoFrameurltoHtmlv_AutoSuggestv_Extractv_GetRecordv_SearchvalidUrlw_EntityInfow_Geolocw_isInstanceOfw_isValidw_LabelDescw_Propertyw_SearchByAuthorityw_SearchByIdentifiersw_SearchByInstanceofw_SearchByLabelw_SearchByOccupationw_Wikipedias

Dependencies:askpassassertthatcollectionscurlhttrjsonlitemimeopensslR6ratelimitrsys

Examples with wiki_utils

Rendered fromwiki_utils.Rmdusingknitr::rmarkdownon Aug 24 2024.

Last update: 2024-05-17
Started: 2023-10-06

Readme and manuals

Help Manual

Help pageTopics
Converts a text separated by commas into a character vector.cc
Check if all Wikidata entities in entity_list have valid valuescheckEntities
checkTitles(titles) Check if titles are valid. Return TRUE is all titles are valid, else FALSE. See https://en.wikipedia.org/wiki/Wikipedia:Page_name#Technical_restrictions_and_limitationscheckTitles
Execute a function in chunks.doChunks
Extract the first paragraph of a Wikipedia article with a maximum of characters.extractWiki
Extract the extension of a filefilext
Downloads a list of files in a specified path of the computer, and return a vector of the no-found names (if any).getFiles
Create a data.frame with Wikidata of a vector of names.getWikiData
Downloads a list of Wikipedia pages in a specified path of the computer, and return a vector of the no-found names (if any).getWikiFiles
Create a data.frame with Q's and descriptions of a vector of names.getWikiInf
httrGetJSON Retrieve responses in JSON format using httr::GET. It is a generic function to use for request these Wikimedia metrics API: https://wikimedia.org/api/rest_v1/ https://www.mediawiki.org/wiki/XTools/API/Page (xtools.wmflabs.org)httrGetJSON
Limits the rate at which a function will executelimitRequester
Open search of a stringm_Opensearch
Get number of views of a Wikipedia articlem_Pageviews
Retrieve responses using the MediaWiki API.m_reqMediaWiki
Gets various information from a Wikimedia pagem_XtoolsInfo
Convert names into a Wikipedia's iframenametoWikiFrame
Create the Wikipedia link of a name or entry.nametoWikiHtml
Create the Wikipedia URL of a name or entry.nametoWikiURL
Return the normalized and redirect title from the responsenormalizedTitle
Reverse the order of the first and last names of every element of a vector.preName
Uses httr package to retrieve responses using the MediaWiki API.reqMediaWiki
Get responses from Wikidata Query ServicereqWDQS
Find if there is a Wikipedia page of a name(s) in the selected language.searchWiki
Convert an URL link to an HTML iframe.urltoFrame
Convert a Wikipedia URL to an HTML linkurltoHtml
See https://meta.wikimedia.org/wiki/User-Agent_policy https://www.mediawiki.org/wiki/API:Etiquetteuser_agent
Suggests VIAF id from a namev_AutoSuggest
Gets information from a VIAF recordv_Extract
Gets record clustersv_GetRecord
Run a CQL Query in VIAFv_Search
Find if an URL link is valid.validUrl
Get information about a Wikimedia entity (human or film)w_EntityInfo
Get Latitude and Longitude coordinates, and Country of placesw_Geoloc
Check if a Wikidata entity is an instance of a classw_isInstanceOf
Check if Wikidata entities are validw_isValid
Return label and/or descriptions of Wikidata entitiesw_LabelDesc
Get properties of Wikidata entitiesw_Property
Response from Wikidata Query Servicew_query
Get entities that have identifier in a database or authorities' catalog.w_SearchByAuthority
Search for entities that may match identifiers in a database or authorities' catalog.w_SearchByIdentifiers
Get entities which are instance of a Wikidata entityw_SearchByInstanceof
Search Wikidata entities by string (usually labels)w_SearchByLabel
Get Wikidata entities with a certain occupationw_SearchByOccupation
Get Wikipedia pages of Wikidata entitiesw_Wikipedias