Coverage for crateweb/anonymise_api/constants.py: 100%

19 statements  

« prev     ^ index     » next       coverage.py v7.8.0, created at 2025-08-27 10:34 -0500

1""" 

2crate_anon/crateweb/anonymise_api/constants.py 

3 

4=============================================================================== 

5 

6 Copyright (C) 2015, University of Cambridge, Department of Psychiatry. 

7 Created by Rudolf Cardinal (rnc1001@cam.ac.uk). 

8 

9 This file is part of CRATE. 

10 

11 CRATE is free software: you can redistribute it and/or modify 

12 it under the terms of the GNU General Public License as published by 

13 the Free Software Foundation, either version 3 of the License, or 

14 (at your option) any later version. 

15 

16 CRATE is distributed in the hope that it will be useful, 

17 but WITHOUT ANY WARRANTY; without even the implied warranty of 

18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

19 GNU General Public License for more details. 

20 

21 You should have received a copy of the GNU General Public License 

22 along with CRATE. If not, see <https://www.gnu.org/licenses/>. 

23 

24=============================================================================== 

25 

26Constants for the anonymisation API. 

27 

28""" 

29 

30 

31class ApiKeys: 

32 """ 

33 Values need to match the serializers in serializers.py. Don't change just 

34 here. 

35 

36 Some keys are also those of a config; these are just the extras. 

37 """ 

38 

39 ALLOWLIST = "allowlist" 

40 ALTERNATIVES = "alternatives" 

41 ANONYMISED = "anonymised" 

42 CODES = "codes" 

43 DATES = "dates" 

44 DENYLIST = "denylist" 

45 FILES = "files" 

46 NON_NUMERIC_PHRASES = "non_numeric_phrases" 

47 NUMBERS = "numbers" 

48 PATIENT = "patient" 

49 PHRASES = "phrases" 

50 TEXT = "text" 

51 THIRD_PARTY = "third_party" 

52 WORDS = "words" 

53 

54 

55class ApiSettingsKeys: 

56 HASH_KEY = "HASH_KEY" 

57 ALLOWLIST_FILENAMES = "ALLOWLIST_FILENAMES" 

58 DENYLIST_FILENAMES = "DENYLIST_FILENAMES"