Giter VIP home page Giter VIP logo

wdtool's Introduction

wdtool.py

This tool has been deprecated. Please use wdreconcile instead.

Command line utility to match strings to Wikidata items, written in Python 3

Examples

To match strings, first get a CSV file with QID's that you want to match (e.g., from the Wikidata Query Service) and get the metadata for all items

wdtool.py import -i query.csv

If your CSV file has multiple columns and a header, you need to give it the key of the column where your qids are located as well

wdtool.py import -i query.csv -k item

This will download all item data and write it to a JSON file, by default in a directory called data in the same folder as where you execute wdtool.py.

To match your CSV file of strings try

wdtool.py reconcile -i strings.csv -o strings-matched.csv

If you have a CSV file with a header and multiple columns you can use the -k argument again

wdtool.py reconcile -i items.csv -k item -o strings-matched.csv

strings-matched.csv will contain the effort wdtool has made.

Troubleshooting

  • Before opening an issue, try running your command with the -v (verbose) switch, because this will give you more debug information.

All options

You'll get this output when running wdtool.py -h.

usage: wdtool.py [-h] [--has-header] -i INPUT [-k KEY] [-o OUTPUT]
                 [-dp DATA_PATH] [-v]
                 [{import,reconcile}]

Tool to match strings to Wikidata items

positional arguments:
  {import,reconcile}

optional arguments:
  -h, --help            show this help message and exit
  --has-header          CSV file has a header
  -i INPUT, --input INPUT
                        Input CSV file
  -k KEY, --key KEY     If a CSV file has multiple columns, give the key of
                        the column
  -o OUTPUT, --output OUTPUT
                        Output CSV file
  -dp DATA_PATH, --data-path DATA_PATH
                        Path where the JSON Wikidata files will be saved,
                        defaults to /Users/hkrane01/htdocs/wdtool/data
  -v, --verbose         Display debug information

License

Licensed under the MIT license.

Credits

Written by Hay Kranen.

wdtool's People

Contributors

hay avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.