Skip to main content

Basic metro models for Django 1.7+, plus the parser that fills models with actual data (lines numbers, lines titles, lines colors, the names of the lines, the station names) from various data sources (primary - Wikipedia).

Project description

django-metro

Metro models for Django (for 2+, for django 1.x support use 0.4.2 version), plus the parser that fills models with actual data from various data providers (primary - Wikipedia). This is renamed django-russian-metro package (!).

All russian and cis parsers (like kiev or minsk) respects locale, that’s why for en locale they returns transliterated version of names. Parsers for other cities takes only english names.

Parser downloads the following data:

  • MetroLine: number, color and title

  • Metro: line binding, title

Also you can run django command sometimes to get always actual data, or use celery task load_metro.

Installing

  1. For install django-metro, run on terminal:

    $ pip install django-metro
  2. Then add this app to INSTALLED_APPS:

    INSTALLED_APPS = (
        ...
        'metro',
        ...
    )
  3. Apply migrations:

    ./manage.py migrate
  4. Choose and specify data provider in settings.py:

    METRO_PROVIDER = 'moscow'
  5. Finally, fill models with data:

    ./manage.py load_metro
  6. Or:

    from metro.parser import provider
    provider.download_all()
  7. Or use celery task load_metro (shared task in tasks.py)

Current available data providers

(list updated)

Assign METRO_PROVIDER (in settings.py) one of the values below (source indicated in brackets):

Russia

  • 'moscow' – Moscow (Wiki)

  • 'spb' – Saint Petersburg (Wiki)

  • 'novgorod' – Nizhny Novgorod (Wiki)

  • 'novosib' – Novosibirsk (Wiki)

  • 'ekat' – Yekaterinburg (Wiki/self)

  • 'kazan' – Kazan (Wiki)

  • 'samara' – Samara (Wiki)

  • 'omsk' – Omsk (self) :)

CIS

  • 'kiev' – Kiev (Wiki)

  • 'minsk' – Minsk (Wiki)

World

  • 'tokyo' – Tokyo (Wiki)

  • 'london' – London (Wiki), very basic (without zones and branches)

Other stuff

You can rename application title with METRO_APP_TITLE in your settings.py:

METRO_APP_TITLE = u'Saint Petersrburg Metro'

Adopted for django-suit (SortableStackedInline).

License

MIT probably.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-metro-0.4.5.tar.gz (10.7 kB view details)

Uploaded Source

Built Distributions

django_metro-0.4.5-py3-none-any.whl (18.7 kB view details)

Uploaded Python 3

django_metro-0.4.5-py2-none-any.whl (20.4 kB view details)

Uploaded Python 2

File details

Details for the file django-metro-0.4.5.tar.gz.

File metadata

  • Download URL: django-metro-0.4.5.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.10

File hashes

Hashes for django-metro-0.4.5.tar.gz
Algorithm Hash digest
SHA256 e0f9e40049158c482440ef0ef6a830fde0fc3de0940e5a0d86cc353571a24f78
MD5 499c75c2f183435dd301026897a80d4e
BLAKE2b-256 8b2b5c14064f55fb7d3801ce84ef45857b5610a538e36404c2405a6541e88316

See more details on using hashes here.

File details

Details for the file django_metro-0.4.5-py3-none-any.whl.

File metadata

  • Download URL: django_metro-0.4.5-py3-none-any.whl
  • Upload date:
  • Size: 18.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.10

File hashes

Hashes for django_metro-0.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5112c58afb33f0cc14f7f493f65bd5e9e03760cef5558d4f79c8ae0904dfbf4e
MD5 8b8d7b14c226a72307523e51d0f67463
BLAKE2b-256 2af2f6ac74c54dd247a6ce251f9fa179e56616b374df623c72383f7fdbd2e27f

See more details on using hashes here.

File details

Details for the file django_metro-0.4.5-py2-none-any.whl.

File metadata

  • Download URL: django_metro-0.4.5-py2-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/2.7.10

File hashes

Hashes for django_metro-0.4.5-py2-none-any.whl
Algorithm Hash digest
SHA256 2e3bb752179b4b184e1773e6ddab05068d4b2d76cedf4769a0628b9a446e216d
MD5 823135fcf50c7dd8bb4e0153c3d79f0a
BLAKE2b-256 a2ad9fa766a4441ed1c17ba7545ad34b3f8a6612ab7ad44c449156514cca5bc0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page