All Projects → ra-systems → Django Slick Reporting

ra-systems / Django Slick Reporting

Licence: bsd-3-clause
Powerful and Efficient reporting engine with Charting capabilities

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Slick Reporting

Django Easy Timezones
Easy timezones for Django based on GeoIP
Stars: ✭ 195 (+58.54%)
Mutual labels:  django, easy-to-use
Django Admin Easy
Collection of admin fields and decorators to help to create computed or custom fields more friendly and easy way
Stars: ✭ 265 (+115.45%)
Mutual labels:  django, easy-to-use
Django Ra Erp
A Django based framework to create diverse business solutions, equipped with a reporting engine and a responsive dashboard.
Stars: ✭ 108 (-12.2%)
Mutual labels:  django, charting
Python Resources 2019
A curated list of Python 3 resources, books, websites, tutorials, code challenges
Stars: ✭ 125 (+1.63%)
Mutual labels:  django
Wagtail
A Django content management system focused on flexibility and user experience
Stars: ✭ 11,387 (+9157.72%)
Mutual labels:  django
Form Validation.js
The most customizable validation framework for JavaScript.
Stars: ✭ 127 (+3.25%)
Mutual labels:  easy-to-use
Pref
Portable Reverse Engineering Framework
Stars: ✭ 127 (+3.25%)
Mutual labels:  analysis
Impostor
Django app that enables staff to log in as other users using their own credentials.
Stars: ✭ 124 (+0.81%)
Mutual labels:  django
Sharpbot
A Discord.js selfbot written by Rayzr - 60 second installation!
Stars: ✭ 127 (+3.25%)
Mutual labels:  easy-to-use
Django Init
Project template used at Fueled for scaffolding new Django based projects. 💫
Stars: ✭ 126 (+2.44%)
Mutual labels:  django
Stfalconimageviewer
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures
Stars: ✭ 1,734 (+1309.76%)
Mutual labels:  easy-to-use
List.js
The perfect library for adding search, sort, filters and flexibility to tables, lists and various HTML elements. Built to be invisible and work on existing HTML.
Stars: ✭ 10,650 (+8558.54%)
Mutual labels:  easy-to-use
Screenshots
Simple Website Screenshots as a Service (Django, Selenium, Docker, Docker-compose)
Stars: ✭ 126 (+2.44%)
Mutual labels:  django
Mwdb Core
Malware repository component for samples & static configuration with REST API interface.
Stars: ✭ 125 (+1.63%)
Mutual labels:  analysis
Timestrap
Time tracking you can host anywhere. Full export support in multiple formats and easily extensible.
Stars: ✭ 1,607 (+1206.5%)
Mutual labels:  django
Django Fields
Fields pack for django framework.
Stars: ✭ 124 (+0.81%)
Mutual labels:  django
Django Structlog
Structured Logging for Django
Stars: ✭ 127 (+3.25%)
Mutual labels:  django
Tybalt
Training and evaluating a variational autoencoder for pan-cancer gene expression data
Stars: ✭ 126 (+2.44%)
Mutual labels:  analysis
Elasticstack
📇 Configurable indexing and other extras for Haystack (with ElasticSearch biases)
Stars: ✭ 125 (+1.63%)
Mutual labels:  django
Djangocms Text Ckeditor
Text Plugin for django CMS using CKEditor 4
Stars: ✭ 126 (+2.44%)
Mutual labels:  django

.. image:: https://img.shields.io/pypi/v/django-slick-reporting.svg :target: https://pypi.org/project/django-slick-reproting

.. image:: https://img.shields.io/pypi/pyversions/django-slick-reporting.svg :target: https://pypi.org/project/django-slick-reporting

.. image:: https://img.shields.io/readthedocs/django-slick-reporting :target: https://django-slick-reporting.readthedocs.io/

.. image:: https://api.travis-ci.org/ra-systems/django-slick-reporting.svg?branch=master :target: https://travis-ci.org/ra-systems/django-slick-reporting

.. image:: https://img.shields.io/codecov/c/github/ra-systems/django-slick-reporting :target: https://codecov.io/gh/ra-systems/django-slick-reporting

Django Slick Reporting

A one stop reports engine with batteries included.

Features

  • Effortlessly create Simple, Grouped, Time series and Crosstab reports in a handful of code lines.
  • Create your Custom Calculation easily, which will be integrated with the above reports types
  • Optimized for speed.
  • Batteries included! Charts.js , DataTable.net & a Bootstrap form.

Installation

Use the package manager pip <https://pip.pypa.io/en/stable/>_ to install django-slick-reporting.

.. code-block:: console

    pip install django-slick-reporting

Usage

So you have a model that contains data, let's call it MySalesItems

You can simply use a code like this

.. code-block:: python

# in your urls.py
path('path-to-report', TotalProductSales.as_view())


# in views.py
from django.db.models import Sum
from slick_reporting.views import SlickReportView
from slick_reporting.fields import SlickReportField
from .models import MySalesItems

class TotalProductSales(SlickReportView):

    report_model = MySalesItems
    date_field = 'date_placed'
    group_by = 'product'
    columns = ['title',
                SlickReportField.create(Sum, 'quantity') ,
                SlickReportField.create(Sum, 'value', name='sum__value') ]

    chart_settings = [{
        'type': 'column',
        'data_source': ['sum__value'],
        'plot_total': False,
        'title_source': 'title',
        'title': _('Detailed Columns'),

    }, ]

To get something like this

.. image:: https://i.ibb.co/SvxTM23/Selection-294.png :target: https://i.ibb.co/SvxTM23/Selection-294.png :alt: Shipped in View Page

You can do a monthly time series :

.. code-block:: python

# in views.py
from slick_reporting.views import SlickReportView
from slick_reporting.fields import SlickReportField
from .models import MySalesItems

class MonthlyProductSales(SlickReportView):
    report_model = MySalesItems
    date_field = 'date_placed'
    group_by = 'product'
    columns = ['name', 'sku']

    # Analogy for time series
    time_series_pattern = 'monthly'
    time_series_columns = [SlickReportField.create(Sum, 'quantity', name='sum__quantity') ]

This would return a table looking something like this:

+--------------+----------------------+-----------------+----------------+-----------------------+-------------------------------+ | Product Name | SKU | Total Quantity | Total Quantity | Total Quantity in ... | Total Quantity in December 20 | | | | in Jan 20 | in Feb 20 | | | +--------------+----------------------+-----------------+----------------+-----------------------+-------------------------------+ | Product 1 | | 10 | 15 | ... | 14 | +--------------+----------------------+-----------------+----------------+-----------------------+-------------------------------+ | Product 2 | | 11 | 12 | ... | 12 | +--------------+----------------------+-----------------+----------------+-----------------------+-------------------------------+ | Product 3 | | 17 | 12 | ... | 17 | +--------------+----------------------+-----------------+----------------+-----------------------+-------------------------------+

This example code assumes your "MySalesItems" model contains the fields product as foreign key, quantity as number , and date_placed as a date field. It also assumes your Product model has an SKU field.. Change those to better suit your structure.

--

On a low level

You can interact with the ReportGenerator using same syntax as used with the SlickReportView .

.. code-block:: python

from slick_reporting.generator import ReportGenerator
from . models import MySalesModel

report = ReportGenerator(report_model=MySalesModel,
                        group_by='product',
                        columns=['title', '__total__']
)
report.get_report_data() #-> [{'title':'Product 1', '__total__: 56}, {'title':'Product 2', '__total__: 43}, ]

This is just a scratch, for more please visit the documentation

Batteries Included

Slick Reporting comes with

  • A Bootstrap Filter Form
  • Charting support Charts.js <https://www.chartjs.org/>_
  • Powerful tables datatables.net <https://datatables.net/>_

A Preview:

.. image:: https://i.ibb.co/SvxTM23/Selection-294.png :target: https://i.ibb.co/SvxTM23/Selection-294.png :alt: Shipped in View Page

Documentation

Available on Read The Docs <https://django-slick-reporting.readthedocs.io/en/latest/>_

Road Ahead

This project is young and can use your support.

Some of the ideas / features that ought be added

  • Support Other backends like SQL Alchemy & Pandas
  • Support Grouping by non foreign key fields
  • Support Time Series and Crosstab at the same time

Running tests

Create a virtual environment (maybe with virtual slick_reports_test), activate it; Then ,

.. code-block:: console

$ git clone [email protected]:ra-systems/django-slick-reporting.git
$ cd tests
$ python -m pip install -e ..

$ python runtests.py
#     Or for Coverage report
$ coverage run --include=../* runtests.py [-k]
$ coverage html

Support & Contributing

Please consider star the project to keep an eye on it. Your PRs, reviews are most welcome and needed.

We honor the well formulated Django's guidelines <https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/>_ to serve as contribution guide here too.

Authors

  • Ramez Ashraf - Initial work - RamezIssac <https://github.com/RamezIssac>_

Cross Reference

If you like this package, chances are you may like those packages too!

Django Tabular Permissions <https://github.com/RamezIssac/django-tabular-permissions>_ Display Django permissions in a HTML table that is translatable and easy customized.

Django Ra ERP Framework <https://github.com/ra-systems/RA>_ A framework to build business solutions with ease.

If you find this project useful or promising , You can support us by a github ⭐

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].