asreview.Record#

class asreview.Record(dataset_row: int, dataset_id: str, title: str = '', abstract: str = '', authors: list = <factory>, keywords: list = <factory>, year: int | None = None, doi: str | None = None, url: str | None = None, included: int | None = None)[source]#

Bases: Base

Methods

__init__(dataset_row, dataset_id[, title, ...])

A simple constructor that allows initialization from kwargs.

get_columns()

Get the list of database column names.

get_pandas_dtype_mapping()

Get the mapping from record column name to pandas data type.

validate_included(key, included)

validate_list_of_string(key, value)

validate_optional_integer(key, value)

validate_string(key, value)

Attributes

abstract

authors

dataset_id

dataset_row

doi

duplicate_of

group_id

included

keywords

metadata

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

record_id

registry

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

title

type_annotation_map

url

year

abstract: Mapped[str]#
authors: Mapped[list]#
dataset_id: Mapped[str]#
dataset_row: Mapped[int]#
doi: Mapped[str | None]#
duplicate_of#
classmethod get_columns()#

Get the list of database column names.

Returns:

list[str]

classmethod get_pandas_dtype_mapping()#

Get the mapping from record column name to pandas data type.

By default it uses the mapping from __sqlalchemy_to_pandas_dtype_mapping__, but you can overwrite this method if you need different behavior.

Returns:

dict[str, str] – Dictionary whose keys are record column names and the values are the corresponding pandas data type that the column should have when reading it into a pandas object.

group_id#
included: Mapped[int | None]#
keywords: Mapped[list]#
metadata: ClassVar[MetaData] = MetaData()#

Refers to the _schema.MetaData collection that will be used for new _schema.Table objects.

See also

orm_declarative_metadata

record_id: Mapped[int]#
registry: ClassVar[registry] = <sqlalchemy.orm.decl_api.registry object>#

Refers to the _orm.registry in use where new _orm.Mapper objects will be associated.

title: Mapped[str]#
type_annotation_map = {<class 'list'>: <class 'sqlalchemy.sql.sqltypes.JSON'>}#
url: Mapped[str | None]#
validate_included(key, included)[source]#
validate_list_of_string(key, value)[source]#
validate_optional_integer(key, value)[source]#
validate_string(key, value)[source]#
year: Mapped[int | None]#