Key range source

The key range source provides many of the standard key ranges you’ll use frequently. It also provides a column for outputting the values returned by any key range.

Column types

class blingalytics.sources.key_range.Value(format=None, footer=True)

Occasionally you may want to simply have a column show the values returned by a given key range, such as with an IterableKeyRange. This column requires no special options, and returns the key value from the key whose name matches the name of this column.

Key ranges

class blingalytics.sources.key_range.SourceKeyRange

This key range doesn’t actually ensure any keys. It simply allows each key value returned by the sources to be a new row. If it isn’t returned by a source column, it won’t be a row.

class blingalytics.sources.key_range.IterableKeyRange(iterable, sort_results=True)

Ensures every value returned by the iterable is in the key range. It takes one required argument, which is the iterable to use.

Note that this iterable must be returned in sorted order. By default, this key range will sort the iterable for you before it is returned. However, if your iterable is already in sorted order and you want to avoid the overhead of resorting the list, can pass in sort_results=False.

class blingalytics.sources.key_range.EpochKeyRange(start, end)

Ensures a key for every day between the start and end dates.

This key range takes two positional arguments, start and end, which are used to determine the range of days. These arguments can be datetimes, which will be used as-is; or they can be strings, which will be considered as references to named widgets, and the user input from the widget will be used for the date.

The values of the keys returned by this key range are in the form of an integer representing the number of full days since the UNIX epoch (Jan. 1, 1970). This is ideal for use with the Epoch formatter.

class blingalytics.sources.key_range.MonthKeyRange(start, end)

Ensures a key for every month between the start and end dates.

This key range takes two positional arguments, start and end, which are used to determine the range of months. These arguments can be datetimes, which will be used as-is; or they can be strings, which will be considered as references to named widgets, and the user input from the widget will be used for the date.

The values of the keys returned by this key range are in the form of an integer representing the number of full days since the UNIX epoch (Jan. 1, 1970). This is ideal for use with the Epoch formatter.

Table Of Contents

Previous topic

Data Sources

Next topic

Database source

This Page