import mnis
import datetime

# Create a date for the analysis
d = datetime.date.today()

# Download the full data for MPs serving on the given date as a list
mnis.getCommonsMembersOn(d)[0]

"""
Explanation: Postcards of Parliament From A Digital Flâneur
Flâneur, noun, A man who saunters around observing society.
The flâneur wandered in the shopping arcades, but he did not give in to the temptations of consumerism; the arcade was primarily a pathway to a rich sensory experience — and only then a temple of consumption. His goal was to observe, to bathe in the crowd, taking in its noises, its chaos, its heterogeneity, its cosmopolitanism. Occasionally, he would narrate what he saw — surveying both his private self and the world at large — in the form of short essays for daily newspapers.
The Death of the Cyberflâneur, Evgeny Morozov, New York Times, Sunday Review,  February 4, 2012
APIs

Using the APIs

Packages Make Life Easier (?)
End of explanation
"""


import pd_datareader_nhs.nhs_digital_ods as ods

ods.search(string='Prison', field='Label')

dd=ods.download('eprison')
dd.head()

"""
Explanation: Creating Custom pandas Data Reader Packages
End of explanation
"""


import requests
requests.get('http://127.0.0.1:8899/demo/role/worker').json()

requests.get('http://127.0.0.1:8899/demo/name/jo').json()

"""
Explanation: Package Issues


development


building up example and reusable recipes


ownership and production quality (participation in development)


Notebooks as Open / Shared Recipes

But How Do I Share Working Examples?

BinderHub Build Sequence
"[P]hilosophically similar to Heroku Build Packs"

requirements.txt
python packages
environment.yml
conda environment specification
apt.txt

debian packages that should be installed (latest version of Ubuntu)


postBuild

arbitrary commands to be run after the whole repository has been built
REQUIRE
Julia packages
Dockerfile
treated as a regular Dockerfile. The presence of a Dockerfile will cause all other building behavior to not be triggered.

Building a Local Docker Image From a Github Repository
```bash
pip3 install jupyter-repo2docker
jupyter-repo2docker --image-name psychemedia/parlihacks --no-run https://github.com/psychemedia/parlihacks
docker push psychemedia/parlihacks
```
Creating Simple Service APIs
In terminal:
jupyter kernelgateway --KernelGatewayApp.api='kernel_gateway.notebook_http' --KernelGatewayApp.seed_uri='./SimpleAPI2.ipynb' --port 8899
End of explanation
"""


