tweepy.git
3 years agoAdd AsyncStream.on_disconnect method
Harmon [Tue, 26 Jan 2021 13:48:19 +0000 (07:48 -0600)]
Add AsyncStream.on_disconnect method

3 years agoFix typo in AsyncStream.on_connect docstring
Harmon [Tue, 26 Jan 2021 13:47:38 +0000 (07:47 -0600)]
Fix typo in AsyncStream.on_connect docstring

3 years agoRename AsyncStream.on_disconnect to on_disconnect_message
Harmon [Tue, 26 Jan 2021 13:44:37 +0000 (07:44 -0600)]
Rename AsyncStream.on_disconnect to on_disconnect_message

Change references of disconnect notice to message

3 years agoImprove quotation mark consistency in AsyncStream.filter
Harmon [Tue, 26 Jan 2021 13:42:09 +0000 (07:42 -0600)]
Improve quotation mark consistency in AsyncStream.filter

3 years agoOptimize logging in AsyncStream
Harmon [Sun, 24 Jan 2021 14:09:55 +0000 (08:09 -0600)]
Optimize logging in AsyncStream

3 years agoRename AsyncStream.max_retry to max_retries
Harmon [Sat, 23 Jan 2021 19:16:40 +0000 (13:16 -0600)]
Rename AsyncStream.max_retry to max_retries

3 years agoImprove AsyncStream reconnect wait time variable names
Harmon [Sat, 23 Jan 2021 16:00:23 +0000 (10:00 -0600)]
Improve AsyncStream reconnect wait time variable names

3 years agoMerge branch 'master' into async-streaming
Harmon [Fri, 22 Jan 2021 18:43:06 +0000 (12:43 -0600)]
Merge branch 'master' into async-streaming

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 AsyncStream.on_http_error to on_request_error
Harmon [Thu, 21 Jan 2021 10:11:21 +0000 (04:11 -0600)]
Rename AsyncStream.on_http_error to on_request_error

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 agoMerge branch 'master' into async-streaming
Harmon [Tue, 12 Jan 2021 12:54:57 +0000 (06:54 -0600)]
Merge branch 'master' into async-streaming

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 agoFix AsyncStream reuse
Harmon [Mon, 11 Jan 2021 16:11:13 +0000 (10:11 -0600)]
Fix AsyncStream reuse

3 years agoFix AsyncStream.task assignment
Harmon [Mon, 11 Jan 2021 16:00:38 +0000 (10:00 -0600)]
Fix AsyncStream.task assignment

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

3 years agoRemove explicit handling of requests.ReadTimeout in Stream
Harmon [Tue, 5 Jan 2021 08:54:51 +0000 (02:54 -0600)]
Remove explicit handling of requests.ReadTimeout in Stream

requests.ReadTimeout subclasses requests.Timeout, so this shouldn't be necessary

3 years agoHandle requests.ReadTimeout in Stream
Harmon [Tue, 5 Jan 2021 08:15:29 +0000 (02:15 -0600)]
Handle requests.ReadTimeout in Stream

Resolves #750

3 years agoSimplify requests imports in streaming.py
Harmon [Tue, 5 Jan 2021 08:08:37 +0000 (02:08 -0600)]
Simplify requests imports in streaming.py

3 years agoRename StreamListener.keep_alive to StreamListener.on_keep_alive
Harmon [Mon, 4 Jan 2021 10:11:22 +0000 (04:11 -0600)]
Rename StreamListener.keep_alive to StreamListener.on_keep_alive

To be consistent with other StreamListener methods

3 years agoImprove formatting in AsyncStream
Harmon [Mon, 4 Jan 2021 10:07:55 +0000 (04:07 -0600)]
Improve formatting in AsyncStream

3 years agoImprove variable name in Stream
Harmon [Mon, 4 Jan 2021 09:42:09 +0000 (03:42 -0600)]
Improve variable name in Stream

3 years agoRemove Stream._data method
Harmon [Mon, 4 Jan 2021 09:35:38 +0000 (03:35 -0600)]
Remove Stream._data method

3 years agoRemove unused variable in Stream
Harmon [Mon, 4 Jan 2021 09:29:45 +0000 (03:29 -0600)]
Remove unused variable in Stream

3 years agoRemove parse_a_href and parse_html_value functions
Harmon [Sun, 3 Jan 2021 03:27:58 +0000 (21:27 -0600)]
Remove parse_a_href and parse_html_value functions

3 years agoReplace convert_to_utf8_str function with str cast
Harmon [Sun, 3 Jan 2021 02:10:16 +0000 (20:10 -0600)]
Replace convert_to_utf8_str function with str cast

3 years agoOptimize list_to_csv function
Harmon [Sun, 3 Jan 2021 02:03:38 +0000 (20:03 -0600)]
Optimize list_to_csv function

3 years agoReplace parse_datetime function with email.utils.parsedate_to_datetime
Harmon [Sun, 3 Jan 2021 01:57:43 +0000 (19:57 -0600)]
Replace parse_datetime function with email.utils.parsedate_to_datetime

This causes the datetime objects for created_at attributes to be aware

3 years agoUpdate copyright years to include 2021
Harmon [Sat, 2 Jan 2021 14:08:17 +0000 (08:08 -0600)]
Update copyright years to include 2021

3 years agoUpdate copyright years to include 2021
Harmon [Sat, 2 Jan 2021 14:03:01 +0000 (08:03 -0600)]
Update copyright years to include 2021

3 years agoRename oauth_token and oauth_token_secret AsyncStream parameters
Harmon [Fri, 1 Jan 2021 03:07:04 +0000 (21:07 -0600)]
Rename oauth_token and oauth_token_secret AsyncStream parameters

To access_token and access_token_secret

3 years agoAdd and use mixins for Status and User
Harmon [Thu, 31 Dec 2020 04:27:27 +0000 (22:27 -0600)]
Add and use mixins for Status and User

3 years agoMerge pull request #1306 from mef51/patch-1
Harmon [Thu, 31 Dec 2020 03:25:46 +0000 (21:25 -0600)]
Merge pull request #1306 from mef51/patch-1

make User object hashable to allow use with sets

3 years agohash == id
mohammed chamma [Thu, 31 Dec 2020 03:12:24 +0000 (22:12 -0500)]
hash == id

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoRename is_async Stream.filter and Stream.sample parameters to threaded
Harmon [Thu, 31 Dec 2020 01:08:37 +0000 (19:08 -0600)]
Rename is_async Stream.filter and Stream.sample parameters to threaded

3 years agoAdd async extra and asynchronous subpackage with AsyncStream
Harmon [Wed, 30 Dec 2020 08:15:20 +0000 (02:15 -0600)]
Add async extra and asynchronous subpackage with AsyncStream

3 years agoMerge branch 'master' into patch-1
mohammed chamma [Wed, 30 Dec 2020 23:45:08 +0000 (18:45 -0500)]
Merge branch 'master' into patch-1

3 years agouse id as hash since its an integer
mohammed chamma [Wed, 30 Dec 2020 23:39:56 +0000 (18:39 -0500)]
use id as hash since its an integer

Co-authored-by: Harmon <Harmon758@gmail.com>
3 years agoImprove formatting in streaming.py
Harmon [Wed, 30 Dec 2020 09:46:24 +0000 (03:46 -0600)]
Improve formatting in streaming.py

3 years agoCheck consumer key and secret type when initializing OAuthHandler
Harmon [Wed, 30 Dec 2020 06:29:21 +0000 (00:29 -0600)]
Check consumer key and secret type when initializing OAuthHandler

Resolves #1489

3 years agoRemove unnecessary ASCII encoding of credentials in OAuthHandler
Harmon [Wed, 30 Dec 2020 06:00:12 +0000 (00:00 -0600)]
Remove unnecessary ASCII encoding of credentials in OAuthHandler

3 years agoRemove Status.__ne__ and User.__ne__
Harmon [Wed, 30 Dec 2020 04:29:38 +0000 (22:29 -0600)]
Remove Status.__ne__ and User.__ne__

3 years agoImprove exception handling in Stream
Harmon [Tue, 29 Dec 2020 22:49:29 +0000 (16:49 -0600)]
Improve exception handling in Stream

3 years agoRemove StreamListener.on_event
Harmon [Tue, 29 Dec 2020 12:18:10 +0000 (06:18 -0600)]
Remove StreamListener.on_event

3 years agoSimplify StreamListener.on_data
Harmon [Tue, 29 Dec 2020 09:22:36 +0000 (03:22 -0600)]
Simplify StreamListener.on_data

3 years agoMerge pull request #1484 from dplefevre/doc_fix
Harmon [Tue, 29 Dec 2020 08:45:43 +0000 (02:45 -0600)]
Merge pull request #1484 from dplefevre/doc_fix

Doc fix

3 years agoImprove formatting for documentation for include_rts parameter
Harmon [Tue, 29 Dec 2020 08:41:30 +0000 (02:41 -0600)]
Improve formatting for documentation for include_rts parameter

In documentation for API.user_timeline

3 years agoUpdate cassette for user_timeline test
Harmon [Tue, 29 Dec 2020 08:36:14 +0000 (02:36 -0600)]
Update cassette for user_timeline test

3 years agoUpdate user_timeline test
Harmon [Tue, 29 Dec 2020 08:35:43 +0000 (02:35 -0600)]
Update user_timeline test

3 years agoRemove Stream.api
Harmon [Tue, 29 Dec 2020 08:02:21 +0000 (02:02 -0600)]
Remove Stream.api

3 years agoSimplify Stream.disconnect
Harmon [Tue, 29 Dec 2020 07:34:32 +0000 (01:34 -0600)]
Simplify Stream.disconnect

3 years agoImprove inline comment formatting in Stream._read_loop
Harmon [Tue, 29 Dec 2020 07:30:29 +0000 (01:30 -0600)]
Improve inline comment formatting in Stream._read_loop

3 years agoAdd Python Versions badge to README
Harmon [Tue, 29 Dec 2020 03:50:32 +0000 (21:50 -0600)]
Add Python Versions badge to README

3 years agoRemove unnecessary URL parameter in Documentation Status badge in README
Harmon [Tue, 29 Dec 2020 03:39:42 +0000 (21:39 -0600)]
Remove unnecessary URL parameter in Documentation Status badge in README

3 years agoImprove PyPI Version badge in README
Harmon [Tue, 29 Dec 2020 03:38:43 +0000 (21:38 -0600)]
Improve PyPI Version badge in README

3 years agoAdd links to documentation and Twitter API documentation to README
Harmon [Tue, 29 Dec 2020 03:31:55 +0000 (21:31 -0600)]
Add links to documentation and Twitter API documentation to README

Also improve Discord server invite link text

3 years agoImprove Discord badge in README
Harmon [Tue, 29 Dec 2020 03:27:56 +0000 (21:27 -0600)]
Improve Discord badge in README

3 years agoImprove Documentation Status badge in README
Harmon [Tue, 29 Dec 2020 03:21:20 +0000 (21:21 -0600)]
Improve Documentation Status badge in README

3 years agoRemove StreamListener.on_direct_message and StreamListener.on_friends
Harmon [Mon, 28 Dec 2020 13:31:19 +0000 (07:31 -0600)]
Remove StreamListener.on_direct_message and StreamListener.on_friends

3 years agoMerge branch 'master' into python-3.5-support-removal
Harmon [Mon, 28 Dec 2020 13:12:49 +0000 (07:12 -0600)]
Merge branch 'master' into python-3.5-support-removal

3 years agoRemove Stream.sitestream and Stream.userstream
Harmon [Mon, 28 Dec 2020 13:09:49 +0000 (07:09 -0600)]
Remove Stream.sitestream and Stream.userstream

In favor of #1075

3 years agoMerge branch 'master' into python-3.5-support-removal
Harmon [Mon, 28 Dec 2020 12:59:56 +0000 (06:59 -0600)]
Merge branch 'master' into python-3.5-support-removal

3 years agoRemove Stream.retweet
Harmon [Mon, 28 Dec 2020 12:55:58 +0000 (06:55 -0600)]
Remove Stream.retweet

3 years agoImprove formatting in setup.py
Harmon [Mon, 28 Dec 2020 12:44:42 +0000 (06:44 -0600)]
Improve formatting in setup.py

3 years agoRemove Stream.firehose
Harmon [Mon, 28 Dec 2020 12:42:32 +0000 (06:42 -0600)]
Remove Stream.firehose