bundesAPI / bundesAPI/dip-bundestag-api

Issues with installation and usage of the package

Open
#8 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
25
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Hi everyone,

thank you for wrapping the APIs with some code.

I have had several issues with the package so far; I will list them here, with the hope this will generate some interest to fix them :)

**Installation via pip and usage**

The [instructions](https://pypi.org/project/de-dip-bundestag/) on the PyPI site are slightly confusing, as there are two listed ways of installing the package:

1. pip install de-dip-bundestag
2. pip install deutschland[dip_bundestag]

Once installed, the code example provided is not working, as the _api_ package doesn't contain anything called _default_api_ (or an object called DefaultApi anywhere in the code).

Are the instructions for an older/different version of the package?

**Installation via git clone and python -m pip install .**

I also tried an alternative way, where I cloned the repo and installed it directly from the subfolder python_client via _python -m pip install ._

```
(dpp) ➜ python-client git:(main) python -m pip install .
Processing /Users/jurica/Projects/dip-bundestag-api/python-client
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: urllib3>=1.25.3 in /Users/jurica/miniconda3/envs/dpp/lib/python3.9/site-packages (from de-dip-bundestag==0.1.0) (1.26.9)
Requirement already satisfied: python-dateutil in /Users/jurica/miniconda3/envs/dpp/lib/python3.9/site-packages (from de-dip-bundestag==0.1.0) (2.8.2)
Requirement already satisfied: six>=1.5 in /Users/jurica/miniconda3/envs/dpp/lib/python3.9/site-packages (from python-dateutil->de-dip-bundestag==0.1.0) (1.12.0)
Building wheels for collected packages: de-dip-bundestag
Building wheel for de-dip-bundestag (pyproject.toml) ... done
Created wheel for de-dip-bundestag: filename=de_dip_bundestag-0.1.0-py3-none-any.whl size=56847 sha256=295dff258699721ec8f3c0467be513723ebc9db7d2cd3d7d90d487823627fcc9
Stored in directory: /Users/jurica/Library/Caches/pip/wheels/4a/43/a8/4cbe73ea69d4784ba92625838fb9cf42ff5d3929831566fcfe
Successfully built de-dip-bundestag
Installing collected packages: de-dip-bundestag
Successfully installed de-dip-bundestag-0.1.0
```

The installation is without any issues.
The provided code example in the readme.MD, in the python-client subfolder, seems to be matching the provided API.

Unfortunately, the provided example is still not working, as I keep on getting a 401, although I provided an API key, as per the instructions.

```
/Users/jurica/miniconda3/envs/dpp/bin/python /Users/jurica/Projects/data-processing-pipeline/policy_pipeline/bundestag.py
Exception when calling AktivitaetApi->aktivitaet: Status Code: 401
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'date': 'Tue, 12 Jul 2022 14:02:11 GMT', 'server': 'Apache', 'www-authenticate': 'apikey realm="realm"', 'content-type': 'application/json', 'content-length': '215', 'via': '1.1 search.dip.bundestag.de', 'access-control-allow-headers': 'origin, x-requested-with, content-type, authorization, content-disposition, accept', 'access-control-allow-methods': 'OPTIONS,GET,PUT,POST,DELETE,HEAD', 'access-control-allow-credentials': 'true', 'x-frame-options': 'SAMEORIGIN', 'x-xss-protection': '1; mode=block', 'x-content-type-options': 'nosniff', 'x-permitted-cross-domain-policies': 'none', 'strict-transport-security': 'max-age=31536000'})
HTTP response body: {"code":401,"message":"An API key is required to access this service. Please refer to https://dip.bundestag.de/über-dip/hilfe/api how to apply for a key. Misuse of this service may lead to blocking your requests."}

```

It seems that none of the examples actually work as described/presented.

Is there anything I can do to make this work on my end?

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare the PyPI instructions with the README.md in the python-client subfolder, then reproduce both installation paths and the failing API example. Check why default_api is referenced but absent and why the supplied API-key example returns 401. Done means the installation guidance and examples work consistently with the documented authentication process.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.