Tutorialwork / deutsche_bahn_api

This is a package to interact with the Deutsche Bahn timetables api
https://pypi.org/project/deutsche-bahn-api
GNU General Public License v3.0
9 stars 9 forks source link

how to import all classes at once? #8

Open MichaelMrt opened 2 months ago

MichaelMrt commented 2 months ago

After I installed the module with _pip install deutsche_bahnapi I imported it with

from deutsche_bahn_api import *
api = ApiAuthentication("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")

Now the program is not able to find the ApiAuthentication class. Same when using:

deutsche_bahn_api.ApiAuthentication(..)

On the other hand if I import this way

import deutsche_bahn_api.api_authentication as dba
api = dba.ApiAuthentication("YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET")

Everthing works fine and the class is found.

Can somebody please explain to me why the ApiAuthentication class has to be imported this way?