Types
Wrapper for Notion API data types.
Similar to other records, these object provide access to the primitive data structure used in the Notion API as well as higher-level methods.
BlockRef
Bases:
Reference a block.
Source code in src/notional/types.py
105 106 107 108 109 110 111 112 113 114 115 116 117 |
|
__compose__(block_ref)
classmethod
Compose a BlockRef from the given reference object.
block_ref
can be either a string, UUID, or block.
Source code in src/notional/types.py
110 111 112 113 114 115 116 117 |
|
BooleanFormula
Bases:
A Notion boolean formula result.
Source code in src/notional/types.py
964 965 966 967 968 969 970 971 972 |
|
Result
property
Return the result of this BooleanFormula.
Checkbox
Bases:
,
Simple checkbox type; represented as a boolean.
Source code in src/notional/types.py
511 512 513 514 |
|
CreatedBy
Bases:
A Notion created-by property value.
Source code in src/notional/types.py
1126 1127 1128 1129 1130 1131 1132 1133 |
|
__str__()
Return the contents of this property as a string.
Source code in src/notional/types.py
1131 1132 1133 |
|
CreatedTime
Bases:
,
A Notion created-time property value.
Source code in src/notional/types.py
1120 1121 1122 1123 |
|
DatabaseRef
Bases:
Reference a database.
Source code in src/notional/types.py
75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
__compose__(db_ref)
classmethod
Compose a DatabaseRef from the given reference object.
db_ref
can be either a string, UUID, or database.
Source code in src/notional/types.py
80 81 82 83 84 85 86 87 |
|
Date
Bases:
Notion complex date type - may include timestamp and/or be a date range.
Source code in src/notional/types.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
|
End
property
Return the end date of this property.
IsRange
property
Determine if this object represents a date range (versus a single date).
Start
property
Return the start date of this property.
__compose__(start, end=None)
classmethod
Create a new Date from the native values.
Source code in src/notional/types.py
537 538 539 540 |
|
__contains__(other)
Determine if the given date is in the range (inclusive) of this Date.
Raises ValueError if the Date object is not a range - e.g. has no end date.
Source code in src/notional/types.py
522 523 524 525 526 527 528 529 530 531 |
|
__str__()
Return a string representation of this property.
Source code in src/notional/types.py
533 534 535 |
|
DateFormula
Bases:
A Notion date formula result.
Source code in src/notional/types.py
953 954 955 956 957 958 959 960 961 |
|
Result
property
Return the result of this DateFormula.
DateRange
Bases:
A Notion date range, with an optional end date.
Source code in src/notional/types.py
195 196 197 198 199 200 201 202 203 204 205 206 207 |
|
__str__()
Return a string representation of this object.
Source code in src/notional/types.py
201 202 203 204 205 206 207 |
|
Email
Bases:
,
Notion email type.
Source code in src/notional/types.py
821 822 823 824 |
|
EmojiObject
Bases:
A Notion emoji object.
Source code in src/notional/types.py
126 127 128 129 130 131 132 133 134 135 136 137 138 |
|
__compose__(emoji)
classmethod
Compose an EmojiObject from the given emoji string.
Source code in src/notional/types.py
135 136 137 138 |
|
__str__()
Return this EmojiObject as a simple string.
Source code in src/notional/types.py
131 132 133 |
|
EquationObject
Bases:
Notion equation element.
Source code in src/notional/types.py
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
|
__str__()
Return a string representation of this object.
Source code in src/notional/types.py
322 323 324 325 326 327 328 |
|
ExternalFile
Bases:
An external file object.
Source code in src/notional/types.py
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
|
__compose__(url, name=None)
classmethod
Create a new ExternalFile
from the given URL.
Source code in src/notional/types.py
189 190 191 192 |
|
__str__()
Return a string representation of this object.
Source code in src/notional/types.py
180 181 182 183 184 185 186 187 |
|
FileObject
Bases:
A Notion file object.
Depending on the context, a FileObject may require a name (such as in the Files
property). This makes the object hierarchy difficult, so here we simply allow
name
to be optional. It is the responsibility of the caller to set name
if
required by the API.
Source code in src/notional/types.py
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|
URL
property
Return the URL to this FileObject.
__str__()
Return a string representation of this object.
Source code in src/notional/types.py
152 153 154 |
|
Files
Bases:
Notion files type.
Source code in src/notional/types.py
833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 |
|
__contains__(other)
Determine if the given FileObject or name is in the property.
Source code in src/notional/types.py
838 839 840 841 842 843 844 845 846 847 848 849 850 851 |
|
__getitem__(name)
Return the FileObject with the given name.
Source code in src/notional/types.py
870 871 872 873 874 875 876 877 878 879 880 |
|
__iadd__(obj)
Append the given FileObject
in place.
Source code in src/notional/types.py
882 883 884 885 886 887 888 889 |
|
__isub__(obj)
Remove the given FileObject
in place.
Source code in src/notional/types.py
891 892 893 894 895 896 897 898 |
|
__iter__()
Iterate over the FileObject's in this property.
Source code in src/notional/types.py
857 858 859 860 861 862 863 |
|
__len__()
Return the number of Files in this property.
Source code in src/notional/types.py
865 866 867 868 |
|
__str__()
Return a string representation of this property.
Source code in src/notional/types.py
853 854 855 |
|
append(obj)
Append the given file reference to this property.
:param ref: the FileObject
to be added
Source code in src/notional/types.py
900 901 902 903 904 905 |
|
remove(obj)
Remove the given file reference from this property.
:param ref: the FileObject
to be removed
Source code in src/notional/types.py
907 908 909 910 911 912 |
|
Formula
Bases:
A Notion formula property value.
Source code in src/notional/types.py
975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 |
|
Result
property
Return the result of this Formula in its native type.
__str__()
Return the result of this formula as a string.
Source code in src/notional/types.py
980 981 982 |
|
FormulaResult
Bases:
A Notion formula result.
This object contains the result of the expression in the database properties.
Source code in src/notional/types.py
915 916 917 918 919 920 921 922 923 924 925 926 927 928 |
|
Result
property
Return the result of this FormulaResult.
__str__()
Return the formula result as a string.
Source code in src/notional/types.py
921 922 923 |
|
HostedFile
Bases:
A Notion file object.
Source code in src/notional/types.py
162 163 164 165 166 167 168 169 |
|
LastEditedBy
Bases:
A Notion last-edited-by property value.
Source code in src/notional/types.py
1142 1143 1144 1145 1146 1147 1148 1149 |
|
__str__()
Return the contents of this property as a string.
Source code in src/notional/types.py
1147 1148 1149 |
|
LastEditedTime
Bases:
,
A Notion last-edited-time property value.
Source code in src/notional/types.py
1136 1137 1138 1139 |
|
MentionData
Bases:
Base class for typed Mention
data objects.
Source code in src/notional/types.py
210 211 |
|
MentionDatabase
Bases:
Nested database information for Mention
properties.
Source code in src/notional/types.py
244 245 246 247 248 249 250 251 252 253 254 255 |
|
__compose__(page)
classmethod
Build a Mention
object for the specified database reference.
Source code in src/notional/types.py
249 250 251 252 253 254 255 |
|
MentionDate
Bases:
Nested date data for Mention
properties.
Source code in src/notional/types.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
|
__compose__(start, end=None)
classmethod
Build a Mention
object for the specified URL.
Source code in src/notional/types.py
263 264 265 266 267 268 269 270 271 |
|
MentionLinkPreview
Bases:
Nested url data for Mention
properties.
These objects cannot be created via the API.
Source code in src/notional/types.py
274 275 276 277 278 279 280 281 282 283 |
|
MentionObject
Bases:
Notion mention element.
Source code in src/notional/types.py
308 309 310 311 |
|
MentionPage
Bases:
Nested page data for Mention
properties.
Source code in src/notional/types.py
230 231 232 233 234 235 236 237 238 239 240 241 |
|
__compose__(page_ref)
classmethod
Build a Mention
object for the specified page reference.
Source code in src/notional/types.py
235 236 237 238 239 240 241 |
|
MentionTemplate
Bases:
Nested template data for Mention
properties.
Source code in src/notional/types.py
302 303 304 305 |
|
MentionTemplateData
Bases:
Nested template data for Mention
properties.
Source code in src/notional/types.py
286 287 |
|
MentionTemplateDate
Bases:
Nested date template data for Mention
properties.
Source code in src/notional/types.py
290 291 292 293 |
|
MentionTemplateUser
Bases:
Nested user template data for Mention
properties.
Source code in src/notional/types.py
296 297 298 299 |
|
MentionUser
Bases:
Nested user data for Mention
properties.
Source code in src/notional/types.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
|
__compose__(user)
classmethod
Build a Mention
object for the specified user.
The id
field must be set for the given User. Other fields may cause errors
if they do not match the specific type returned from the API.
Source code in src/notional/types.py
219 220 221 222 223 224 225 226 227 |
|
MultiSelect
Bases:
Notion multi-select type.
Source code in src/notional/types.py
670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 |
|
Values
property
Return the names of each value in this MultiSelect as a list.
__compose__(*values)
classmethod
Initialize a new MultiSelect from the given value(s).
Source code in src/notional/types.py
734 735 736 737 738 739 |
|
__contains__(name)
Determine if the given name is in this MultiSelect.
To avoid confusion, only names are considered for comparison, not ID's.
Source code in src/notional/types.py
714 715 716 717 718 719 720 721 722 723 724 |
|
__getitem__(index)
Return the SelectValue object at the given index.
Source code in src/notional/types.py
683 684 685 686 687 688 689 690 691 692 |
|
__iadd__(other)
Add the given option to this MultiSelect.
Source code in src/notional/types.py
694 695 696 697 698 699 700 701 702 |
|
__isub__(other)
Remove the given value from this MultiSelect.
Source code in src/notional/types.py
704 705 706 707 708 709 710 711 712 |
|
__iter__()
Iterate over the SelectValue's in this property.
Source code in src/notional/types.py
726 727 728 729 730 731 732 |
|
__len__()
Count the number of selected values.
Source code in src/notional/types.py
679 680 681 |
|
__str__()
Return a string representation of this property.
Source code in src/notional/types.py
675 676 677 |
|
append(*values)
Add selected values to this MultiSelect.
Source code in src/notional/types.py
741 742 743 744 745 746 747 748 749 |
|
remove(*values)
Remove selected values from this MultiSelect.
Source code in src/notional/types.py
751 752 753 754 |
|
NativeTypeMixin
Mixin class for properties that can be represented as native Python types.
Source code in src/notional/types.py
331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
|
Value
property
Get the current value of this property as a native Python type.
__compose__(value)
classmethod
Build the property value from the native Python value.
Source code in src/notional/types.py
357 358 359 360 361 362 363 364 365 |
|
__eq__(other)
Determine if this property is equal to the given object.
Source code in src/notional/types.py
344 345 346 347 348 349 350 351 |
|
__ne__(other)
Determine if this property is not equal to the given object.
Source code in src/notional/types.py
353 354 355 |
|
__str__()
Return a string representation of this object.
Source code in src/notional/types.py
334 335 336 337 338 339 340 341 342 |
|
Number
Bases:
,
Simple number type.
Source code in src/notional/types.py
436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 |
|
Value
property
Get the current value of this property as a native Python number.
__add__(other)
Add the value of other
and returns the result as a Number.
Source code in src/notional/types.py
477 478 479 |
|
__float__()
Return the Number as a float
.
Source code in src/notional/types.py
441 442 443 444 445 446 447 |
|
__ge__(other)
Return True
if this Number
is greater-than-or-equal-to other
.
Source code in src/notional/types.py
497 498 499 |
|
__gt__(other)
Return True
if this Number
is greater-than other
.
Source code in src/notional/types.py
501 502 503 |
|
__iadd__(other)
Add the given value to this Number.
Source code in src/notional/types.py
457 458 459 460 461 462 463 464 465 |
|
__int__()
Return the Number as an int
.
Source code in src/notional/types.py
449 450 451 452 453 454 455 |
|
__isub__(other)
Subtract the given value from this Number.
Source code in src/notional/types.py
467 468 469 470 471 472 473 474 475 |
|
__le__(other)
Return True
if this Number
is less-than-or-equal-to other
.
Source code in src/notional/types.py
489 490 491 |
|
__lt__(other)
Return True
if this Number
is less-than other
.
Source code in src/notional/types.py
493 494 495 |
|
__mul__(other)
Multiply the value of other
and returns the result as a Number.
Source code in src/notional/types.py
485 486 487 |
|
__sub__(other)
Subtract the value of other
and returns the result as a Number.
Source code in src/notional/types.py
481 482 483 |
|
NumberFormula
Bases:
A Notion number formula result.
Source code in src/notional/types.py
942 943 944 945 946 947 948 949 950 |
|
Result
property
Return the result of this NumberFormula.
ObjectReference
Bases:
A general-purpose object reference in the Notion API.
Source code in src/notional/types.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
URL
property
Return the Notion URL for this object reference.
Note: this is a convenience property only. It does not guarantee that the URL exists or that it is accessible by the integration.
__compose__(ref)
classmethod
Compose an ObjectReference from the given reference.
ref
may be a UUID
, str
, ParentRef
or GenericObject
with an id
.
Strings may be either UUID's or URL's to Notion content.
Source code in src/notional/types.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
|
PageRef
Bases:
Reference a page.
Source code in src/notional/types.py
90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
__compose__(page_ref)
classmethod
Compose a PageRef from the given reference object.
page_ref
can be either a string, UUID, or page.
Source code in src/notional/types.py
95 96 97 98 99 100 101 102 |
|
ParentRef
Bases:
Reference another block as a parent.
Source code in src/notional/types.py
68 69 |
|
People
Bases:
Notion people type.
Source code in src/notional/types.py
766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 |
|
__contains__(other)
Determine if the given User or name is in this People.
To avoid confusion, only names are considered for comparison (not ID's).
Source code in src/notional/types.py
779 780 781 782 783 784 785 786 787 788 789 790 791 792 |
|
__getitem__(index)
Return the People object at the given index.
Source code in src/notional/types.py
799 800 801 802 803 804 805 806 807 808 |
|
__iter__()
Iterate over the User's in this property.
Source code in src/notional/types.py
771 772 773 774 775 776 777 |
|
__len__()
Return the number of People in this property.
Source code in src/notional/types.py
794 795 796 797 |
|
__str__()
Return a string representation of this property.
Source code in src/notional/types.py
810 811 812 |
|
PhoneNumber
Bases:
,
Notion phone type.
Source code in src/notional/types.py
827 828 829 830 |
|
PropertyItem
Bases:
,
A PropertyItem
returned by the Notion API.
Basic property items have a similar schema to corresponding property values. As a
result, these items share the PropertyValue
type definitions.
This class provides a placeholder for parsing property items, however objects
parse by this class will likely be PropertyValue
's instead.
Source code in src/notional/types.py
1153 1154 1155 1156 1157 1158 1159 1160 1161 |
|
PropertyValue
Bases:
Base class for Notion property values.
Source code in src/notional/types.py
381 382 383 384 |
|
Relation
Bases:
A Notion relation property value.
Source code in src/notional/types.py
994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 |
|
__compose__(*pages)
classmethod
Return a Relation
property with the specified pages.
Source code in src/notional/types.py
1000 1001 1002 1003 |
|
__contains__(page)
Determine if the given page is in this Relation.
Source code in src/notional/types.py
1005 1006 1007 |
|
__getitem__(index)
Return the ObjectReference object at the given index.
Source code in src/notional/types.py
1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 |
|
__iadd__(page)
Add the given page to this Relation in place.
Source code in src/notional/types.py
1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 |
|
__isub__(page)
Remove the given page from this Relation in place.
Source code in src/notional/types.py
1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 |
|
__iter__()
Iterate over the ObjectReference's in this property.
Source code in src/notional/types.py
1009 1010 1011 1012 1013 1014 1015 |
|
__len__()
Return the number of ObjectReference's in this property.
Source code in src/notional/types.py
1017 1018 1019 1020 |
|
RichText
Bases:
,
Notion rich text type.
Source code in src/notional/types.py
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
|
Value
property
Return the plain text from this RichText.
__compose__(*text)
classmethod
Create a new RichText
property from the given strings.
Source code in src/notional/types.py
421 422 423 424 |
|
__len__()
Return the number of object in the RichText object.
Source code in src/notional/types.py
417 418 419 |
|
Rollup
Bases:
A Notion rollup property value.
Source code in src/notional/types.py
1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 |
|
__str__()
Return a string representation of this Rollup property.
Source code in src/notional/types.py
1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 |
|
RollupArray
Bases:
A Notion rollup array property value.
Source code in src/notional/types.py
1091 1092 1093 1094 1095 1096 1097 1098 1099 |
|
Value
property
Return the native representation of this Rollup object.
RollupDate
Bases:
A Notion rollup date property value.
Source code in src/notional/types.py
1080 1081 1082 1083 1084 1085 1086 1087 1088 |
|
Value
property
Return the native representation of this Rollup object.
RollupNumber
Bases:
A Notion rollup number property value.
Source code in src/notional/types.py
1069 1070 1071 1072 1073 1074 1075 1076 1077 |
|
Value
property
Return the native representation of this Rollup object.
RollupObject
Bases:
,
A Notion rollup property value.
Source code in src/notional/types.py
1058 1059 1060 1061 1062 1063 1064 1065 1066 |
|
Value
abstractmethod
property
Return the native representation of this Rollup object.
SelectOne
Bases:
,
Notion select type.
Source code in src/notional/types.py
631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 |
|
Value
property
Return the value of this property as a string.
__compose__(value, color=None)
classmethod
Create a SelectOne
property from the given value.
:param value: a string to use for this property :param color: an optional Color for the value
Source code in src/notional/types.py
651 652 653 654 655 656 657 658 |
|
__eq__(other)
Determine if this property is equal to the given object.
To avoid confusion, this method compares Select options by name.
Source code in src/notional/types.py
640 641 642 643 644 645 646 647 648 649 |
|
__str__()
Return a string representation of this property.
Source code in src/notional/types.py
636 637 638 |
|
SelectValue
Bases:
Values for select & multi-select properties.
Source code in src/notional/types.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 |
|
__compose__(value, color=None)
classmethod
Create a SelectValue
property from the given value.
:param value: a string to use for this property :param color: an optional Color for the value
Source code in src/notional/types.py
621 622 623 624 625 626 627 628 |
|
__str__()
Return a string representation of this property.
Source code in src/notional/types.py
617 618 619 |
|
Status
Bases:
,
Notion status property.
Source code in src/notional/types.py
562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 |
|
Value
property
Return the value of this property as a string.
__compose__(name, color=None)
classmethod
Create a Status
property from the given name.
:param name: a string to use for this property :param color: an optional Color for the status
Source code in src/notional/types.py
590 591 592 593 594 595 596 597 598 599 600 601 |
|
__eq__(other)
Determine if this property is equal to the given object.
To avoid confusion, this method compares Status options by name.
Source code in src/notional/types.py
576 577 578 579 580 581 582 583 584 585 586 587 588 |
|
__str__()
Return a string representation of this property.
Source code in src/notional/types.py
572 573 574 |
|
StringFormula
Bases:
A Notion string formula result.
Source code in src/notional/types.py
931 932 933 934 935 936 937 938 939 |
|
Result
property
Return the result of this StringFormula.
Title
Bases:
,
Notion title type.
Source code in src/notional/types.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
|
Value
property
Return the plain text from this Title.
__compose__(*text)
classmethod
Create a new Title
property from the given text elements.
Source code in src/notional/types.py
397 398 399 400 |
|
__len__()
Return the number of object in the Title object.
Source code in src/notional/types.py
392 393 394 395 |
|
URL
Bases:
,
Notion URL type.
Source code in src/notional/types.py
815 816 817 818 |
|
WorkspaceRef
Bases:
Reference the workspace.
Source code in src/notional/types.py
120 121 122 123 |
|