Skip to main content

django-metro

Metro models for Django (only for 1.7+), 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.

Metadata

Release files for django-metro 0.4.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-metro 0.4.2
File Size Uploaded Provenance Actions
django-metro-0.4.2.tar.gz 11.9 kB Without provenance Details for django-metro-0.4.2.tar.gz

Release files / django-metro-0.4.2.tar.gz

Download URL django-metro-0.4.2.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2467448a9532556df5677ff6e4eb51f675afed0a00440a06ba8f0892d9e7578e
BLAKE2b-256 checksum
How to use checksums
a8253986da004137503553002a2efb672cbe75581fe3b1fc3e17cdc9cc36a7d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-metro 0.4.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page