=============================
django_charts
=============================
.. image:: https://badge.fury.io/py/acdh-django-charts.svg
:target: https://badge.fury.io/py/acdh-django-charts
.. image:: https://travis-ci.org/acdh-oeaw/acdh-django-charts.svg?branch=master
:target: https://travis-ci.org/acdh-oeaw/acdh-django-charts
.. image:: https://codecov.io/gh/acdh-oeaw/acdh-django-charts/branch/master/graph/badge.svg
:target: https://codecov.io/gh/acdh-oeaw/acdh-django-charts
An app to explore your data through charts based on Highcharts.js
Documentation
-------------
The full documentation is at https://acdh-django-charts.readthedocs.io.
Quickstart
----------
Install django_charts::
pip install acdh-django-charts
Add it to your `INSTALLED_APPS`:
.. code-block:: python
INSTALLED_APPS = (
...
'charts',
...
)
Add django_charts's URL patterns:
.. code-block:: python
urlpatterns = [
...
url(r'^charts/', include('charts.urls', namespace='charts')),
...
]
By default the app's templates extend a base template `webpage/base.html`. To ovveride this, just define a `CHARTS_BASE_TEMPLATE` variable on your project's `settings.py` like e.g:
.. code-block:: python
CHARTS_BASE_TEMPLATE = 'base.html'
To link to the application's 'chart-selector-view' you can add something like the snippet below to your e.g. base-template:
.. code-block:: html
<a href="{% url 'charts:chart_selector' %}">Charts</a>
Configuration
-------------
To visualize any property of your model you have to pass in the models name (lowercase), the field-path (using django's lookup syntax `__` to follow foreign key and many2many relations) and the chart type (bar|line|pie) via keyword arguments to the `charts.views.DynChartView()`. In case those params are valid (i.d. the model and the lookup path acutally exist) the according chart should be drawn. But be aware that this only works if your project's `DEBUG` settings are set to `True`.
As **recomended** alternative you should create `ChartConfig` objects for each property/model you'd like to explore via django admin-backend.
management commands
-------------------
The package ships with a management command to
* create/delete chartconfig objects (Bar, Pie, Linecharts)
.. code-block:: console
python manage.py create_charttypes
.. code-block:: console
python manage.py delete_charttypes
* create/delete ChartConfig objects per application
.. code-block:: console
python manage.py create_charts <app_name>
.. code-block:: console
python manage.py delete_charts <app_name>
Build and publish
-----------------
.. code-block:: console
python setup.py sdist bdist_wheel
twine upload dist/*
Features
--------
* Visualizes aggregated values of your models as charts (pie/bar/line) using https://www.highcharts.com/
* Charts can be configured via admin backend (see Configuration Section)
Running Tests
-------------
Does the code actually work?
::
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox
Credits
-------
Tools used in rendering this package:
* Cookiecutter_
* `cookiecutter-djangopackage`_
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
History
-------
0.5.4 (2019-10-11)
++++++++++++++++++
* values always returned as strings -> BooleanFields are displayed now
0.5.3 (2019-02-12)
++++++++++++++++++
* reworte code to fetch payload data to avoid mysterious duplicated values
0.5.2 (2018-12-18)
++++++++++++++++++
* improved admin interface for ChartConfig
0.5.1 (2018-12-05)
++++++++++++++++++
* added management commands to create ChartType and ChartConfig objects.
0.5.0 (2018-10-25)
++++++++++++++++++
* added `app_name` param to ChartConfig to avoid ambiguity in case models in different apps do have the same name.
0.4.1 (2018-07-12)
++++++++++++++++++
* minor change in dropdown template tag
0.4.0 (2018-07-10)
++++++++++++++++++
* refactoring of templates by introducing template tags
0.3.0 (2018-06-13)
++++++++++++++++++
* removed work in progress banner
0.3.0 (2018-06-05)
++++++++++++++++++
* In case of DEBUG=False only fieldpaths/models can be explored which are registerd in dedicated ChartConfig objects.
0.2.0 (2018-06-01)
++++++++++++++++++
* Base templates can now be configured in settings-param
0.1.0 (2018-06-01)
++++++++++++++++++
* First release on PyPI.
Raw data
{
"_id": null,
"home_page": "https://github.com/acdh-oeaw/acdh-django-charts",
"name": "acdh-django-charts",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "acdh-django-charts",
"author": "Peter Andorfer",
"author_email": "peter.andorfer@oeaw.ac.at",
"download_url": "https://files.pythonhosted.org/packages/12/96/bbe478c5f49e8b66d503d0446d2cd63ef49035416c7406debb89d0ecee1d/acdh-django-charts-0.6.0.tar.gz",
"platform": null,
"description": "=============================\ndjango_charts\n=============================\n\n.. image:: https://badge.fury.io/py/acdh-django-charts.svg\n :target: https://badge.fury.io/py/acdh-django-charts\n\n.. image:: https://travis-ci.org/acdh-oeaw/acdh-django-charts.svg?branch=master\n :target: https://travis-ci.org/acdh-oeaw/acdh-django-charts\n\n.. image:: https://codecov.io/gh/acdh-oeaw/acdh-django-charts/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/acdh-oeaw/acdh-django-charts\n\nAn app to explore your data through charts based on Highcharts.js\n\nDocumentation\n-------------\n\nThe full documentation is at https://acdh-django-charts.readthedocs.io.\n\nQuickstart\n----------\n\nInstall django_charts::\n\n pip install acdh-django-charts\n\nAdd it to your `INSTALLED_APPS`:\n\n.. code-block:: python\n\n INSTALLED_APPS = (\n ...\n 'charts',\n ...\n )\n\nAdd django_charts's URL patterns:\n\n.. code-block:: python\n\n urlpatterns = [\n ...\n url(r'^charts/', include('charts.urls', namespace='charts')),\n ...\n ]\n\nBy default the app's templates extend a base template `webpage/base.html`. To ovveride this, just define a `CHARTS_BASE_TEMPLATE` variable on your project's `settings.py` like e.g:\n\n.. code-block:: python\n\n CHARTS_BASE_TEMPLATE = 'base.html'\n\nTo link to the application's 'chart-selector-view' you can add something like the snippet below to your e.g. base-template:\n\n.. code-block:: html\n\n <a href=\"{% url 'charts:chart_selector' %}\">Charts</a>\n\nConfiguration\n-------------\n\nTo visualize any property of your model you have to pass in the models name (lowercase), the field-path (using django's lookup syntax `__` to follow foreign key and many2many relations) and the chart type (bar|line|pie) via keyword arguments to the `charts.views.DynChartView()`. In case those params are valid (i.d. the model and the lookup path acutally exist) the according chart should be drawn. But be aware that this only works if your project's `DEBUG` settings are set to `True`.\nAs **recomended** alternative you should create `ChartConfig` objects for each property/model you'd like to explore via django admin-backend.\n\nmanagement commands\n-------------------\n\nThe package ships with a management command to\n\n* create/delete chartconfig objects (Bar, Pie, Linecharts)\n\n.. code-block:: console\n\n python manage.py create_charttypes\n\n.. code-block:: console\n\n python manage.py delete_charttypes\n\n* create/delete ChartConfig objects per application\n\n.. code-block:: console\n\n python manage.py create_charts <app_name>\n\n.. code-block:: console\n\n python manage.py delete_charts <app_name>\n\nBuild and publish\n-----------------\n\n.. code-block:: console\n\n python setup.py sdist bdist_wheel\n twine upload dist/*\n\n\n\nFeatures\n--------\n\n* Visualizes aggregated values of your models as charts (pie/bar/line) using https://www.highcharts.com/\n* Charts can be configured via admin backend (see Configuration Section)\n\nRunning Tests\n-------------\n\nDoes the code actually work?\n\n::\n\n source <YOURVIRTUALENV>/bin/activate\n (myenv) $ pip install tox\n (myenv) $ tox\n\nCredits\n-------\n\nTools used in rendering this package:\n\n* Cookiecutter_\n* `cookiecutter-djangopackage`_\n\n.. _Cookiecutter: https://github.com/audreyr/cookiecutter\n.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage\n\n\n\n\nHistory\n-------\n\n0.5.4 (2019-10-11)\n++++++++++++++++++\n\n* values always returned as strings -> BooleanFields are displayed now\n\n0.5.3 (2019-02-12)\n++++++++++++++++++\n\n* reworte code to fetch payload data to avoid mysterious duplicated values\n\n0.5.2 (2018-12-18)\n++++++++++++++++++\n\n* improved admin interface for ChartConfig\n\n0.5.1 (2018-12-05)\n++++++++++++++++++\n\n* added management commands to create ChartType and ChartConfig objects.\n\n0.5.0 (2018-10-25)\n++++++++++++++++++\n\n* added `app_name` param to ChartConfig to avoid ambiguity in case models in different apps do have the same name.\n\n0.4.1 (2018-07-12)\n++++++++++++++++++\n\n* minor change in dropdown template tag\n\n0.4.0 (2018-07-10)\n++++++++++++++++++\n\n* refactoring of templates by introducing template tags\n\n0.3.0 (2018-06-13)\n++++++++++++++++++\n\n* removed work in progress banner\n\n0.3.0 (2018-06-05)\n++++++++++++++++++\n\n* In case of DEBUG=False only fieldpaths/models can be explored which are registerd in dedicated ChartConfig objects.\n\n0.2.0 (2018-06-01)\n++++++++++++++++++\n\n* Base templates can now be configured in settings-param\n\n0.1.0 (2018-06-01)\n++++++++++++++++++\n\n* First release on PyPI.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An app to explore your data through charts based on Highcharts.js",
"version": "0.6.0",
"split_keywords": [
"acdh-django-charts"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "77f91bd8e9bcc761329b32d0233125592d37d09d945df41cfbe816b9076cde1b",
"md5": "25c53c4fbba20aa322d44e8a7710334c",
"sha256": "e13a10e24fe7f275544384a759be5fcf3c52ce70c74465d449e5ba75f84f845f"
},
"downloads": -1,
"filename": "acdh_django_charts-0.6.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "25c53c4fbba20aa322d44e8a7710334c",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 16018,
"upload_time": "2023-04-21T15:21:42",
"upload_time_iso_8601": "2023-04-21T15:21:42.947860Z",
"url": "https://files.pythonhosted.org/packages/77/f9/1bd8e9bcc761329b32d0233125592d37d09d945df41cfbe816b9076cde1b/acdh_django_charts-0.6.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1296bbe478c5f49e8b66d503d0446d2cd63ef49035416c7406debb89d0ecee1d",
"md5": "ff22ef6d601cddd7548bb11e67a650e9",
"sha256": "5a1d63a3c6b04fc5c421db66729a2666c45d5f1a9ba65c6f9b6682c6b287d673"
},
"downloads": -1,
"filename": "acdh-django-charts-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "ff22ef6d601cddd7548bb11e67a650e9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 13035,
"upload_time": "2023-04-21T15:21:45",
"upload_time_iso_8601": "2023-04-21T15:21:45.606212Z",
"url": "https://files.pythonhosted.org/packages/12/96/bbe478c5f49e8b66d503d0446d2cd63ef49035416c7406debb89d0ecee1d/acdh-django-charts-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-21 15:21:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "acdh-oeaw",
"github_project": "acdh-django-charts",
"travis_ci": true,
"coveralls": true,
"github_actions": false,
"requirements": [],
"tox": true,
"lcname": "acdh-django-charts"
}