Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebooks #11

Merged
merged 4 commits into from
Aug 16, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,27 @@ To configure a slicer, instantiate a |ClassSlicer| with a list of |ClassMetric|
Querying Data and Rendering Charts
----------------------------------

Once a slicer is configured, it is ready to be used. Each slicer comes with a |ClassSlicerManager| which exposes an interface for executing queries and transforming the results. Each function in the manager uses the same signature. The principal function is ``data`` and all othe functions call this function first. The additional functions provide a transformation to the data.
Once a slicer is configured, it is ready to be used. Each slicer comes with a |ClassSlicerManager| and several |ClassTransformerManager| which expose an interface for executing queries and transforming the results. Each function in the manager uses the same signature. The principal function is ``data`` and all othe functions call this function first. The additional functions provide a transformation to the data.

The notebook transformer bundle includes different functions for use in Jupyter_ notebooks. Other formats return results in JSON format.

.. _manager_api_start:

* ``my_slicer.manager.data`` - A Pandas_ data frame indexed by the selected dimensions.
* ``my_slicer.manager.line_chart`` - A Highcharts_ line chart.
* ``my_slicer.manager.bar_chart`` - A Highcharts_ bar chart.
* ``my_slicer.manager.row_index_table`` - A Datatables_ row-indexed table.
* ``my_slicer.manager.column_index_table`` - A Datatables_ column-indexed table.

* ``my_slicer.notebook.row_index_table`` - A Datatables_ row-indexed table.
* ``my_slicer.notebook.column_index_table`` - A Datatables_ column-indexed table.

* ``my_slicer.notebook.line_chart`` - A Matplotlib_ line chart. (Requires [matplotlib] dependency)
* ``my_slicer.notebook.column_chart`` - A Matplotlib_ column chart. (Requires [matplotlib] dependency)
* ``my_slicer.notebook.bar_chart`` - A Matplotlib_ bar chart. (Requires [matplotlib] dependency)

* ``my_slicer.highcharts.line_chart`` - A Highcharts_ line chart.
* ``my_slicer.highcharts.column_chart`` - A Highcharts_ column chart.
* ``my_slicer.highcharts.bar_chart`` - A Highcharts_ bar chart.

* ``my_slicer.datatables.row_index_table`` - A Datatables_ row-indexed table.
* ``my_slicer.datatables.column_index_table`` - A Datatables_ column-indexed table.

.. code-block:: python

Expand Down Expand Up @@ -251,6 +263,8 @@ limitations under the License.

.. _PyPika: https://github.com/kayak/pypika/
.. _Pandas: http://pandas.pydata.org/
.. _Jupyter: http://jupyter.org/
.. _Matplotlib: http://matplotlib.org/
.. _Highcharts: http://www.highcharts.com/
.. _Datatables: https://datatables.net/

Expand Down
27 changes: 19 additions & 8 deletions docs/1_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,34 @@ Installation and Setup
:end-before: _installation_end:


Database Connector add-ons
--------------------------


By default, |Brand| does not include any database drivers. You can optionally include one or provide your own.

Vertica
"""""""

.. code-block:: bash

pip install fireant[vertica]

Transformer add-ons
-------------------

There are also optional transformer packages which give access to different widget libraries. This only applies to transformers that require additional packages. All other transformers are included by default.


matplotlib

.. code-block:: bash

pip install fireant[matplotlib]


Once you have added |Brand| to your project, you must provide some additional settings. A database connection is
required in order to execute queries. Currently, only Vertica is supported via ``vertica_python``, however future plans
include support for various other databases such as MySQL and Oracle.
Once you have added |Brand| to your project, you must provide some additional settings. A database connection is required in order to execute queries. Currently, only Vertica is supported via ``vertica_python``, however future plans include support for various other databases such as MySQL and Oracle.

To configure a database, instantiate a subclass of |ClassDatabase| and set it in ``fireant.settings``. This
must be only set once. At the present, only one database connection is supported.
To configure a database, instantiate a subclass of |ClassDatabase| and set it in ``fireant.settings``. This must be only set once. At the present, only one database connection is supported.


.. code-block:: python
Expand Down Expand Up @@ -79,8 +91,7 @@ Instead of using one of the built in database connectors, you can provide your o
password='password123',
)

In a custom database connector, the ``connect`` function must be overridden to provide a ``connection`` to the database.
The ``round_date`` function must also be overridden since there is no common way to round dates in SQL databases.
In a custom database connector, the ``connect`` function must be overridden to provide a ``connection`` to the database. The ``round_date`` function must also be overridden since there is no common way to round dates in SQL databases.



Expand Down
Loading