Skip to main content

No project description provided

Project description

django-pygwalker

Downloads OpenSSF Best Practices

PyPI - Python PyPI - Django

Turn your Django querysets into user interfaces for visual analysis with PyGWalker.

This utility creates user interfaces based on your Django querysets for visual analysis using PyGwalker. For more information on PyGWalker see the github repo available here: https://github.com/Kanaries/pygwalker


Code Quality

Workflow Description Status
Bandit security checks Bandit
Black code formatting Black
CodeQL security analysis CodeQL
Coveralls code coverage status Coveralls
Isort python import ordering Isort
Mypy static type checking Mypy
Pytest unit testing Pytest
Radon code complexity analysis Radon
Ruff static code analysis Ruff
Safety dependency scanner Saftey

Code Coverage

Coverage Status

Dashboard: https://coveralls.io/github/djangoaddicts/django-pygwalker


Documentation

Documentation Status

Full documentation can be found on http://django-pygwalker.readthedocs.org.

Documentation source files are available in the docs folder.


License

django-pygwalker is licensed under the GNU-3 license (see the LICENSE file for details).

https://github.com/djangoaddicts/django-pygwalker/blob/main/LICENSE


Installation

  • install via pip:

    pip install django-pygwalker
    
  • add the following to your INSTALLED_APPS in settings.py:

    djangoaddicts.pygwalker
    

    NOTE: adding djangoaddicts.pygwalker to INSTALLED_APPS is only required if you intend to use the built-in templates.


Features

PygWalkerView

The PygWalkerView renders a page containing PyGWalker html. This view takes a queryset parameter and includes all data in the queryset for visualizations. By default fields defined in the model will be included. To exclude fields or include additional fields (such as related fields), use the field_list parameter to specify exact fields desired for visualizations.

A Bootstrap 5 template is included, but can be overwritten using the template_name parameter.

Parameters

  • field_list: list of model fields to include (defaults to fields defined in the model)
  • queryset: queryset providing data available to visualization
  • theme: PyGWalker theme to use for pyg html (defaults to "media")
  • title: title used on html render
  • template_name: template used when rendering page; (defaults to pygwalker/bs5/pygwalker.html)

Usage Examples

from djangoaddicts.pygwalker.views import PygWalkerView

class MyPygWalkerView(PygWalkerView):
    queryset = MyModel.objects.all()

Explicitly Defined Fields

from djangoaddicts.pygwalker.views import PygWalkerView

class MyPygWalkerView(PygWalkerView):
    queryset = MyModel.objects.all()
    title = "MyModel Data Analysis"
    theme = "light"
    field_list = ["name", "some_field", "some_other__related_field", "id", "created_at", "updated_at"]

Custom Template

Custom views/templates can be used to override the Bootstrap 5 templates provided by default view. Here is an example:

from djangoaddicts.pygwalker.views import PygWalkerView

class MyPygWalkerView(PygWalkerView):
    queryset = MyModel.objects.all()
    template_name = "my_custom_template.html"

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-pygwalker-0.0.1.tar.gz (43.3 kB view hashes)

Uploaded Source

Built Distribution

django_pygwalker-0.0.1-py3-none-any.whl (30.4 kB view hashes)

Uploaded Python 3

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