Coverage for meta_tags_parser/settings.py: 100%

7 statements  

« prev     ^ index     » next       coverage.py v7.10.3, created at 2025-08-21 00:51 +0000

1import types 

2import typing 

3 

4from . import structs 

5 

6 

7BASIC_META_TAGS: typing.Final[tuple[str, ...]] = ( 

8 "title", 

9 "description", 

10 "keywords", 

11 "robots", 

12 "viewport", 

13) 

14SETTINGS_FOR_SOCIAL_MEDIA: typing.Final[ 

15 typing.Mapping[ 

16 typing.Literal[structs.WhatToParse.OPEN_GRAPH, structs.WhatToParse.TWITTER], 

17 typing.Mapping[str, str | tuple[str, ...]], 

18 ] 

19] = types.MappingProxyType( 

20 { 

21 structs.WhatToParse.OPEN_GRAPH: types.MappingProxyType({"prop": ("property",), "prefix": "og:"}), 

22 # weird thing about twitter: it use name and property simultaneously 

23 # i mean name is old format, property is new, but all currently accepted as i see at the moment 

24 structs.WhatToParse.TWITTER: types.MappingProxyType({"prop": ("name", "property"), "prefix": "twitter:"}), 

25 } 

26) 

27DEFAULT_PARSE_GROUP: typing.Final[tuple[structs.WhatToParse, ...]] = ( 

28 structs.WhatToParse.TITLE, 

29 structs.WhatToParse.BASIC, 

30 structs.WhatToParse.OPEN_GRAPH, 

31 structs.WhatToParse.TWITTER, 

32 structs.WhatToParse.OTHER, 

33) 

34SOCIAL_MEDIA_SNIPPET_WHAT_ATTRS_TO_COPY: typing.Final[tuple[str, ...]] = ( 

35 "title", 

36 "description", 

37 "url", 

38 "image", 

39 "image:width", 

40 "image:height", 

41)