n2ygk / api-training

some RESTful API training using jupyter notebook.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API Training

Some RESTful API training using Jupyter Notebooks.

Contents

See instructions for installing Jupyter below and then:

demo-clientid-client

Here are some notebooks that demonstrate using the demo-clientid API and the OAuth 2.0 Client Credentials grant:

demo-echo-client

Here's a notebook that demonstrates using the demo-echo API with the Authorization Code grant:

demo-jsonapi-client

This set of notebooks demonstrates the {json:api} RESTful request/response standard. See https://github.com/n2ygk/mulesoft-demo-jsonapi for a demo server that runs on Mulesoft. This client uses said deployed server. Credentials for it are in the notebook. Don't worry; it's rate-limited.

Installing and running Jupyter on your laptop

Installing Jupyter gets you a basic Python system:

git clone git@github.com:n2ygk/api-training.git
cd api-training
pip3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt
jupyter notebook

Your browser will open a new window with the Jupyter notebook browser.

Adding JavaScript (node.js)

See https://github.com/n-riesco/ijavascript

For MacOS (need a back-level version of node.js to work with ijavascript):

brew install node@6
brew link --force node@6
sudo pip install --upgrade pyzmq jupyter
sudo npm install -g ijavascript
ijsinstall

Modules installed with npm install -g do not work. You have to make them local to the home directory of your juptyer server (e.g. this directory) and the node_modules directory must pre-exist or npm will complain. See package.json for the list of added modules.

mkdir node_modules
npm install

Adding R

This has nothing to do with APIs -- just playing around with Jupyter

See the instructions at https://irkernel.github.io/installation/

install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))
devtools::install_github('IRkernel/IRkernel')
IRkernel::installspec(user = FALSE)

I've added two examples from the Stats course I took, including the data files they need.

Author

Alan Crosswell

Copyright (c) 2017 The Trustees of Columbia University in the City of New York

LICENSE

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

some RESTful API training using jupyter notebook.

License:Apache License 2.0


Languages

Language:Jupyter Notebook 98.9%Language:Python 0.8%Language:HTML 0.3%