/oslo_bysykkel_py

Just a cute little wrapper around the gbfs endpoint 'oslobysykkel.no/gbfs.json'

Primary LanguagePython

oslo_bysykkel.py

This is just a cute little wrapper around the gbfs endpoint:

https://gbfs.urbansharing.com/oslobysykkel.no/gbfs.json

It uses the standard json and requests python packages.

Create a python environment using conda

$ conda create -n oorigo python=3.9
$ conda activate oorigo

Install directly from git (kinda cool)

$ (oorigo) pip install git+git://github.com/isakbm/oslo_bysykkel_py.git

Test the package

Create main.py and fill it with the following contents

import json
from oslo_bysykkel import API

api = API(client_identifier='OSLO-ORIGO-APPLICANT-CODE-CHALLENGE')
summary = api.get_summary_dict()

print(json.dumps(summary, indent='    ', ensure_ascii=False))

Then execute

$ (oorigo) python main.py

You should see some nice json output.