HistogramBin¶
- class pyinaturalist.models.HistogramBin(id=None, uuid=None, label=None, count=0, interval=None, max_count=0) None¶
Bases:
BaseModelA single bin in a histogram.
The main purpose of this class is for terminal formatting with
pprint().Attributes
Name
Type
Description
id
Unique record ID
uuid
Unversally unique record ID
label
Bin label; type depends on interval
count
Number of observations in this bin
interval
Histogram interval; one of: [‘year’, ‘month’, ‘week’, ‘day’, ‘hour’, ‘month_of_year’, ‘week_of_year’]
max_count
Max count across all bins; used for normalization
bar_width (
property)A normalized count as a bar width for terminal display
interval_column_label (
property)Format the bin interval for display
formatted_label (
property)Format the bin label for display, depending on the interval
Methods
- __init__(id=None, uuid=None, label=None, count=0, interval=None, max_count=0) None¶
Method generated by attrs for class HistogramBin.
- classmethod copy(obj) BaseModel¶
Copy a model object. This is defined as a classmethod to easily initialize a subclass from a parent class instance. For copying an instance to the same type,
copy.deepcopy()can be used.- Return type:
- classmethod from_json(value, **kwargs) T¶
Initialize a single model object from an API response or response result.
Omits any invalid fields and
Nonevalues, so default factories are used instead (e.g. for empty dicts and lists).- Return type:
TypeVar(T, bound= BaseModel)
- classmethod from_json_file(value) List[T]¶
Initialize a collection of model objects from a JSON string, file path, or file-like object