Last updated:
0 purchases
pigshare 0.6.4
=================Markus Binsteiner================= :Author: Markus Binsteiner.. contents::1 Pigshare----------Python client library and commandline tool for institutional Figshare.The commandline options are created dynamically from the available api-method wrapper code, which is why some of them might feel a bit clumsy. Also, many of the commands only support values as json-formatted strings. I might change that in the future, but it'd require more complex cli-argparse creation code and I'm not sure whether it's worth it.1.1 Notes~~~~~~~~~So far, I've only tested this on Linux.1.2 Requirements~~~~~~~~~~~~~~~~- python-dev package (for simplejson compilation I think)- argparse- setuptools- restkit- booby- simplejson- parinx- pyclist- argcomplete1.3 Installation~~~~~~~~~~~~~~~~1.3.1 Release^^^^^^^^^^^^^:: (sudo) pip install pigshare1.3.2 Development version from Github^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^:: (sudo) pip install https://github.com/UoA-eResearch/pigshare/archive/master.zip1.4 Usage (commandline client)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~1.4.1 Connection details^^^^^^^^^^^^^^^^^^^^^^^^*pigshare* reads a config file Missing open brace for superscriptMissing open brace for superscript pigshare -o title,id -p martin search_my_articles --search_term ISSP ISSP1991: Religion I 2000910 ISSP1992: Social Inequality II 2000913 ISSP1993: Environment I 2000916 ISSP1994: Family and Changing Gender Roles II 2000919 ISSP1995: National Identity I 2000922 ISSP1996: Role of Government III 2000925 ISSP1997: Work Orientations II 2000928 ISSP1998: Religion II 2000934 ISSP1999: Social Inequality III 2000937 ISSP2000: Environment II 2000940 ISSP2001: Social Networks II 2000943 ISSP2002: Family and Changing Gender Roles III 2000946 ISSP2003: National Identity II 2000949 ISSP2004: Citizenship I 2000952 ISSP2005: Work Orientations III 2000955 ISSP2006: Role of Government IV 2000958 ISSP2007: Leisure Time and Sports I 2000961 ISSP2008: Religion III 2000964 ISSP2009: Social Inequality IV 2000967 ISSP2010: Environment III 2000970- then, 'touch' (publish) the articles in the right (reverse) order :: pigshare -p martin publish_article 2000970 2000967 2000964 2000961 2000958 2000955 2000952 2000949 2000946 2000943 2000940 2000937 2000934 2000928 2000925 2000922 2000919 2000916 2000913 2000910- check the webfrontend whether it worked by refreshing the collections pageBe aware that if an article got a new version since it was added to a collection, the old version of the article is included in it. If you want the new version, you need to manually remove and re-add the article before you do anything else.1.4.8 Other random example calls:^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^:: # create new collection pigshare create_collection --collection '{"title": "Collection markus test", "articles": [2009074,2009075,2009084], "custom_fields": {"test1": "value1"}}':: # add articles to a collection pigshare add_article --id 2761 --article_ids [2009103,2009106]:: # search all my articles that contain a search_term, display only ids, separated by ',' (useful to copy and paste into 'add_article' command) pigshare -o id -s ',' search_my_articles --search_term [search_term]:: # list all of your personal articles, and add all of them to a collection for id in `pigshare -o id list_my_articles`; do echo "id";pigshareaddarticle−−collectionid3222−−articleid"id"; done:: # update/overwrite the title and articles connected to a collection pigshare update_collection --id 2761 --collection '{"title": "Collection markus test changed", "articles": [2009074,2009075]}':: # update/overwrite the categories field in a collection pigshare update_article --id 2000077 --article '{"categories": [2]}':: # update/overwrite the custom_fields of a collection pigshare update_article --id 2000077 --article '{"custom_fields": {"field1":"value1"}}'1.5 Usage (Library)~~~~~~~~~~~~~~~~~~~TODO
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.