Skip to main content

A pluggable Django app for the EVE SDE

Project description


Build Status Coverage Status

armada-sde is a pluggable app for Django which provides models and tools for using Fuzzysteve's PostgreSQL dumps. Its design allows you to automate upgrades of the SDE data and generate new models for any tables contained therein.


Grab the latest version of armada-sde directly from PyPI:

pip install armada-sde

Add it to Django's

    # ...

Download Fuzzysteve's latest schema dump for postgres and unpack:

bunzip2 postgres-schema-latest.dmp.bz2

Import the dump

python pg_import_sde -f postgres-schema-latest.dmp

If you want to handle the importing yourself, run pg_import_sde with -s and no -f. This will rename the tables, so to better fit with Django best practices.

After import, the tables needs to be moved from the evesde schema to the public schema:

python pg_move_sde

You should now be able to import models and use them:

from django.db import models
from armada_sde.models import InvType

# Trit for the trit god
trit = InvType.objects.get(name='Tritanium')

# Use it in your models

class ShoppingListItem(models.Model):
    quantity = models.IntegerField(default=1)
    item = models.ForeignKey(InvType, on_delete=models.DO_NOTHING)

Advanced usage

Generate models

armada_sde comes with a stock set of models which is generated automatically through a customized version of Django's inspectdb command. You can generate your own set of models and do your own alterations, if you like. First, import the dump as previously described, so it is present in the evesde schema. Then you can generate a models file:

python pg_generate_models -o project/myapp/

After generation, move the tables into the public schema and generate primary keys, with the pg_move_sde command. You can now do any alterations you like. If you would like to generate migrations for your models, remove managed = False from the Meta class.

If you want, you can also ensure compatibility with other pluggable apps that use the SDE models, by configuring armada_sde to load your custom variants instead of the stock models. Add this to your

    'SDE': {
        'module': 'project.myapp.models'

Any other app importing models from armada_sde.models, will instead be loading your custom models from your project.

Using a custom schema for the SDE

If you are sharing a database between several projects, it might be handy to have a shared schema for the SDE. You can configure armada-sde to use a custom destination schema for tables, instead of moving them from evesde into public.

To achieve this, set these parameters in

    'SDE': {
        'schema': '<your_sde_schema>'

It is not a good idea to use the evesde schema as your custom schema, as it might give you issues when upgrading the SDE.

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

armada-sde-0.3.0.tar.gz (22.4 kB view hashes)

Uploaded source

Built Distribution

armada_sde-0.3.0-py2.py3-none-any.whl (28.5 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page