Skip to main content

Set of tools to extract fixtures from Django models navigating through the relationships of a given model to get a usable subset of the database.

Project description

https://badge.fury.io/py/django-fixtures-extractor.svg https://travis-ci.org/matibarriento/django-fixtures-extractor.svg?branch=master https://codecov.io/gh/matibarriento/django-fixtures-extractor/branch/master/graph/badge.svg

Extract specific data to a django fixture

Documentation

The full documentation is at https://django-fixtures-extractor.readthedocs.io.

Quickstart

Install Django Fixtures Extractor:

pip install django-fixtures-extractor

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'fixtures_extractor',
    ...
)

TODO Features

  • Make pipinstallable

  • Run CI/CD

Desired features

  • Add support for Django 1.11 to 5

  • Add supported model fields
  • Add feature: Obfuscate value

  • Add feature: Generate schema from model

  • Fix tox and pyenv to work together

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ python runtests.py

Development commands

pip install -r requirements/requirements_dev.txt
pip install -r requirements/requirements_test.txt

How to add a new app and add tests

  1. Create the app

$ cd tests/testproject
$ python ../../manage.py startapp {APP_NAME}
  1. Change the {APP_NAME}Config.name inside the tests/{APP_NAME}/apps.py file for tests.testproject.{APP_NAME}.apps.{APP_NAME}

  2. Add the app to the INSTALLED_APPS in the /testproject/testproject/settings.py file

  3. Write the models that you would use to test on the model folder inside your app

  4. Create the migrations using python manage.py makemigrations {APP_NAME}

  5. Run the migrations using python manage.py migrate

  6. Create the tests inside the tests/tests_orm_extractor.py file

Credits

Based on https://github.com/ascaliaio/django-dumpdata-one

Tools used in rendering this package:

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_fixtures_extractor-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_fixtures_extractor-0.1.0-py2.py3-none-any.whl (8.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django_fixtures_extractor-0.1.0.tar.gz.

File metadata

  • Download URL: django_fixtures_extractor-0.1.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7

File hashes

Hashes for django_fixtures_extractor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 82c1e4556738d4b30d73727a5174525c068cf6141a5d702787ca6cafe3c28537
MD5 b4398ddf2a51257fdca21a0e5d981b16
BLAKE2b-256 a3b8cc7fad1b80312136692dea7e16ea545ec58b5a017a99f10e6b9d5460401e

See more details on using hashes here.

File details

Details for the file django_fixtures_extractor-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_fixtures_extractor-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.10.0 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.19 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7

File hashes

Hashes for django_fixtures_extractor-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 14e25830c1b2ac1d8f05fec25c4113cb19735567f4ad7f6bda9ea333e6803d52
MD5 c5e19cf5789fe11c91cf66183485a5cd
BLAKE2b-256 e02348b49f973dab0ac46ad93f6e488e2e4a6bceff4b82b02e6105a6d06d877a

See more details on using hashes here.

Supported by

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