{"id":24880173,"url":"https://github.com/ramezissac/django-slick-reporting","last_synced_at":"2026-05-02T08:05:28.312Z","repository":{"id":41485528,"uuid":"257525048","full_name":"RamezIssac/django-slick-reporting","owner":"RamezIssac","description":"The Reporting Engine for Django. Create dashboards and standalone Reports and Charts.","archived":false,"fork":false,"pushed_at":"2024-08-20T12:48:43.000Z","size":743,"stargazers_count":586,"open_issues_count":25,"forks_count":47,"subscribers_count":19,"default_branch":"develop","last_synced_at":"2025-04-13T05:06:06.478Z","etag":null,"topics":["analysis","analytics","charting","charts","customisable","django","easy-to-use","pivot-tables","python","reporting","time-series"],"latest_commit_sha":null,"homepage":"https://django-slick-reporting.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RamezIssac.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-21T08:07:28.000Z","updated_at":"2025-04-07T11:32:50.000Z","dependencies_parsed_at":"2023-09-28T11:34:57.850Z","dependency_job_id":"f6eb69e2-c1cb-4c5b-bcc9-3ce7663b19f5","html_url":"https://github.com/RamezIssac/django-slick-reporting","commit_stats":{"total_commits":348,"total_committers":17,"mean_commits":"20.470588235294116","dds":0.3017241379310345,"last_synced_commit":"382dab9c25c5556c562e7e2cfeac9b65fb84fa52"},"previous_names":["ramezissac/django-slick-reporting","ra-systems/django-slick-reporting"],"tags_count":43,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamezIssac%2Fdjango-slick-reporting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamezIssac%2Fdjango-slick-reporting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamezIssac%2Fdjango-slick-reporting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RamezIssac%2Fdjango-slick-reporting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RamezIssac","download_url":"https://codeload.github.com/RamezIssac/django-slick-reporting/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665748,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","analytics","charting","charts","customisable","django","easy-to-use","pivot-tables","python","reporting","time-series"],"created_at":"2025-02-01T10:19:44.964Z","updated_at":"2025-12-13T23:56:30.092Z","avatar_url":"https://github.com/RamezIssac.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. image:: https://img.shields.io/pypi/v/django-slick-reporting.svg\n    :target: https://pypi.org/project/django-slick-reporting\n\n.. image:: https://img.shields.io/pypi/pyversions/django-slick-reporting.svg\n    :target: https://pypi.org/project/django-slick-reporting\n\n.. image:: https://img.shields.io/readthedocs/django-slick-reporting\n    :target: https://django-slick-reporting.readthedocs.io/\n\n.. image:: https://api.travis-ci.com/ra-systems/django-slick-reporting.svg?branch=master\n    :target: https://app.travis-ci.com/github/ra-systems/django-slick-reporting\n\n.. image:: https://img.shields.io/codecov/c/github/ra-systems/django-slick-reporting\n    :target: https://codecov.io/gh/ra-systems/django-slick-reporting\n\n\n\n\nDjango Slick Reporting\n======================\n\nA one stop reports engine with batteries included.\n\nFeatures\n--------\n\n- Effortlessly create Simple, Grouped, Time series and Crosstab reports in a handful of code lines.\n- Create Chart(s) for your reports with a single line of code.\n- Create Custom complex Calculation.\n- Optimized for speed.\n- Easily extendable.\n\nInstallation\n------------\n\nUse the package manager `pip \u003chttps://pip.pypa.io/en/stable/\u003e`_ to install django-slick-reporting.\n\n.. code-block:: console\n\n        pip install django-slick-reporting\n\n\nUsage\n-----\n\nSo we have a model `SalesTransaction` which contains typical data about a sale.\nWe can extract different kinds of information for that model.\n\nLet's start by a \"Group by\" report. This will generate a report how much quantity and value was each product sold within a certain time.\n\n.. code-block:: python\n\n\n    # in views.py\n    from django.db.models import Sum\n    from slick_reporting.views import ReportView, Chart\n    from slick_reporting.fields import ComputationField\n    from .models import MySalesItems\n\n\n    class TotalProductSales(ReportView):\n        report_model = SalesTransaction\n        date_field = \"date\"\n        group_by = \"product\"\n        columns = [\n            \"name\",\n            ComputationField.create(\n                Sum, \"quantity\", verbose_name=\"Total quantity sold\", is_summable=False\n            ),\n            ComputationField.create(\n                Sum, \"value\", name=\"sum__value\", verbose_name=\"Total Value sold $\"\n            ),\n        ]\n\n        chart_settings = [\n            Chart(\n                \"Total sold $\",\n                Chart.BAR,\n                data_source=[\"sum__value\"],\n                title_source=[\"name\"],\n            ),\n            Chart(\n                \"Total sold $ [PIE]\",\n                Chart.PIE,\n                data_source=[\"sum__value\"],\n                title_source=[\"name\"],\n            ),\n        ]\n\n\n    # then, in urls.py\n    path(\"total-sales-report\", TotalProductSales.as_view())\n\n\n\nWith this code, you will get something like this:\n\n.. image:: https://i.ibb.co/SvxTM23/Selection-294.png\n    :target: https://i.ibb.co/SvxTM23/Selection-294.png\n    :alt: Shipped in View Page\n\n\nTime Series\n-----------\n\nA Time series report is a report that is generated for a periods of time.\nThe period can be daily, weekly, monthly, yearly or custom. Calculations will be performed for each period in the time series.\n\nExample: How much was sold in value for each product monthly within a date period ?\n\n.. code-block:: python\n\n    # in views.py\n    from slick_reporting.views import ReportView\n    from slick_reporting.fields import ComputationField\n    from .models import SalesTransaction\n\n\n    class MonthlyProductSales(ReportView):\n        report_model = SalesTransaction\n        date_field = \"date\"\n        group_by = \"product\"\n        columns = [\"name\", \"sku\"]\n\n        time_series_pattern = \"monthly\"\n        # or \"yearly\" , \"weekly\" , \"daily\" , others and custom patterns\n        time_series_columns = [\n            ComputationField.create(\n                Sum, \"value\", verbose_name=_(\"Sales Value\"), name=\"value\"\n            )  # what will be calculated for each month\n        ]\n\n        chart_settings = [\n            Chart(\n                _(\"Total Sales Monthly\"),\n                Chart.PIE,\n                data_source=[\"value\"],\n                title_source=[\"name\"],\n                plot_total=True,\n            ),\n            Chart(\n                \"Total Sales [Area chart]\",\n                Chart.AREA,\n                data_source=[\"value\"],\n                title_source=[\"name\"],\n                plot_total=False,\n            ),\n        ]\n\n\n.. image:: https://github.com/ra-systems/django-slick-reporting/blob/develop/docs/source/topics/_static/timeseries.png?raw=true\n    :alt: Time Series Report\n    :align: center\n\nCross Tab\n---------\nUse crosstab reports, also known as matrix reports, to show the relationships between three or more query items.\nCrosstab reports show data in rows and columns with information summarized at the intersection points.\n\n.. code-block:: python\n\n        # in views.py\n        from slick_reporting.views import ReportView\n        from slick_reporting.fields import ComputationField\n        from .models import MySalesItems\n\n\n        class MyCrosstabReport(ReportView):\n\n            crosstab_field = \"client\"\n            crosstab_ids = [1, 2, 3]\n            crosstab_columns = [\n                ComputationField.create(Sum, \"value\", verbose_name=_(\"Value for\")),\n            ]\n            crosstab_compute_remainder = True\n\n            columns = [\n                \"some_optional_field\",\n                # You can customize where the crosstab columns are displayed in relation to the other columns\n                \"__crosstab__\",\n                # This is the same as the Same as the calculation in the crosstab, but this one will be on the whole set. IE total value\n                ComputationField.create(Sum, \"value\", verbose_name=_(\"Total Value\")),\n            ]\n\n\n.. image:: https://github.com/ra-systems/django-slick-reporting/blob/develop/docs/source/topics/_static/crosstab.png?raw=true\n   :alt: Homepage\n   :align: center\n\n\nLow level\n---------\n\nThe view is a wrapper over the `ReportGenerator` class, which is the core of the reporting engine.\nYou can interact with the `ReportGenerator` using same syntax as used with the `ReportView` .\n\n.. code-block:: python\n\n    from slick_reporting.generator import ReportGenerator\n    from .models import MySalesModel\n\n\n    class MyReport(ReportGenerator):\n        report_model = MySalesModel\n        group_by = \"product\"\n        columns = [\"title\", \"__total__\"]\n\n\n    # OR\n    my_report = ReportGenerator(\n        report_model=MySalesModel, group_by=\"product\", columns=[\"title\", \"__total__\"]\n    )\n    my_report.get_report_data()  # -\u003e [{'title':'Product 1', '__total__: 56}, {'title':'Product 2', '__total__: 43}, ]\n\n\nThis is just a scratch of what you can do and customize.\n\nDemo site\n---------\n\nAvailable on `Django Slick Reporting \u003chttps://django-slick-reporting.com/\u003e`_\n\n\nYou can also use locally\n\n.. code-block:: console\n\n        # clone the repo\n        git clone https://github.com/ra-systems/django-slick-reporting.git\n        # create a virtual environment and activate it\n        python -m venv /path/to/new/virtual/environment\n        source /path/to/new/virtual/environment/bin/activate\n\n        cd django-slick-reporting/demo_proj\n        pip install -r requirements.txt\n        python manage.py migrate\n        python manage.py create_entries\n        python manage.py runserver\n\nthe ``create_entries`` command will generate data for the demo app\n\nDocumentation\n-------------\n\nAvailable on `Read The Docs \u003chttps://django-slick-reporting.readthedocs.io/en/latest/\u003e`_\n\nYou can run documentation locally\n\n.. code-block:: console\n\n    \u003cactivate your virtual environment\u003e\n    cd docs\n    pip install -r requirements.txt\n    sphinx-build -b html source build\n\n\nRoad Ahead\n----------\n\n* Continue on enriching the demo project\n* Add the dashboard capabilities\n\n\nRunning tests\n-----------------\nCreate a virtual environment (maybe with `virtual slick_reports_test`), activate it; Then ,\n \n.. code-block:: console\n    \n    $ git clone git+git@github.com:ra-systems/django-slick-reporting.git\n    $ cd tests\n    $ python -m pip install -e ..\n\n    $ python runtests.py\n    #     Or for Coverage report\n    $ coverage run --include=../* runtests.py [-k]\n    $ coverage html\n\n\nSupport \u0026 Contributing\n----------------------\n\nPlease consider star the project to keep an eye on it. Your PRs, reviews are most welcome and needed.\n\nWe honor the well formulated `Django's guidelines \u003chttps://docs.djangoproject.com/en/dev/internals/contributing/writing-code/unit-tests/\u003e`_ to serve as contribution guide here too.\n\n\nAuthors\n--------\n\n* **Ramez Ashraf** - *Initial work* - `RamezIssac \u003chttps://github.com/RamezIssac\u003e`_\n\nCross Reference\n---------------\n\nIf you like this package, chances are you may like those packages too!\n\n`Django Tabular Permissions \u003chttps://github.com/RamezIssac/django-tabular-permissions\u003e`_ Display Django permissions in a HTML table that is translatable and easy customized.\n\n`Django ERP Framework \u003chttps://github.com/ra-systems/RA\u003e`_ A framework to build business solutions with ease.\n\nIf you find this project useful or promising , You can support us by a github ⭐\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framezissac%2Fdjango-slick-reporting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framezissac%2Fdjango-slick-reporting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framezissac%2Fdjango-slick-reporting/lists"}