Giter Site home page Giter Site logo

ltworf / vasttrafik-cli Goto Github PK

View Code? Open in Web Editor NEW
8.0 4.0 1.0 668 KB

Migrated to codeberg

Home Page: https://codeberg.org/ltworf/vasttrafik-cli/

License: GNU General Public License v3.0

Python 88.62% Makefile 11.38%
python-api goteborg python vasttrafik

vasttrafik-cli's Introduction

vasttrafik-cli's People

Contributors

kchr avatar ltworf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

kchr

vasttrafik-cli's Issues

Can't really easily redistribute at the moment.

I don't know where to place ColorMap. The original module doesn't seem to be packaged for debian so i might want to do it myself (if they accept my changes), or i might create a pysttrafik package.

Västtrafik API changes possibly affects us

Hi,

I just received an API change announcement from Västtrafik Labs (their API developers).

TL;DR Basically, this boils down to these changes:

  1. All requests need to be GET - historically POST requests have been accepted
  2. Specific API version number needs to be correct - non-existant versions will throw error

We will not be affected by the first one (only GET is used). I don't think we're using specific API version calls either, but let's audit the code to be sure. :-)

Rollout timeframe is about a week away (between 22-26th of June).

Original announcement (sorry, Swedish only):

Hej,

Enligt våra uppgifter har du visat intresse för Västtrafiks API för
Reseplanering genom att registrera dig på labs.vasttrafik.se. Av denna
anledning vill vi på nytt informera om att Västtrafik nu genomför en satsning
inom området API Management. Vad denna satsning omfattar och vad den innebär
för dig tänkte vi kortfattat beskriva i detta mail.

API Gateway

Det första som kommer att hända, och som kan påverka dig, är att vi under vecka
26 (22-26 Juni) kommer att dirigera om all API-trafik till att gå via en s.k.
API Gateway. Denna förändring kommer inte att påverka adressen till vårt
Reseplanerar-API. Däremot är det så att anrop som idag fungerar, men som är
direkt felaktiga, inte längre kommer att släppas fram till vårt API. Några
exempel på felaktiga anrop som vi har hittat i våra logfiler är:

  1. Användning av POST istället för GET. Alla anrop till vårt Reseplanerar-API är GET, så om du idag använder POST behöver du snarast byta till GET.
  2. Resurser som inte finns
    • Fel: /bin/rest.exe/v1departureBoard (saknas ett / efter v1)
    • Fel: /bin/rest.exe//v1.07//departureBoard (felaktig användning av // samt version som inte finns)

Regards,
kchr

API key

Find out if i can just hardcode that... requiring users to get their own developer key is quite unfriendly.

TAXI!!!

Exceptions:
  'list' object has no attribute 'keys'
  Path: .[0].Leg
  Value of str could not be loaded into VehicleType
Value 'TAXI' not between: 'ST', 'TRAM', 'BUS', 'WALK', 'BOAT', 'VAS', 'REG'
  Path: .[0].Leg.[4].type

Can't go to scandinavium

Traceback (most recent call last):
  File "/home/salvo/bin/trip", line 91, in <module>
    main()
  File "/home/salvo/bin/trip", line 79, in main
    dest = get_stop('TO: > ')
  File "/home/salvo/bin/trip", line 46, in get_stop
    stops = vast.location(line)
  File "/home/salvo/dev/pysttrafik/pysttrafik.py", line 140, in location
    return [Stop(i) for i in c]
  File "/home/salvo/dev/pysttrafik/pysttrafik.py", line 577, in __init__
    self.id = d['id']
TypeError: string indices must be integers

This happens every time scandinavium is selected as destination.

Create cache dir

Processing triggers for libc-bin (2.32-4) ...
(Reading database ... 13593 files and directories currently installed.)
Removing autopkgtest-satdep (0) ...
autopkgtest [22:45:50]: test command2: ./trip.py chalmers valand
autopkgtest [22:45:50]: test command2: [-----------------------
Traceback (most recent call last):
  File "/tmp/autopkgtest-lxc.xuibzntz/downtmp/build.q4Q/src/./trip.py", line 205, in <module>
    tripmain()
  File "/tmp/autopkgtest-lxc.xuibzntz/downtmp/build.q4Q/src/./trip.py", line 172, in tripmain
    origstop = get_stop('FROM: > ', orig)
  File "/tmp/autopkgtest-lxc.xuibzntz/downtmp/build.q4Q/src/./trip.py", line 107, in get_stop
    r = vast.location(preset)
  File "/tmp/autopkgtest-lxc.xuibzntz/downtmp/build.q4Q/src/vasttrafik.py", line 144, in location
    a = self._request(
  File "/tmp/autopkgtest-lxc.xuibzntz/downtmp/build.q4Q/src/vasttrafik.py", line 123, in _request
    token = self._get_token().access_token
  File "/tmp/autopkgtest-lxc.xuibzntz/downtmp/build.q4Q/src/vasttrafik.py", line 108, in _get_token
    with self._tokenfile.open('wt') as f:
  File "/usr/lib/python3.9/pathlib.py", line 1252, in open
    return io.open(self, mode, buffering, encoding, errors, newline,
  File "/usr/lib/python3.9/pathlib.py", line 1120, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/debci/.cache/vasttrafik-cli-token'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.