Open-EO / openeo-python-client

Python client API for OpenEO
https://open-eo.github.io/openeo-python-client/
Apache License 2.0
155 stars 42 forks source link

Better information when printing Connection object #216

Open m-mohr opened 3 years ago

m-mohr commented 3 years ago

I'm personally found the <Connection to 'https://openeo.vito.be/openeo/1.0/' with BearerAuth> always pretty strange when printing the Connection object. It gives a URL that I did not specify with some strange Auth thing that I (as a normal user) don't know anything about. I would expect something like <Connection established to https://openeo.vito.be, version {x.x}, authenticated via {Identity Povider Name} | Terms of Service - Privacy Policy> or as an alternative just an overview where I'm connecting to (see #174).

_Originally posted by @m-mohr in https://github.com/Open-EO/openeo-python-client/pull/213#discussion_r652809399_

m-mohr commented 3 years ago

The message should probably also give details about terms of service and privacy policy like the R client does.

soxofaan commented 3 years ago

As a reference this is how some well known Python database libraries "render" a connection object:

>>> import sqlite3
>>> con = sqlite3.connect(":memory:")
>>> con
<sqlite3.Connection at 0x7f88ae354c70>

>>> from sqlalchemy import create_engine
>>> engine = create_engine("sqlite:///:memory:")
>>> engine
Engine(sqlite:///:memory:)
m-mohr commented 3 years ago

Hmm... I'm not buying that if others do it strangely, we should do it, too. ;-)

How do you envision people get informed about TOS and PP during the connection process? (This is a request still pending from the EU project, which was implemented in all clients except Python.) Is there any good reason to not expand this in a more user-friendly manner?