Coverage for notion_client/__init__.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.17.0, created at 2026-10-30 15:22 +0000

1"""Package notion-sdk-py. 

2 

3A sync + async python client for the official Notion API. 

4Connect Notion pages and databases to the tools you use every day, 

5creating powerful workflows. 

6For more information visit https://github.com/ramnes/notion-sdk-py. 

7""" 

8 

9from .client import AsyncClient, Client, RetryOptions 

10from .constants import ( 

11 DEFAULT_BASE_URL, 

12 DEFAULT_TIMEOUT_MS, 

13 DEFAULT_MAX_RETRIES, 

14 DEFAULT_INITIAL_RETRY_DELAY_MS, 

15 DEFAULT_MAX_RETRY_DELAY_MS, 

16 MIN_VIEW_COLUMN_WIDTH, 

17) 

18from .errors import ( 

19 # Error codes 

20 NotionErrorCode, 

21 APIErrorCode, 

22 ClientErrorCode, 

23 # Error types 

24 NotionClientError, 

25 APIResponseError, 

26 UnknownHTTPResponseError, 

27 RequestTimeoutError, 

28 InvalidPathParameterError, 

29 # Error helpers 

30 is_notion_client_error, 

31 is_http_response_error, 

32) 

33from .helpers import ( 

34 collect_paginated_api, 

35 iterate_paginated_api, 

36 collect_data_source_templates, 

37 iterate_data_source_templates, 

38 is_full_block, 

39 is_full_data_source, 

40 is_full_database, 

41 is_full_page, 

42 is_full_user, 

43 is_full_comment, 

44 is_full_view, 

45 is_full_page_or_data_source, 

46 extract_notion_id, 

47 extract_database_id, 

48 extract_page_id, 

49 extract_block_id, 

50) 

51from .webhooks import ( 

52 sign_webhook_payload, 

53 verify_webhook_signature, 

54) 

55 

56__all__ = [ 

57 "AsyncClient", 

58 "Client", 

59 "RetryOptions", 

60 "DEFAULT_BASE_URL", 

61 "DEFAULT_TIMEOUT_MS", 

62 "DEFAULT_MAX_RETRIES", 

63 "DEFAULT_INITIAL_RETRY_DELAY_MS", 

64 "DEFAULT_MAX_RETRY_DELAY_MS", 

65 "MIN_VIEW_COLUMN_WIDTH", 

66 "NotionErrorCode", 

67 "APIErrorCode", 

68 "ClientErrorCode", 

69 "NotionClientError", 

70 "APIResponseError", 

71 "UnknownHTTPResponseError", 

72 "RequestTimeoutError", 

73 "InvalidPathParameterError", 

74 "is_notion_client_error", 

75 "is_http_response_error", 

76 "collect_paginated_api", 

77 "iterate_paginated_api", 

78 "collect_data_source_templates", 

79 "iterate_data_source_templates", 

80 "is_full_block", 

81 "is_full_data_source", 

82 "is_full_database", 

83 "is_full_page", 

84 "is_full_user", 

85 "is_full_comment", 

86 "is_full_view", 

87 "is_full_page_or_data_source", 

88 "extract_notion_id", 

89 "extract_database_id", 

90 "extract_page_id", 

91 "extract_block_id", 

92 "sign_webhook_payload", 

93 "verify_webhook_signature", 

94]