diff options
Diffstat (limited to 'docs/01_general.rst')
-rw-r--r-- | docs/01_general.rst | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/docs/01_general.rst b/docs/01_general.rst index 0ea3ac4..70c7e6e 100644 --- a/docs/01_general.rst +++ b/docs/01_general.rst | |||
@@ -1,3 +1,6 @@ | |||
1 | General information | ||
2 | =================== | ||
3 | |||
1 | Rate limiting | 4 | Rate limiting |
2 | ------------- | 5 | ------------- |
3 | Mastodon's API rate limits per user account. By default, the limit is 300 requests | 6 | Mastodon's API rate limits per user account. By default, the limit is 300 requests |
@@ -117,6 +120,34 @@ you can also just write | |||
117 | 120 | ||
118 | and everything will work as intended. | 121 | and everything will work as intended. |
119 | 122 | ||
123 | Versioning | ||
124 | ---------- | ||
125 | Mastodon.py will check if a certain endpoint is available before doing API | ||
126 | calls. By default, it checks against the version of Mastodon retrieved on | ||
127 | init(), or the version you specified. Mastodon.py can be set (in the | ||
128 | constructor) to either check if an endpoint is available at all (this is the | ||
129 | default) or to check if the endpoint is available and behaves as in the newest | ||
130 | Mastodon version (with regards to parameters as well as return values). | ||
131 | Version checking can also be disabled altogether. If a version check fails, | ||
132 | Mastodon.py throws a `MastodonVersionError`. | ||
133 | |||
134 | Some functions need to check what version of Mastodon they are talking to. | ||
135 | These will generally use a cached version to avoid sending a lot of pointless | ||
136 | requests. | ||
137 | |||
138 | Many non-mainline forks have various different formats for their versions and | ||
139 | they have different, incompatible ideas about how to report version. Mastodon.py | ||
140 | tries its best to figure out what is going on, but success is not guaranteed. | ||
141 | |||
142 | With the following functions, you can make Mastodon.py re-check the server | ||
143 | version or explicitly determine if a specific minimum Version is available. | ||
144 | Long-running applications that aim to support multiple Mastodon versions | ||
145 | should do this from time to time in case a server they are running against | ||
146 | updated. | ||
147 | |||
148 | .. automethod:: Mastodon.retrieve_mastodon_version | ||
149 | .. automethod:: Mastodon.verify_minimum_version | ||
150 | |||
120 | A brief note on block lists | 151 | A brief note on block lists |
121 | --------------------------- | 152 | --------------------------- |
122 | Mastodon.py used to block three instances because these were particularly notorious for | 153 | Mastodon.py used to block three instances because these were particularly notorious for |