15.1.10. crate_anon.anonymise.ddr


Copyright (C) 2015-2018 Rudolf Cardinal (rudolf@pobox.com).

This file is part of CRATE.

CRATE is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

CRATE is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with CRATE. If not, see <http://www.gnu.org/licenses/>.


class crate_anon.anonymise.ddr.DataDictionaryRow(config: Config)[source]

Class representing a single row of a data dictionary.

alter_method

Return the alter_method field from the working fields.

check_valid() → None[source]

Check internal validity and complain if invalid, showing the source of the problem.

get_signature() → str[source]

Return a signature based on the source database/table/field.

get_tsv() → str[source]

Return a TSV row for writing.

set_from_dict(valuedict: Dict[str, Any]) → None[source]

Set internal fields from a dict of elements representing a row from the TSV data dictionary file.

set_from_src_db_info(db: str, table: str, field: str, datatype_sqltext: str, sqla_coltype: sqlalchemy.sql.type_api.TypeEngine, dbconf: DatabaseSafeConfig, comment=None) → None[source]

Create a draft data dictionary row from a field in the source database.