diff --git a/HISTORY.rst b/HISTORY.rst
index 75964fff..fd2b8ee3 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,10 +1,10 @@
-.. :changelog:
+# History
-History
--------
+## 3.8.0 (2020-04-02)
+- Bump release with latest patches from GitHub.
+- Fix Direct Messages with patches from @manuelcortez.
-3.7.0 (2018-07-05)
-++++++++++++++++++
+## 3.7.0 (2018-07-05)
- Fixes for cursoring API endpoints
- Improve `html_for_tweet()` parsing
- Documentation cleanup
@@ -13,32 +13,27 @@ History
- Added `create_metadata` endpoint
- Raise error for when cursor is not provided a callable
-3.6.0 (2017-23-08)
-++++++++++++++++++
+## 3.6.0 (2017-23-08)
- Improve replacing of entities with links in `html_for_tweet()`
- Update classifiers for PyPI
-3.5.0 (2017-06-06)
-++++++++++++++++++
+## 3.5.0 (2017-06-06)
- Added support for "symbols" in `Twython.html_for_tweet()`
- Added support for extended tweets in `Twython.html_for_tweet()`
- You can now check progress of video uploads to Twitter when using `Twython.upload_video()`
-3.4.0 (2016-30-04)
-++++++++++++++++++
+## 3.4.0 (2016-30-04)
- Added `upload_video` endpoint
- Fix quoted status checks in `html_for_tweet`
- Fix `html_for_tweet` method response when hashtag/mention is a substring of another
-3.3.0 (2015-18-07)
-++++++++++++++++++
+## 3.3.0 (2015-18-07)
- Added support for muting users
- Fix typos in documentation
- Updated documentation examples
- Added dynamic filtering to streamer
-3.2.0 (2014-10-30)
-++++++++++++++++++
+## 3.2.0 (2014-10-30)
- PEP8'd some code
- Added `lookup_status` function to `endpoints.py`
- Added keyword argument to `cursor` to return full pages rather than individual results
@@ -51,23 +46,16 @@ History
- Deprecating `update_with_media` per Twitter API 1.1 (https://dev.twitter.com/rest/reference/post/statuses/update_with_media)
- Unpin `requests` and `requests-oauthlib` in `requirements.txt`
-
-3.1.2 (2013-12-05)
-++++++++++++++++++
-
+## 3.1.2 (2013-12-05)
- Fixed Changelog (HISTORY.rst)
-3.1.1 (2013-12-05)
-++++++++++++++++++
-
+## 3.1.1 (2013-12-05)
- Update `requests` version to 2.1.0.
- Fixed: Streaming issue where `Exceptions` in handlers or `on_success` which subclass `ValueError` would previously be caught and reported as a JSON decoding problem, and `on_error()` would be called (with status_code=200)
- Fixed issue where XML was returned when bad tokens were passed to `get_authorized_tokens`
- Fixed import for `setup` causing installation to fail on some devices (eg. Nokia N9/MeeGo)
-3.1.0 (2013-09-25)
-++++++++++++++++++
-
+## 3.1.0 (2013-09-25)
- Added ``html_for_tweet`` static method. This method accepts a tweet object returned from a Twitter API call and will return a string with urls, mentions and hashtags in the tweet replaced with HTML.
- Pass ``client_args`` to the streaming ``__init__``, much like in core Twython (you can pass headers, timeout, hooks, proxies, etc.).
- Streamer has new parameter ``handlers`` which accepts a list of strings related to functions that are apart of the Streaming class and start with "on\_". i.e. ['delete'] is passed, when 'delete' is received from a stream response; ``on_delete`` will be called.
@@ -79,9 +67,7 @@ History
- Fixed streaming issue where results wouldn't be returned for streams that weren't so active (See https://github.com/ryanmcgrath/twython/issues/202#issuecomment-19915708)
- Streaming API now uses ``_transparent_params`` so when passed ``True`` or ``False`` or an array, etc. Twython formats it to meet Twitter parameter standards (i.e. ['ryanmcgrath', 'mikehelmick', 'twitterapi'] would convert to string 'ryanmcgrath,mikehelmick,twitterapi')
-3.0.0 (2013-06-18)
-++++++++++++++++++
-
+## 3.0.0 (2013-06-18)
- Changed ``twython/twython.py`` to ``twython/api.py`` in attempt to make structure look a little neater
- Removed all camelCase function access (anything like ``getHomeTimeline`` is now ``get_home_timeline``)
- Removed ``shorten_url``. With the ``requests`` library, shortening a URL on your own is simple enough
@@ -100,9 +86,7 @@ History
- Added ``invalidate_token`` API method which allows registed apps to revoke an access token presenting its client credentials
- ``get_lastfunction_header`` now accepts a ``default_return_value`` parameter. This means that if you pass a second value (ex. ``Twython.get_lastfunction_header('x-rate-limit-remaining', 0)``) and the value is not found, it returns your default value
-2.10.1 (2013-05-29)
-++++++++++++++++++
-
+## 2.10.1 (2013-05-29)
- More test coverage!
- Fix ``search_gen``
- Fixed ``get_lastfunction_header`` to actually do what its docstring says, returns ``None`` if header is not found
@@ -112,9 +96,7 @@ History
- No longer raise ``TwythonStreamError`` when stream line can't be decoded. Instead, sends signal to ``TwythonStreamer.on_error``
- Allow for (int, long, float) params to be passed to Twython Twitter API functions in Python 2, and (int, float) in Python 3
-2.10.0 (2013-05-21)
-++++++++++++++++++
-
+## 2.10.0 (2013-05-21)
- Added ``get_retweeters_ids`` method
- Fixed ``TwythonDeprecationWarning`` on camelCase functions if the camelCase was the same as the PEP8 function (i.e. ``Twython.retweet`` did not change)
- Fixed error message bubbling when error message returned from Twitter was not an array (i.e. if you try to retweet something twice, the error is not found at index 0)
@@ -125,20 +107,14 @@ History
- Cleaned up ``Twython.construct_api_url``, uses "transparent" parameters (see 4th bullet in this version for explaination)
- Update ``requests`` and ``requests-oauthlib`` requirements, fixing posting files AND post data together, making authenticated requests in general in Python 3.3
-2.9.1 (2013-05-04)
-++++++++++++++++++
-
+## 2.9.1 (2013-05-04)
- "PEP8" all the functions. Switch functions from camelCase() to underscore_funcs(). (i.e. ``updateStatus()`` is now ``update_status()``)
-2.9.0 (2013-05-04)
-++++++++++++++++++
-
+## 2.9.0 (2013-05-04)
- Fixed streaming issue #144, added ``TwythonStreamer`` to aid users in a friendly streaming experience (streaming examples in ``examples`` and README's have been updated as well)
- ``Twython`` now requires ``requests-oauthlib`` 0.3.1, fixes #154 (unable to upload media when sending POST data with the file)
-2.8.0 (2013-04-29)
-++++++++++++++++++
-
+## 2.8.0 (2013-04-29)
- Added a ``HISTORY.rst`` to start tracking history of changes
- Updated ``twitter_endpoints.py`` to ``endpoints.py`` for cleanliness
- Removed twython3k directory, no longer needed
@@ -161,36 +137,24 @@ History
- Twython now takes ``ssl_verify`` parameter, defaults True. Set False if you're having development server issues
- Removed internal ``_media_update`` function, we could have always just used ``self.post``
-2.7.3 (2013-04-12)
-++++++++++++++++++
-
+## 2.7.3 (2013-04-12)
- Fixed issue where Twython Exceptions were not being logged correctly
-2.7.2 (2013-04-08)
-++++++++++++++++++
-
+## 2.7.2 (2013-04-08)
- Fixed ``AttributeError`` when trying to decode the JSON response via ``Response.json()``
-2.7.1 (2013-04-08)
-++++++++++++++++++
-
+## 2.7.1 (2013-04-08)
- Removed ``simplejson`` dependency
- Fixed ``destroyDirectMessage``, ``createBlock``, ``destroyBlock`` endpoints in ``twitter_endpoints.py``
- Added ``getProfileBannerSizes`` method to ``twitter_endpoints.py``
- Made oauth_verifier argument required in ``get_authorized_tokens``
- Update ``updateProfileBannerImage`` to use v1.1 endpoint
-2.7.0 (2013-04-04)
-++++++++++++++++++
-
+## 2.7.0 (2013-04-04)
- New ``showOwnedLists`` method
-2.7.0 (2013-03-31)
-++++++++++++++++++
-
+## 2.7.0 (2013-03-31)
- Added missing slash to ``getMentionsTimeline`` in ``twitter_endpoints.py``
-2.6.0 (2013-03-29)
-++++++++++++++++++
-
+## 2.6.0 (2013-03-29)
- Updated ``twitter_endpoints.py`` to better reflect order of API endpoints on the Twitter API v1.1 docs site
diff --git a/README.md b/README.md
new file mode 100644
index 00000000..fe0aa1bc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,163 @@
+# Twython
+
+
+
+
+
+
+`Twython` is a Python library providing an easy way to access Twitter data. Supports Python 3. It's been battle tested by companies, educational institutions and individuals alike. Try it today!
+
+**Note**: As of Twython 3.7.0, there's a general call for maintainers put out. If you find the project useful and want to help out, reach out to Ryan with the info from the bottom of this README. Great open source project to get your feet wet with!
+
+## Features
+- Query data for:
+ - User information
+ - Twitter lists
+ - Timelines
+ - Direct Messages
+ - and anything found in [the docs](https://developer.twitter.com/en/docs)
+- Image Uploading:
+ - Update user status with an image
+ - Change user avatar
+ - Change user background image
+ - Change user banner image
+- OAuth 2 Application Only (read-only) Support
+- Support for Twitter's Streaming API
+- Seamless Python 3 support!
+
+## Installation
+Install Twython via pip:
+
+```bash
+$ pip install twython
+```
+
+Or, if you want the code that is currently on GitHub
+
+```bash
+git clone git://github.com/ryanmcgrath/twython.git
+cd twython
+python setup.py install
+```
+
+## Documentation
+Documentation is available at https://twython.readthedocs.io/en/latest/
+
+## Starting Out
+First, you'll want to head over to https://apps.twitter.com and register an application!
+
+After you register, grab your applications `Consumer Key` and `Consumer Secret` from the application details tab.
+
+The most common type of authentication is Twitter user authentication using OAuth 1. If you're a web app planning to have users sign up with their Twitter account and interact with their timelines, updating their status, and stuff like that this **is** the authentication for you!
+
+First, you'll want to import Twython
+
+```python
+from twython import Twython
+```
+
+## Obtain Authorization URL
+Now, you'll want to create a Twython instance with your `Consumer Key` and `Consumer Secret`:
+
+- Only pass *callback_url* to *get_authentication_tokens* if your application is a Web Application
+- Desktop and Mobile Applications **do not** require a callback_url
+
+```python
+APP_KEY = 'YOUR_APP_KEY'
+APP_SECRET = 'YOUR_APP_SECRET'
+
+twitter = Twython(APP_KEY, APP_SECRET)
+
+auth = twitter.get_authentication_tokens(callback_url='http://mysite.com/callback')
+```
+
+From the `auth` variable, save the `oauth_token` and `oauth_token_secret` for later use (these are not the final auth tokens). In Django or other web frameworks, you might want to store it to a session variable
+
+```python
+OAUTH_TOKEN = auth['oauth_token']
+OAUTH_TOKEN_SECRET = auth['oauth_token_secret']
+```
+
+Send the user to the authentication url, you can obtain it by accessing
+
+```python
+auth['auth_url']
+```
+
+## Handling the Callback
+If your application is a Desktop or Mobile Application *oauth_verifier* will be the PIN code
+
+After they authorize your application to access some of their account details, they'll be redirected to the callback url you specified in `get_authentication_tokens`.
+
+You'll want to extract the `oauth_verifier` from the url.
+
+Django example:
+
+```python
+oauth_verifier = request.GET['oauth_verifier']
+```
+
+Now that you have the `oauth_verifier` stored to a variable, you'll want to create a new instance of Twython and grab the final user tokens
+
+```python
+twitter = Twython(
+ APP_KEY, APP_SECRET,
+ OAUTH_TOKEN, OAUTH_TOKEN_SECRET
+)
+
+final_step = twitter.get_authorized_tokens(oauth_verifier)
+```
+
+Once you have the final user tokens, store them in a database for later use::
+
+```python
+ OAUTH_TOKEN = final_step['oauth_token']
+ OAUTH_TOKEN_SECRET = final_step['oauth_token_secret']
+```
+
+For OAuth 2 (Application Only, read-only) authentication, see [our documentation](https://twython.readthedocs.io/en/latest/usage/starting_out.html#oauth-2-application-authentication).
+
+## Dynamic Function Arguments
+Keyword arguments to functions are mapped to the functions available for each endpoint in the Twitter API docs. Doing this allows us to be incredibly flexible in querying the Twitter API, so changes to the API aren't held up from you using them by this library.
+
+Basic Usage
+-----------
+
+**Function definitions (i.e. get_home_timeline()) can be found by reading over twython/endpoints.py**
+
+Create a Twython instance with your application keys and the users OAuth tokens
+
+```python
+from twython import Twython
+twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
+```
+
+## Authenticated Users Home Timeline
+```python
+twitter.get_home_timeline()
+```
+
+## Updating Status
+This method makes use of dynamic arguments, [read more about them](https://twython.readthedocs.io/en/latest/usage/starting_out.html#dynamic-function-arguments).
+
+```python
+twitter.update_status(status='See how easy using Twython is!')
+```
+
+## Advanced Usage
+- [Advanced Twython Usage](https://twython.readthedocs.io/en/latest/usage/advanced_usage.html)
+- [Streaming with Twython](https://twython.readthedocs.io/en/latest/usage/streaming_api.html)
+
+
+## Questions, Comments, etc?
+My hope is that Twython is so simple that you'd never *have* to ask any questions, but if you feel the need to contact me for this (or other) reasons, you can hit me up at ryan@venodesigns.net.
+
+Or if I'm to busy to answer, feel free to ping mikeh@ydekproductions.com as well.
+
+Follow us on Twitter:
+
+- [@ryanmcgrath](https://twitter.com/ryanmcgrath)
+- [@mikehelmick](https://twitter.com/mikehelmick)
+
+## Want to help?
+Twython is useful, but ultimately only as useful as the people using it (say that ten times fast!). If you'd like to help, write example code, contribute patches, document things on the wiki, tweet about it. Your help is always appreciated!
diff --git a/README.rst b/README.rst
deleted file mode 100644
index edddaccc..00000000
--- a/README.rst
+++ /dev/null
@@ -1,222 +0,0 @@
-Twython
-=======
-
-
-.. image:: https://img.shields.io/pypi/v/twython.svg?style=flat-square
- :target: https://pypi.python.org/pypi/twython
-
-.. image:: https://img.shields.io/pypi/dw/twython.svg?style=flat-square
- :target: https://pypi.python.org/pypi/twython
-
-.. image:: https://img.shields.io/travis/ryanmcgrath/twython.svg?style=flat-square
- :target: https://travis-ci.org/ryanmcgrath/twython
-
-.. image:: https://img.shields.io/coveralls/ryanmcgrath/twython/master.svg?style=flat-square
- :target: https://coveralls.io/r/ryanmcgrath/twython?branch=master
-
-``Twython`` is the premier Python library providing an easy (and up-to-date) way to access Twitter data. Actively maintained and featuring support for Python 2.6+ and Python 3. It's been battle tested by companies, educational institutions and individuals alike. Try it today!
-
-Features
---------
-
-- Query data for:
- - User information
- - Twitter lists
- - Timelines
- - Direct Messages
- - and anything found in `the docs `_
-- Image Uploading:
- - Update user status with an image
- - Change user avatar
- - Change user background image
- - Change user banner image
-- OAuth 2 Application Only (read-only) Support
-- Support for Twitter's Streaming API
-- Seamless Python 3 support!
-
-Installation
-------------
-
-Install Twython via `pip `_
-
-.. code-block:: bash
-
- $ pip install twython
-
-or, with `easy_install `_
-
-.. code-block:: bash
-
- $ easy_install twython
-
-But, hey... `that's up to you `_.
-
-Or, if you want the code that is currently on GitHub
-
-.. code-block:: bash
-
- git clone git://github.com/ryanmcgrath/twython.git
- cd twython
- python setup.py install
-
-Documentation
--------------
-
-Documentation is available at https://twython.readthedocs.io/en/latest/
-
-Starting Out
-------------
-
-First, you'll want to head over to https://apps.twitter.com and register an application!
-
-After you register, grab your applications ``Consumer Key`` and ``Consumer Secret`` from the application details tab.
-
-The most common type of authentication is Twitter user authentication using OAuth 1. If you're a web app planning to have users sign up with their Twitter account and interact with their timelines, updating their status, and stuff like that this **is** the authentication for you!
-
-First, you'll want to import Twython
-
-.. code-block:: python
-
- from twython import Twython
-
-Authentication
-~~~~~~~~~~~~~~
-
-Obtain Authorization URL
-^^^^^^^^^^^^^^^^^^^^^^^^
-
-Now, you'll want to create a Twython instance with your ``Consumer Key`` and ``Consumer Secret``
-
- Only pass *callback_url* to *get_authentication_tokens* if your application is a Web Application
-
- Desktop and Mobile Applications **do not** require a callback_url
-
-.. code-block:: python
-
- APP_KEY = 'YOUR_APP_KEY'
- APP_SECRET = 'YOUR_APP_SECRET'
-
- twitter = Twython(APP_KEY, APP_SECRET)
-
- auth = twitter.get_authentication_tokens(callback_url='http://mysite.com/callback')
-
-From the ``auth`` variable, save the ``oauth_token`` and ``oauth_token_secret`` for later use (these are not the final auth tokens). In Django or other web frameworks, you might want to store it to a session variable
-
-.. code-block:: python
-
- OAUTH_TOKEN = auth['oauth_token']
- OAUTH_TOKEN_SECRET = auth['oauth_token_secret']
-
-Send the user to the authentication url, you can obtain it by accessing
-
-.. code-block:: python
-
- auth['auth_url']
-
-Handling the Callback
-^^^^^^^^^^^^^^^^^^^^^
-
- If your application is a Desktop or Mobile Application *oauth_verifier* will be the PIN code
-
-After they authorize your application to access some of their account details, they'll be redirected to the callback url you specified in ``get_authentication_tokens``
-
-You'll want to extract the ``oauth_verifier`` from the url.
-
-Django example:
-
-.. code-block:: python
-
- oauth_verifier = request.GET['oauth_verifier']
-
-Now that you have the ``oauth_verifier`` stored to a variable, you'll want to create a new instance of Twython and grab the final user tokens
-
-.. code-block:: python
-
- twitter = Twython(APP_KEY, APP_SECRET,
- OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
-
- final_step = twitter.get_authorized_tokens(oauth_verifier)
-
-Once you have the final user tokens, store them in a database for later use::
-
- OAUTH_TOKEN = final_step['oauth_token']
- OAUTH_TOKEN_SECRET = final_step['oauth_token_secret']
-
-For OAuth 2 (Application Only, read-only) authentication, see `our documentation `_
-
-Dynamic Function Arguments
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Keyword arguments to functions are mapped to the functions available for each endpoint in the Twitter API docs. Doing this allows us to be incredibly flexible in querying the Twitter API, so changes to the API aren't held up from you using them by this library.
-
-Basic Usage
------------
-
-**Function definitions (i.e. get_home_timeline()) can be found by reading over twython/endpoints.py**
-
-Create a Twython instance with your application keys and the users OAuth tokens
-
-.. code-block:: python
-
- from twython import Twython
- twitter = Twython(APP_KEY, APP_SECRET,
- OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
-
-Authenticated Users Home Timeline
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Documentation: https://developer.twitter.com/en/docs/tweets/timelines/api-reference/get-statuses-home_timeline
-
-.. code-block:: python
-
- twitter.get_home_timeline()
-
-Updating Status
-~~~~~~~~~~~~~~~
-
-This method makes use of dynamic arguments, `read more about them `_
-
-Documentation: https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update
-
-.. code-block:: python
-
- twitter.update_status(status='See how easy using Twython is!')
-
-Searching
-~~~~~~~~~
-
- https://developer.twitter.com/en/docs/tweets/search/api-reference/get-search-tweets says it takes "q" and "result_type" amongst other arguments
-
-.. code-block:: python
-
- twitter.search(q='twitter')
- twitter.search(q='twitter', result_type='popular')
-
-Advanced Usage
---------------
-
-- `Advanced Twython Usage `_
-- `Streaming with Twython `_
-
-
-Notes
------
-
-- Twython 3.0.0 has been injected with 1000mgs of pure awesomeness! OAuth 2 application authentication is now supported. And a *whole lot* more! See the `CHANGELOG `_ for more details!
-
-Questions, Comments, etc?
--------------------------
-
-My hope is that Twython is so simple that you'd never *have* to ask any questions, but if you feel the need to contact me for this (or other) reasons, you can hit me up at ryan@venodesigns.net.
-
-Or if I'm to busy to answer, feel free to ping mikeh@ydekproductions.com as well.
-
-Follow us on Twitter:
-
-- `@ryanmcgrath `_
-- `@mikehelmick `_
-
-Want to help?
--------------
-
-Twython is useful, but ultimately only as useful as the people using it (say that ten times fast!). If you'd like to help, write example code, contribute patches, document things on the wiki, tweet about it. Your help is always appreciated!
diff --git a/examples/get_direct_messages.py b/examples/get_direct_messages.py
index 5a27a066..fa80865b 100644
--- a/examples/get_direct_messages.py
+++ b/examples/get_direct_messages.py
@@ -1,17 +1,5 @@
from twython import Twython, TwythonError
twitter = Twython(APP_KEY, APP_SECRET, OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
-
get_list = twitter.get_direct_messages()
-#Returns All Twitter DM information which is a lot in a list format
-
-dm_dict = get_list[0]
-#Sets get_list to a dictionary, the number in the list is the direct message retrieved
-#That means that 0 is the most recent and n-1 is the last DM revieved.
-#You can cycle through all the numbers and it will return the text and the sender id of each
-
-print dm_dict['text']
-#Gets the text from the dictionary
-
-print dm_dict['sender']['id']
-#Gets the ID of the sender
+print(get_list)
diff --git a/examples/get_user_timeline.py b/examples/get_user_timeline.py
index 0a1f4df5..55ab427f 100644
--- a/examples/get_user_timeline.py
+++ b/examples/get_user_timeline.py
@@ -7,4 +7,4 @@
except TwythonError as e:
print e
-print user_timeline
+print(user_timeline)
diff --git a/setup.py b/setup.py
index 11cc2b43..0531221c 100755
--- a/setup.py
+++ b/setup.py
@@ -31,8 +31,9 @@
keywords='twitter search api tweet twython stream',
description='Actively maintained, pure Python wrapper for the \
Twitter API. Supports both normal and streaming Twitter APIs',
- long_description=open('README.rst').read() + '\n\n' +
- open('HISTORY.rst').read(),
+ long_description=open('README.md').read() + '\n\n' +
+ open('HISTORY.md').read(),
+ long_description_content_type='text/markdown',
include_package_data=True,
packages=packages,
classifiers=[