New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

wikidata-cli

Package Overview
Dependencies
Maintainers
1
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wikidata-cli

The command-line interface to Wikidata

Source
npmnpm
Version
7.5.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

wikidata

Wikidata-CLI

The Command-line interface interface to Wikidata

This project is funded by a Wikimedia Project Grant.

Show your support by adding {{#babel:Wikidata CLI}} to your Wikidata user page userbox

NPM DockerHub Badge

License Node JavaScript Style Guide

Summary

Dependencies

General

  • NodeJs >= v6.4.0 (recommended way to install it: use the awesome NVM)
  • Git

Per feature

  • to use the clipboard option: see copy-paste dependencies

Installation

via npm

npm install -g wikidata-cli

Installing globally allows to make the command wikidata-cli and its alias wd accessible from your shell $PATH

via docker

# Might require to be run with sudo depending on your Docker installation
docker run --rm -t maxlath/wikidata-cli
# You can make an alias out of it:
alias wd="docker run --rm -t maxlath/wikidata-cli"
# You're then ready to use it as in the documentation examples
wd label Q1

That would work, but all operations using cached data (such as the list of all properties) would need to re-fetch those data for each operations, and all operations editing Wikidata would require you to enter your username and password everytime. To work around this, you can allow this container to persist some files on your system, using shared volumes:

mkdir -p $HOME/.local/share/wikidata-cli
alias wd='docker run --rm --volume "$HOME/.local/share/wikidata-cli:/wikidata-cli/local" -t maxlath/wikidata-cli'

NB: Beware that using wikidata-cli through a Docker container has a performance cost of something like 1s per command, so if you need to run many commands (for instance in a script to mass edit Wikidata), you should probably rather use the NPM package directly for long series of commands

Commands

Read operations

see Read operations

wd summary Q1

Write operations

see Write operations

Config

Allows to persist options

see Config

See Also

You may also like

inventaire banner

Do you know inventaire.io? It's a web app to share books with your friends, built on top of Wikidata! And its libre software too.

License

MIT

Keywords

wikidata

FAQs

Package last updated on 10 Jul 2019

Related posts