Source

citeulike_api /

Filename Size Date modified Message
src/citeulike_api
94 B
193 B
309 B
52 B
420 B
1.9 KB
864 B
1.2 KB

CiteULike Client

a python client for Citeulike.

This project has just been spun off possumpalace_kit, my blog engine.

If you notice any problems with paths or dependencies, please file a patch. Or just fork it. I'll make you maintainer in all likelihood, as I'm no longer using CiteULike so very much, having banned myself from spending too much time working around its foibles.

The CUL "API" was pieced together from forum comments made by the CUL staff over time.

e.g. how to

usage

Here is an example of how i to write out a bibtex file of all records and download all PDFs:

from citeulike.citeulike_api import CiteULike

username = "exampleuser" password = "examplepassword" outjsonpath = "./bib.json" outpdfpath = "./pdfs/" outbibtexpath =

#initialize API and login cul = CiteULike(username=username,

password=password, json_cache=outjsonpath, attachment_path=outpdfpath

) # download all records for ease of bulk operation # these will stay on a JSON file on the local disk cul.cache_records()

# create a BibTeX version, somewhat more likely to be taken as # well-formed than the CUL default: bibtex_string = cul.render('bibtex')

with codecs.open(outbibtexpath, 'w', 'utf-8') as bf:
bf.write(bibtex_string)

# For each record, download its attachments cul.bulk_apply(filt=lambda r: 'userfiles' in r,

method_names=['download_attachments'])

TODO