tweepy.git
3 years agoFix API.lookup_users docstring consistency
Harmon [Thu, 28 Jan 2021 15:53:02 +0000 (09:53 -0600)]
Fix API.lookup_users docstring consistency

3 years agoImprove error log message in Stream.on_data
Harmon [Thu, 28 Jan 2021 04:08:39 +0000 (22:08 -0600)]
Improve error log message in Stream.on_data

3 years agoImprove docstrings for Stream listener methods
Harmon [Tue, 26 Jan 2021 15:30:34 +0000 (09:30 -0600)]
Improve docstrings for Stream listener methods

3 years agoImprove error messages in Stream.filter and Stream.sample
Harmon [Tue, 26 Jan 2021 15:22:43 +0000 (09:22 -0600)]
Improve error messages in Stream.filter and Stream.sample

3 years agoImprove clarity and coherence of Stream._connect
Harmon [Tue, 26 Jan 2021 15:13:37 +0000 (09:13 -0600)]
Improve clarity and coherence of Stream._connect

3 years agoImprove quotation mark consistency in Stream
Harmon [Tue, 26 Jan 2021 13:41:04 +0000 (07:41 -0600)]
Improve quotation mark consistency in Stream

3 years agoUse specific user agent for Stream
Harmon [Mon, 25 Jan 2021 19:10:07 +0000 (13:10 -0600)]
Use specific user agent for Stream

3 years agoPass headers explicitly in Stream.filter
Harmon [Mon, 25 Jan 2021 18:51:36 +0000 (12:51 -0600)]
Pass headers explicitly in Stream.filter

Add and use Stream._connect headers parameter

3 years agoChange Stream.sample method to use GET HTTP method
Harmon [Mon, 25 Jan 2021 18:43:04 +0000 (12:43 -0600)]
Change Stream.sample method to use GET HTTP method

Add and use Stream._connect method parameter

3 years agoAdd Stream.on_disconnect method
Harmon [Sun, 24 Jan 2021 14:46:02 +0000 (08:46 -0600)]
Add Stream.on_disconnect method

Resolves #277

3 years agoRename Stream.on_disconnect to on_disconnect_message
Harmon [Sun, 24 Jan 2021 14:45:02 +0000 (08:45 -0600)]
Rename Stream.on_disconnect to on_disconnect_message

3 years agoStop reraising exceptions in Stream._connect
Harmon [Sun, 24 Jan 2021 14:30:34 +0000 (08:30 -0600)]
Stop reraising exceptions in Stream._connect

Resolves #1072

3 years agoImprove Stream.running check in Stream._connect
Harmon [Sun, 24 Jan 2021 13:58:39 +0000 (07:58 -0600)]
Improve Stream.running check in Stream._connect

3 years agoDisregard return value from Stream.on_connection_error
Harmon [Sun, 24 Jan 2021 13:57:38 +0000 (07:57 -0600)]
Disregard return value from Stream.on_connection_error

3 years agoDisregard return value from Stream.on_data
Harmon [Sun, 24 Jan 2021 13:57:04 +0000 (07:57 -0600)]
Disregard return value from Stream.on_data

3 years agoDisregard return value from Stream.on_request_error
Harmon [Sun, 24 Jan 2021 13:55:12 +0000 (07:55 -0600)]
Disregard return value from Stream.on_request_error

3 years agoStop disconnecting by default in Stream.on_request_error
Harmon [Sun, 24 Jan 2021 13:49:29 +0000 (07:49 -0600)]
Stop disconnecting by default in Stream.on_request_error

3 years agoLog by default in Stream.on_closed
Harmon [Sun, 24 Jan 2021 13:45:03 +0000 (07:45 -0600)]
Log by default in Stream.on_closed

3 years agoMerge StreamListener into Stream
Harmon [Sun, 24 Jan 2021 13:43:50 +0000 (07:43 -0600)]
Merge StreamListener into Stream

3 years agoRemove StreamListener.api
Harmon [Sun, 24 Jan 2021 13:38:15 +0000 (07:38 -0600)]
Remove StreamListener.api

3 years agoImprove order in StreamListener
Harmon [Sun, 24 Jan 2021 13:34:04 +0000 (07:34 -0600)]
Improve order in StreamListener

3 years agoLog by default in StreamListener methods
Harmon [Sun, 24 Jan 2021 13:27:46 +0000 (07:27 -0600)]
Log by default in StreamListener methods

3 years agoReturn thread when using threaded Stream.filter and Stream.sample
Harmon [Sat, 23 Jan 2021 20:23:48 +0000 (14:23 -0600)]
Return thread when using threaded Stream.filter and Stream.sample

3 years agoOptimize Stream.filter
Harmon [Sat, 23 Jan 2021 20:21:04 +0000 (14:21 -0600)]
Optimize Stream.filter

3 years agoImprove Stream.filter order and formatting
Harmon [Sat, 23 Jan 2021 20:10:39 +0000 (14:10 -0600)]
Improve Stream.filter order and formatting

3 years agoChange Stream.filter to use keyword-only arguments
Harmon [Sat, 23 Jan 2021 19:58:56 +0000 (13:58 -0600)]
Change Stream.filter to use keyword-only arguments

3 years agoChange Stream.sample to use keyword-only arguments
Harmon [Sat, 23 Jan 2021 19:54:24 +0000 (13:54 -0600)]
Change Stream.sample to use keyword-only arguments

3 years agoImprove order and formatting in Stream.sample
Harmon [Sat, 23 Jan 2021 19:53:26 +0000 (13:53 -0600)]
Improve order and formatting in Stream.sample

3 years agoChange Stream._thread to thread
Harmon [Sat, 23 Jan 2021 19:51:06 +0000 (13:51 -0600)]
Change Stream._thread to thread

3 years agoChange Stream._start to _threaded_connect
Harmon [Sat, 23 Jan 2021 19:48:01 +0000 (13:48 -0600)]
Change Stream._start to _threaded_connect

3 years agoSet Stream.running in Stream._connect instead of Stream._start
Harmon [Sat, 23 Jan 2021 19:40:32 +0000 (13:40 -0600)]
Set Stream.running in Stream._connect instead of Stream._start

3 years agoRename Stream._run to _connect
Harmon [Sat, 23 Jan 2021 19:39:41 +0000 (13:39 -0600)]
Rename Stream._run to _connect

3 years agoDefine Stream initialization keyword-only arguments explicitly
Harmon [Sat, 23 Jan 2021 19:33:41 +0000 (13:33 -0600)]
Define Stream initialization keyword-only arguments explicitly

3 years agoImprove Stream initialization order and formatting
Harmon [Sat, 23 Jan 2021 19:32:09 +0000 (13:32 -0600)]
Improve Stream initialization order and formatting

3 years agoName Thread in Stream
Harmon [Sat, 23 Jan 2021 19:22:08 +0000 (13:22 -0600)]
Name Thread in Stream

3 years agoRename Stream.retry_count to max_retries
Harmon [Sat, 23 Jan 2021 19:17:52 +0000 (13:17 -0600)]
Rename Stream.retry_count to max_retries

3 years agoRemove STREAM_VERSION
Harmon [Sat, 23 Jan 2021 17:23:31 +0000 (11:23 -0600)]
Remove STREAM_VERSION

3 years agoImprove order of Stream methods
Harmon [Sat, 23 Jan 2021 17:22:22 +0000 (11:22 -0600)]
Improve order of Stream methods

3 years agoRemove Stream._read_loop
Harmon [Sat, 23 Jan 2021 17:18:44 +0000 (11:18 -0600)]
Remove Stream._read_loop

3 years agoDefault Stream.retry_count to infinity
Harmon [Sat, 23 Jan 2021 17:13:27 +0000 (11:13 -0600)]
Default Stream.retry_count to infinity

3 years agoRemove unnecessary trailing slash from Documentation URL in setup.py
Harmon [Sat, 23 Jan 2021 17:09:29 +0000 (11:09 -0600)]
Remove unnecessary trailing slash from Documentation URL in setup.py

3 years agoRemove requests socks extra from setup.py install_requires
Harmon [Sat, 23 Jan 2021 17:06:51 +0000 (11:06 -0600)]
Remove requests socks extra from setup.py install_requires

Add socks extra requiring requests socks extra

3 years agoRemove Stream.timeout
Harmon [Sat, 23 Jan 2021 16:48:37 +0000 (10:48 -0600)]
Remove Stream.timeout

Use 90 seconds as the read timeout, per https://developer.twitter.com/en/docs/twitter-api/v1/tweets/filter-realtime/guides/connecting.
Default to using the same 90 seconds for connect timeout.

3 years agoReplace Stream.auth with parameters and attributes for each credential
Harmon [Sat, 23 Jan 2021 16:32:41 +0000 (10:32 -0600)]
Replace Stream.auth with parameters and attributes for each credential

Replace Stream.auth with Stream.consumer_key, Stream.consumer_secret, Stream.access_token, Stream.access_token_secret

3 years agoImprove variable name in Stream._run
Harmon [Sat, 23 Jan 2021 16:03:30 +0000 (10:03 -0600)]
Improve variable name in Stream._run

error_counter -> error_count

3 years agoRemove old and superfluous comments in Stream._run
Harmon [Sat, 23 Jan 2021 16:02:43 +0000 (10:02 -0600)]
Remove old and superfluous comments in Stream._run

3 years agoRemove Stream parameters and attributes for reconnect wait times
Harmon [Sat, 23 Jan 2021 15:56:40 +0000 (09:56 -0600)]
Remove Stream parameters and attributes for reconnect wait times

Remove Stream.retry_time_start, Stream.retry_420_start, Stream.retry_time_cap, Stream.snooze_time_step, Stream.snooze_time_cap, Stream.retry_time, Stream.snooze_time

3 years agoRemove Stream.url
Harmon [Sat, 23 Jan 2021 13:56:26 +0000 (07:56 -0600)]
Remove Stream.url

Pass endpoint to Stream._start / Stream._run

3 years agoMake Stream._start threaded parameter keyword-only argument
Harmon [Sat, 23 Jan 2021 13:55:13 +0000 (07:55 -0600)]
Make Stream._start threaded parameter keyword-only argument

3 years agoReplace Stream proxies parameter with proxy
Harmon [Sat, 23 Jan 2021 13:42:59 +0000 (07:42 -0600)]
Replace Stream proxies parameter with proxy

Resolves #1272

3 years agoRemove Python 3.5 from tox configuration
Harmon [Sat, 23 Jan 2021 13:18:04 +0000 (07:18 -0600)]
Remove Python 3.5 from tox configuration

3 years agoClose requests Session at the end of Stream._run
Harmon [Sat, 23 Jan 2021 00:18:25 +0000 (18:18 -0600)]
Close requests Session at the end of Stream._run

3 years agoRemove Stream.new_session
Harmon [Fri, 22 Jan 2021 23:53:55 +0000 (17:53 -0600)]
Remove Stream.new_session

Stop unnecessarily creating a new requests Session at the end of each call to Stream._run

3 years agoAllow requests Session to determine Content-Type header in Stream.filter
Harmon [Fri, 22 Jan 2021 23:35:58 +0000 (17:35 -0600)]
Allow requests Session to determine Content-Type header in Stream.filter

3 years agoRemove Stream.host
Harmon [Fri, 22 Jan 2021 23:33:37 +0000 (17:33 -0600)]
Remove Stream.host

3 years agoRemove Stream.headers
Harmon [Fri, 22 Jan 2021 23:32:39 +0000 (17:32 -0600)]
Remove Stream.headers

3 years agoPass params as kwarg to Stream._start and Stream._run in Stream.sample
Harmon [Fri, 22 Jan 2021 21:11:02 +0000 (15:11 -0600)]
Pass params as kwarg to Stream._start and Stream._run in Stream.sample

Instead of setting requests Session.params

3 years agoUse context manager for requests.Response in Stream
Harmon [Fri, 22 Jan 2021 21:00:19 +0000 (15:00 -0600)]
Use context manager for requests.Response in Stream

Improve formatting of requests Session.request call

3 years agoRemove Stream.filter encoding parameter
Harmon [Fri, 22 Jan 2021 20:48:10 +0000 (14:48 -0600)]
Remove Stream.filter encoding parameter

3 years agoPass daemon directly when initializing Thread in Stream
Harmon [Fri, 22 Jan 2021 18:53:12 +0000 (12:53 -0600)]
Pass daemon directly when initializing Thread in Stream

3 years agoDefault Stream._start threaded parameter to False
Harmon [Fri, 22 Jan 2021 18:50:16 +0000 (12:50 -0600)]
Default Stream._start threaded parameter to False

Pass threaded as kwarg to Stream._start in Stream.filter and Stream.sample

3 years agoRename is_async Stream.filter and Stream.sample parameters to threaded
Harmon [Fri, 22 Jan 2021 18:39:48 +0000 (12:39 -0600)]
Rename is_async Stream.filter and Stream.sample parameters to threaded

3 years agoRemove Stream.body
Harmon [Fri, 22 Jan 2021 18:33:32 +0000 (12:33 -0600)]
Remove Stream.body

Pass body to Stream._start / Stream._run

3 years agoUse requests Response.iter_lines in Stream
Harmon [Fri, 22 Jan 2021 16:52:57 +0000 (10:52 -0600)]
Use requests Response.iter_lines in Stream

Remove and replace ReadBuffer

The on_data method of the stream listener is now passed the raw data from Stream in bytes form.

The previous regex check for the charset directive/parameter in the Content-Type HTTP header was unnecessary anyway, as it's not included in the response for streams (anymore?).

This reduces the overhead for each line of data if the raw data doesn't need to be decoded to be processed, but passes on the burden of decoding the raw data if the default StreamListener.on_data is not being used.

The default StreamListener.on_data implementation should still be fine, as json.loads can process bytes since Python 3.6 and accepts UTF-8 encoding, which it should still be safe to assume is used as the encoding for the raw data, as before, when the unnecessary regex check would fail.

This Stream._read_loop implementation also allows the stream to disconnect when any line of data is received, including keep-alive signals, which resolves #773 and resolves #897.

3 years agoRemove dependence on string length delimitation in Stream
Harmon [Fri, 22 Jan 2021 14:42:59 +0000 (08:42 -0600)]
Remove dependence on string length delimitation in Stream

Simply read the entire line instead of passing "length" as the delimited parameter for the stream and reading the length of the string given by each delimiter

3 years agoRestrict requests and requests_oauthlib major version requirements
Harmon [Thu, 21 Jan 2021 10:28:00 +0000 (04:28 -0600)]
Restrict requests and requests_oauthlib major version requirements

3 years agoUpdate requests_oauthlib dependency requirement to >= 1.0.0
Harmon [Thu, 21 Jan 2021 10:25:32 +0000 (04:25 -0600)]
Update requests_oauthlib dependency requirement to >= 1.0.0

3 years agoRename StreamListener.on_error to on_request_error
Harmon [Thu, 21 Jan 2021 01:41:34 +0000 (19:41 -0600)]
Rename StreamListener.on_error to on_request_error

3 years agoRename StreamListener.on_timeout to on_connection_error
Harmon [Tue, 19 Jan 2021 09:41:55 +0000 (03:41 -0600)]
Rename StreamListener.on_timeout to on_connection_error

3 years agoHandle connection errors when streaming
Harmon [Tue, 19 Jan 2021 09:40:05 +0000 (03:40 -0600)]
Handle connection errors when streaming

Handle requests.ConnectionError, urllib3.exceptions.ReadTimeoutError, urllib3.exceptions.ProtocolError

Handling urllib3.exceptions.ProtocolError should handle the reraised/wrapped http.client.IncompleteRead connection error that can occur and resolves #237 and resolves #448

Handling urllib3.exceptions.ReadTimeoutError resolves #750

Handling urllib3.exceptions.ProtocolError should also handle the reraised/wrapped ConnectionResetError that can occur and resolves #1416

3 years agoImplement API.retweet and API.unretweet test
Harmon [Fri, 15 Jan 2021 06:43:27 +0000 (00:43 -0600)]
Implement API.retweet and API.unretweet test

3 years agoTreat all 2xx HTTP status codes as successful responses
Harmon [Thu, 14 Jan 2021 19:24:53 +0000 (13:24 -0600)]
Treat all 2xx HTTP status codes as successful responses

3 years agoRemove API.search_host, API.search_root, and APIMethod.search_api
Harmon [Thu, 14 Jan 2021 03:40:55 +0000 (21:40 -0600)]
Remove API.search_host, API.search_root, and APIMethod.search_api

3 years agoImprove formatting in API tests
Harmon [Tue, 12 Jan 2021 18:14:56 +0000 (12:14 -0600)]
Improve formatting in API tests

3 years agoImprove formatting in rate limit tests
Harmon [Tue, 12 Jan 2021 18:13:15 +0000 (12:13 -0600)]
Improve formatting in rate limit tests

3 years agoSet COVERALLS_SERVICE_NAME to github in GitHub Actions Test workflow
Harmon [Tue, 12 Jan 2021 12:31:22 +0000 (06:31 -0600)]
Set COVERALLS_SERVICE_NAME to github in GitHub Actions Test workflow

https://github.com/coveralls-clients/coveralls-python/issues/240
https://github.com/coveralls-clients/coveralls-python/pull/249

3 years agoRemove API._remove_list_members
Harmon [Mon, 11 Jan 2021 18:55:14 +0000 (12:55 -0600)]
Remove API._remove_list_members

3 years agoRemove API._add_list_members
Harmon [Mon, 11 Jan 2021 18:52:08 +0000 (12:52 -0600)]
Remove API._add_list_members

3 years agoRemove API._lookup_friendships
Harmon [Mon, 11 Jan 2021 18:30:41 +0000 (12:30 -0600)]
Remove API._lookup_friendships

3 years agoAllow sending Call-To-Action buttons with Direct Messages
Harmon [Mon, 11 Jan 2021 16:58:53 +0000 (10:58 -0600)]
Allow sending Call-To-Action buttons with Direct Messages

In API.send_direct_message
Resolves #1311

3 years agoImprove clarity of and optimize API.send_direct_message
Harmon [Mon, 11 Jan 2021 16:40:01 +0000 (10:40 -0600)]
Improve clarity of and optimize API.send_direct_message

3 years agoAllow sending Quick Reply Options with Direct Messages
Harmon [Mon, 11 Jan 2021 14:52:24 +0000 (08:52 -0600)]
Allow sending Quick Reply Options with Direct Messages

Replace API.send_direct_message quick_reply_type parameter with quick_reply_options
Resolves #1280

3 years agoMerge pull request #1487 from tweepy/python-3.5-support-removal
Harmon [Mon, 11 Jan 2021 13:27:27 +0000 (07:27 -0600)]
Merge pull request #1487 from tweepy/python-3.5-support-removal

Drop support for Python 3.5

3 years agoImprove formatting in Status and User methods
Harmon [Sun, 10 Jan 2021 15:34:48 +0000 (09:34 -0600)]
Improve formatting in Status and User methods

3 years agoMerge pull request #1282 from okomestudio/ts/lists_ownerships
Harmon [Sun, 10 Jan 2021 03:31:16 +0000 (21:31 -0600)]
Merge pull request #1282 from okomestudio/ts/lists_ownerships

Implement lists/ownerships

3 years agoUpdate cassette for API.lists_ownerships test
Harmon [Sun, 10 Jan 2021 03:25:31 +0000 (21:25 -0600)]
Update cassette for API.lists_ownerships test

3 years agoMerge branch 'master' into ts/lists_ownerships
Harmon [Sun, 10 Jan 2021 03:14:45 +0000 (21:14 -0600)]
Merge branch 'master' into ts/lists_ownerships

3 years agoUpdate tweepy/models.py
Taro Sato [Sun, 10 Jan 2021 02:40:55 +0000 (18:40 -0800)]
Update tweepy/models.py

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoUpdate tweepy/api.py
Taro Sato [Sun, 10 Jan 2021 02:40:48 +0000 (18:40 -0800)]
Update tweepy/api.py

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoUpdate docs/api.rst
Taro Sato [Sun, 10 Jan 2021 02:40:41 +0000 (18:40 -0800)]
Update docs/api.rst

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoUpdate tweepy/api.py
Taro Sato [Sun, 10 Jan 2021 02:40:33 +0000 (18:40 -0800)]
Update tweepy/api.py

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoUpdate docs/api.rst
Taro Sato [Sun, 10 Jan 2021 02:40:25 +0000 (18:40 -0800)]
Update docs/api.rst

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoUpdate docs/api.rst
Taro Sato [Sun, 10 Jan 2021 02:40:15 +0000 (18:40 -0800)]
Update docs/api.rst

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoRemove API._send_direct_message
Harmon [Sun, 10 Jan 2021 02:10:55 +0000 (20:10 -0600)]
Remove API._send_direct_message

3 years agoRemove unnecessary allowed_param argument in API._send_direct_message
Harmon [Sun, 10 Jan 2021 02:08:34 +0000 (20:08 -0600)]
Remove unnecessary allowed_param argument in API._send_direct_message

3 years agoMerge branch 'master' into python-3.5-support-removal
Harmon [Fri, 8 Jan 2021 09:34:53 +0000 (03:34 -0600)]
Merge branch 'master' into python-3.5-support-removal

3 years agoReduce extra sleep time for rate limit handling in APIMethod.execute
Harmon [Wed, 6 Jan 2021 20:15:09 +0000 (14:15 -0600)]
Reduce extra sleep time for rate limit handling in APIMethod.execute

Resolves #1049

3 years agoImprove clarity of rate limit handling in APIMethod.execute
Harmon [Wed, 6 Jan 2021 19:59:46 +0000 (13:59 -0600)]
Improve clarity of rate limit handling in APIMethod.execute

Also improve comment capitalization consistency and remove unnecessary comments

3 years agoOptimize HTTP status code checks and retry handling in APIMethod.execute
Harmon [Wed, 6 Jan 2021 02:00:50 +0000 (20:00 -0600)]
Optimize HTTP status code checks and retry handling in APIMethod.execute

Also improve formatting

3 years agoImprove APIMethod.execute check for 420 and 429 HTTP status codes
Harmon [Wed, 6 Jan 2021 01:19:33 +0000 (19:19 -0600)]
Improve APIMethod.execute check for 420 and 429 HTTP status codes

Also improve formatting and consistency in comment capitalization