Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here

pyxley

Python helpers for building dashboards using Flask and React

Subscribe to updates I use pyxley


Statistics on pyxley

Number of watchers on Github 2059
Number of open issues 28
Average time to close an issue about 1 month
Main language Python
Average time to merge a PR about 5 hours
Open pull requests 2+
Closed pull requests 0+
Last commit over 1 year ago
Repo Created over 4 years ago
Repo Last Updated over 1 year ago
Size 5.55 MB
Organization / Authorstitchfix
Contributors3
Page Updated
Do you use pyxley? Leave a review!
View open issues (28)
View pyxley activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating pyxley for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

Pyxley

The Pyxley python library makes use of the pyxleyJS React components to create Flask-based web applications. Through the use of the PyReact library, we can use Jinja templating to construct and transform a single React component. The specific UI components are passed as props to the parent component. A simpler interface is provided through the use of specific wrappers for each of the component types.

An example of the Jinja template for a single React component is presented below.

    _react = (
    """
    var Component = require("{{path}}").{{name}};
    {{vars}}
    React.render(
        <Component
        {{props}} />,
        document.getElementById("{{id}}")
    );
    """)

By constructing the template in this way, the developer can easily integrate a custom React component. The only requirements are the props, elementId, and location of the React component.

Documentation and Testing

Documentation

Available at readthedocs

Testing

Coming Soon!

Python versions

Currently supporting Python 2 and 3.

Installation

Install via pip

pip install pyxley

metricsgraphics.js Example

An example flask app has been included. It demonstrates how to add a filter and several charts.

Filters & Charts

Each Filter and Chart inherits from the base UIComponent class. Wrappers have been written to provide a clearer interface. An example of a SelectButton is provided below. The user only specifies the options, while the type is set by the implementation.

class SelectButton(Filter):
    """
    """
    def __init__(self, label, items, filter_id, default):
        opts = {
            "label": label,
            "items": items,
            "alias": filter_id,
            "default": default
        }
        super(SelectButton, self).__init__("SelectButton", opts, None)

UILayout

The UILayout class is designed to integrate the filters and charts with the Flask app. It collects the UIComponents and registers the relevant urls with the app. Within this class, the developer must specify the React layout component, the location of the source jsx file, and the elementid for which the component will be mounted.

Pandas Integration

This library is built with the pandas dataframe in mind. That is, we expect the data to be some sort of structured data thats easy to filter and easy to plot. Each Javascript charting library has its own expected format for the data which makes integration with python challenging. Included in this library are several helper functions that format the data in the way the Javascript libraries are expecting.

pyxley open issues Ask a question     (View All Issues)
  • about 3 years pyxley in production
  • about 3 years Add LICENSE to MANIFEST.in
  • over 3 years how can i refresh the data periodically?
  • over 3 years bower.json missing from datatables example
  • over 3 years Does it need a server or is everything running on the client side?
  • over 3 years Not sure how to make pyxapp work.
  • over 3 years metricsgraphics example stop working
  • over 3 years labelsOutside is not a function type error
  • almost 4 years How to generate views dynamically with DB or dynamic sources without overwritting views functions
  • almost 4 years Cannot get columnDefs in DataTable to work
  • almost 4 years react.jsx.TransformError: ReferenceError: Can't find variable: global
  • almost 4 years ValueError: unknown locale: UTF-8 while run python app.py
  • almost 4 years global name 'jsonify' is not defined in scatter_plot.py
  • almost 4 years DataTables visible columns
  • about 4 years date time format %Y-%m-%d %H:%M:%S to create line chart
  • about 4 years AdminLTE component?
  • over 4 years DOC: Can there be a comparison in ideology/stack with Spyre and Shiny?
  • over 4 years bower install trouble with examples/{datatables,metricsgraphics}
  • almost 3 years Error with webpack
  • over 2 years requirements.txt
pyxley open pull requests (View All Pulls)
  • fixed import error, jsonify wasn't imported from flask
  • Fix code formatting in RST
pyxley list of languages used
Other projects in Python