diff options
author | halcy <halcy@ARARAGI-KUN> | 2022-12-01 21:44:57 +0200 |
---|---|---|
committer | halcy <halcy@ARARAGI-KUN> | 2022-12-01 21:44:57 +0200 |
commit | 405e01bef9461b1f53994425318ac27f293f46cb (patch) | |
tree | 3d819e9268ccbfca7dc1505fdeaf4a536487b34f /docs | |
parent | d2f76239e1bf631cea0d03e1f48b8e0a60909467 (diff) | |
download | mastodon.py-405e01bef9461b1f53994425318ac27f293f46cb.tar.gz |
Minor fixes, document some return values
Diffstat (limited to 'docs')
-rw-r--r-- | docs/02_return_values.rst | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/docs/02_return_values.rst b/docs/02_return_values.rst index 9cc1e77..94d2943 100644 --- a/docs/02_return_values.rst +++ b/docs/02_return_values.rst | |||
@@ -24,6 +24,10 @@ you can also just write | |||
24 | and everything will work as intended. The class used for this is exposed as | 24 | and everything will work as intended. The class used for this is exposed as |
25 | `AttribAccessDict`. | 25 | `AttribAccessDict`. |
26 | 26 | ||
27 | Currently, some of these may be out of date - refer to the Mastodon documentation at | ||
28 | https://docs.joinmastodon.org/entities/ for when fields seem to be missing. This will | ||
29 | be addressed in the next version of Mastodon.py. | ||
30 | |||
27 | User / account dicts | 31 | User / account dicts |
28 | -------------------- | 32 | -------------------- |
29 | .. _user dict: | 33 | .. _user dict: |
@@ -133,7 +137,13 @@ Status edit dicts | |||
133 | mastodonstatus_history(id)[0] | 137 | mastodonstatus_history(id)[0] |
134 | # Returns the following dictionary | 138 | # Returns the following dictionary |
135 | { | 139 | { |
136 | TODO | 140 | 'content': # Content for this version of the status |
141 | 'spoiler_text': # CW / Spoiler text for this version of the status | ||
142 | 'sensitive': # Whether media in this version of the status is marked as sensitive | ||
143 | 'created_at': # Time at which this version of the status was posted | ||
144 | 'account': # Account dict of the user that posted the status | ||
145 | 'media_attachments': # List of media dicts with the attached media for this version of the status | ||
146 | 'emojis'# List of emoji dicts for this version of the status | ||
137 | } | 147 | } |
138 | 148 | ||
139 | Mention dicts | 149 | Mention dicts |
@@ -658,7 +668,8 @@ Familiar follower dicts | |||
658 | mastodon.account_familiar_followers(1)[0] | 668 | mastodon.account_familiar_followers(1)[0] |
659 | # Returns the following dictionary: | 669 | # Returns the following dictionary: |
660 | { | 670 | { |
661 | 671 | 'id': # ID of the account for which the familiar followers are being returned | |
672 | 'accounts': # List of account dicts of the familiar followers | ||
662 | } | 673 | } |
663 | 674 | ||
664 | Admin account dicts | 675 | Admin account dicts |
@@ -683,7 +694,7 @@ Admin account dicts | |||
683 | 'disabled': # For local users, boolean indicating whether the user has had their login disabled | 694 | 'disabled': # For local users, boolean indicating whether the user has had their login disabled |
684 | 'approved': # For local users, False if the user is pending, True otherwise | 695 | 'approved': # For local users, False if the user is pending, True otherwise |
685 | 'locale': # For local users, the locale the user has set, | 696 | 'locale': # For local users, the locale the user has set, |
686 | 'invite_request': # If the user requested an invite, the invite request comment of that user. (TODO permanent?) | 697 | 'invite_request': # If the user requested an invite, the invite request comment of that user. |
687 | 'invited_by_account_id': # Present if the user was invited by another user and set to the inviting users id. | 698 | 'invited_by_account_id': # Present if the user was invited by another user and set to the inviting users id. |
688 | 'account': # The user's account, as a standard user dict | 699 | 'account': # The user's account, as a standard user dict |
689 | } | 700 | } |
@@ -717,7 +728,17 @@ Admin measure dicts | |||
717 | api.admin_measures(datetime.now() - timedelta(hours=24*5), datetime.now(), active_users=True) | 728 | api.admin_measures(datetime.now() - timedelta(hours=24*5), datetime.now(), active_users=True) |
718 | # Returns the following dictionary | 729 | # Returns the following dictionary |
719 | { | 730 | { |
720 | TODO | 731 | 'key': # Name of the measure returned |
732 | 'unit': # Unit for the measure, if available | ||
733 | 'total': # Value of the measure returned | ||
734 | 'human_value': # Human readable variant of the measure returned | ||
735 | 'data': # A list of dicts with the measure broken down by date, as below | ||
736 | } | ||
737 | |||
738 | # The data dicts: | ||
739 | [ | ||
740 | 'date': # Date for this row | ||
741 | 'value': # Value of the measure for this row | ||
721 | } | 742 | } |
722 | 743 | ||
723 | Admin dimension dicts | 744 | Admin dimension dicts |
@@ -729,9 +750,16 @@ Admin dimension dicts | |||
729 | api.admin_dimensions(datetime.now() - timedelta(hours=24*5), datetime.now(), languages=True) | 750 | api.admin_dimensions(datetime.now() - timedelta(hours=24*5), datetime.now(), languages=True) |
730 | # Returns the following dictionary | 751 | # Returns the following dictionary |
731 | { | 752 | { |
732 | TODO | 753 | 'key': # Name of the dimension returned |
754 | 'data': # A list of data dicts, as below | ||
733 | } | 755 | } |
734 | 756 | ||
757 | # the data dicts: | ||
758 | { | ||
759 | 'key': # category for this row | ||
760 | 'human_key': # Human readable name for the category for this row, when available | ||
761 | 'value': # Numeric value for the category | ||
762 | }, | ||
735 | Admin retention dicts | 763 | Admin retention dicts |
736 | --------------------- | 764 | --------------------- |
737 | .. _admin retention dict: | 765 | .. _admin retention dict: |
@@ -741,5 +769,15 @@ Admin retention dicts | |||
741 | api.admin_retention(datetime.now() - timedelta(hours=24*5), datetime.now()) | 769 | api.admin_retention(datetime.now() - timedelta(hours=24*5), datetime.now()) |
742 | # Returns the following dictionary | 770 | # Returns the following dictionary |
743 | { | 771 | { |
744 | TODO | 772 | 'period': # Starting time of the period that the data is being returned for |
773 | 'frequency': # Time resolution (day or month) for the returned data | ||
774 | 'data': # List of data dicts, as below | ||
775 | } | ||
776 | |||
777 | # the data dicts: | ||
778 | { | ||
779 | 'date': # Date for this entry | ||
780 | 'rate': # Fraction of users retained | ||
781 | 'value': # Absolute number of users retained | ||
745 | } | 782 | } |
783 | \ No newline at end of file | ||