pytr-org / pytr

Use TradeRepublic in terminal and mass download all documents
https://pypi.org/project/pytr/
MIT License
422 stars 74 forks source link

Add card transactions into csv automatically #97

Closed aydinseven7 closed 4 months ago

aydinseven7 commented 4 months ago

As of now, all card transactions are handled as type "None" and then get put into the other_events.json. You then have to manually convert that into a csv/excel file to properly import it somewhere else. \ On download you can see it like this in the terminal: e.g. 17:38:11 34/75: McDonald's -- None - 2024-07-11T11:48:44, which gets translated into json (shortened):

{
    "id": "xxx",
    "timestamp": "2024-06-13T07:35:11.715+0000",
    "title": "McDonald's",
    "icon": "logos/merchant-cf14fba1-08b0-422f-897b-6b334fd9dfcf/v2",
    "badge": null,
    "subtitle": null,
    "amount": {
      "currency": "EUR",
      "value": -3.99,
      "fractionDigits": 2
    },
    "subAmount": null,
    "status": "EXECUTED",
    "action": {
      "type": "timelineDetail",
      "payload": "xxx"
    },
    "eventType": "card_successful_transaction",
    "source": "timelineTransaction",
    "details": {
      "id": "xxx",
      "sections": [
        {
          "title": "Du hast 3,99 € ausgegeben",
          "data": {
            "icon": "logos/merchant-cf14fba1-08b0-422f-897b-6b334fd9dfcf/v2",
            "subtitleText": null,
            "timestamp": "2024-06-13T07:35:11.715+0000",
            "status": "executed"
          },
          "action": null,
          "type": "header"
        }

Could you implement some automatic conversion so that card transactions are placed in the account_transactions.csv or some other csv file? Technically only

are needed there I guess.

Katzmann1983 commented 4 months ago

Adding as a byproduct in PR #100