Python client for the CORE APIs
This repository is one of our project for the Mozilla Global Sprint '17. We started this project by generating a simple API client from the Swagger Codegen project:
Python 2.7 and 3.4+
If the python package is hosted on Github, you can install directly from Github
pip install git+https://github.com//.git
(you may need to run pip
with root permission: sudo pip install git+https://github.com/oacore/pyoacore
)
Then import the package:
import pyoacore
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import pyoacore
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import swagger_client
from pyoacore.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = pyoacore.ArticlesApi()
core_id = '42' # str | The id of the article
try:
# Get articles by ID
api_instance.articles_get_core_id_get(core_id)
except ApiException as e:
print("Exception when calling ArticlesApi->articles_get_core_id_get: %s\n" % e)
All the APIs can be accessible here https://core.ac.uk/docs
Coming soon
Matteo Cancellieri