Giter VIP home page Giter VIP logo

fahrplandatengarten's Introduction

FahrplanDatenGarten

#FahrplanDatenGarten on matrix.org

We ❤️ Deutsche Bahn

Used API's

  • HAFAS

Setup

Init and Update git-submodules

git submodule init
git submodule update

Install Debian Requirements (only on debian systems)

sudo apt install python3-dev python3-venv

Set up the VEnv (optional, but recommended)

Using an VEnv will help you to avoid dependency-(version)-conflicts.

python3 -m venv .venv
source .venv/bin/activate

You can deactivate the VEnv, by simply running deactivate. If you want to re-enable the VEnv later, simply run source .venv/bin/activate again.

Install python dependencies

pip install -U -r requirements.txt

Set up the database

Copy .env.example to .env and change the database block.

Migrate your database

This and all later commands will have to be run from inside the folder FahrplanDatenGarten.

python manage.py migrate

Import Stations from DB

python manage.py dbapis_importstations

Import Timetable from DB (optional)

python manage.py dbapis_timetable {StationName}

Update Journeys (optional)

python manage.py dbapis_journey

Start Webserver

python manage.py runserver

The Webserver now runs under http://127.0.0.1:8000/

fahrplandatengarten's People

Contributors

codedoctorde avatar dependabot[bot] avatar e1mo avatar fansel avatar leona-ya avatar lukas-gall avatar maedchenkunst2013 avatar marvinschopf avatar n0emis avatar pajowu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fahrplandatengarten's Issues

Replace traefik+nginx with caddy

Currently we use traefik and nginx together, which is not necessary and simply too much. I would recommend to use caddy because it is easy to configure, has a file server and also takes care of certificates.

Regenerate Verspaeti Cache on Access

When the verspaeti-cache is not populated, the website currently shows a messagebox. It would be nice, if this would trigger a celery-job, which regenerates the cache

shameless plug: use db-hafas JavaScript lib

Hey, just came across your project. Is it deployed somewhere to check it out?

db-hafas is a JavaScript client for the Deutsche Bahn mgate.exe API. Based on hafas-client, it has been used for years in several apps, supports many HAFAS features, and – most importantly – covers many edge cases.

In kennell/schiene#1 (comment), we've discussed on how you can use it with a language other than JS: spawn hafas-client-rpc with the stdin/stdout transport and send JSON-RPC from your Python code.

I'm aware that using a lib with another runtime (Node.js) is somewhat ugly, but given a complex, barely documented and ever-evolving system like HAFAS, we should try not to re-implement HAFAS clients everywhere.

Add light mode

If #34 will merged, FDG get's a dark theme by default and no light theme.
Therefore it would be good to have a light theme and respect prefers-colorscheme by browser + add a option to manually switch the colorscheme.

Add a Darkmode

  • respect prefers-colorscheme
  • add a option to manually switch the colorscheme

Train is added multiple times in database

Currently the TripID given by HAFAS is the identifier for a single trip. The problem is that these tripids change over time which leads to that the trip is added multiple times in database.

Failed building wheel for npyscreen

Huhu,
kriege seit Installation der requirements im venv folgenden Log:

(.venv) felix@Felix:/home/FahrplanDatenGarten$ pip install -r requirements.txt
Collecting django (from -r requirements.txt (line 1))
...
Building wheels for collected packages: npyscreen
  Running setup.py bdist_wheel for npyscreen ... error
  Complete output from command /home/FahrplanDatenGarten/.venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-igyjk7h9/npyscreen/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpy6od4v08pip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for npyscreen
  Running setup.py clean for npyscreen
Failed to build npyscreen
Installing collected packages: pytz, sqlparse, django, wheel, dj-database-url, certifi, urllib3, chardet, idna, requests, fdfgen, npyscreen, soupsieve, beautifulsoup4
Exception:
Traceback (most recent call last):
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/commands/install.py", line 360, in run
    prefix=options.prefix_path,
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/usr/lib/python3.6/os.py", line 220, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Keine Berechtigung: '/home/FahrplanDatenGarten/.venv/lib/python3.6/site-packages/pytz-2019.3.dist-info'
`

Wenn ich aber pip install -r requirements.txt verwende erhalte ich nur folgende Fehler:

...
Building wheels for collected packages: npyscreen
  Running setup.py bdist_wheel for npyscreen ... error
  Complete output from command /home/FahrplanDatenGarten/.venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-13r0kvy3/npyscreen/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp1t032nilpip-wheel- --python-tag cp36:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help
  
  error: invalid command 'bdist_wheel'
  
  ----------------------------------------
  Failed building wheel for npyscreen
  Running setup.py clean for npyscreen
Failed to build npyscreen
Installing collected packages: sqlparse, pytz, django, wheel, dj-database-url, idna, certifi, chardet, urllib3, requests, fdfgen, npyscreen, soupsieve, beautifulsoup4
  Running setup.py install for npyscreen ... done
Successfully installed beautifulsoup4-4.8.1 certifi-2019.9.11 chardet-3.0.4 dj-database-url-0.5.0 django-2.2.6 fdfgen-0.16.1 idna-2.8 npyscreen-4.10.5 pytz-2019.3 requests-2.22.0 soupsieve-1.9.4 sqlparse-0.3.0 urllib3-1.25.6 wheel-0.33.6
(.venv) felix@Felix:/home/FahrplanDatenGarten$  
`

'add_tmpfile' is undefined

When deploying a new worker, it threw the following error:

fatal: [neptun.local.e1mo.de]: FAILED! => {"msg": "The conditional check 'add_tmpfile.changed' failed. The error was: error while evaluating conditional (add_tmpfile.changed): 'add_tmpfile' is undefined\n\nThe error appears to be in '/home/user/projekte/jugendhackt/FahrplanDatenGarten/ansible/roles/worker.celery/handlers/main.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: create tmpdirs\n  ^ here\n"}

the variable add_tmpfile sems only to be used in
https://github.com/Jugendhackt/FahrplanDatenGarten/blob/c03f5e6dfae5ab476efdc0629218aea937bb1b9d/ansible/roles/worker.celery/handlers/main.yml#L5

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.