diff --git a/README.rst b/README.rst index 2dfb6cf..8776fca 100644 --- a/README.rst +++ b/README.rst @@ -1,29 +1,26 @@ -Mastodon.py +Mastodonplus.py =========== -Python wrapper for the Mastodon ( https://github.com/tootsuite/mastodon/ ) API. -Feature complete for public API as of Mastodon version 3.0.1 and easy to get started with: +Fork of Python wrapper for the Mastodon ( https://github.com/tootsuite/mastodon/ ) API. -.. code-block:: python +This fork's goal is to add new Mastodon API's endpoints to the excellent halcy's wrapper. # Register your app! This only needs to be done once. Uncomment the code and substitute in your information. - + from mastodon import Mastodon - ''' Mastodon.create_app( 'pytooterapp', - api_base_url = 'https://mastodon.social', + api_base_url = 'https://your-mastodon.server', to_file = 'pytooter_clientcred.secret' ) - ''' # Then login. This can be done every time, or use persisted. from mastodon import Mastodon - + mastodon = Mastodon( client_id = 'pytooter_clientcred.secret', - api_base_url = 'https://mastodon.social' + api_base_url = 'https://your-mastodon.server' ) mastodon.log_in( 'my_login_email@example.com', @@ -34,43 +31,20 @@ Feature complete for public API as of Mastodon version 3.0.1 and easy to get sta # To post, create an actual API instance. from mastodon import Mastodon - + mastodon = Mastodon( access_token = 'pytooter_usercred.secret', - api_base_url = 'https://mastodon.social' + api_base_url = 'https://your-mastodon.server' ) mastodon.toot('Tooting from python using #mastodonpy !') -You can install Mastodon.py via pypi: +You can install Mastodonplus.py via pypi: -.. code-block:: Bash - # Python 3 - pip3 install Mastodon.py + pip3 install Mastodonplus.py -Note that python 2.7 is now no longer officially supported. It will still -work for a while, and we will fix issues as they come up, but we will not -be testing specifically for python 2.7 any longer. +# New features -Full documentation and basic usage examples can be found -at http://mastodonpy.readthedocs.io/en/stable/ . +* 26.8.2022. Added New endpoints: /api/v1/admin/domain_blocks (list, show by id, delete and create) +* 27.8.2022. Mastodon v3.1.4. Added 'remote" param to GET /api/v1/timelines/public REST API. -Maintenance ------------ -As you might have noticed, I have not done any maint work on this project in a while. -I am currently extremely busy with my actual paid work, and will not be able to work -on Mastodon.py until I hand in my dissertation, i.e. there will be no new releases or -code from me for at least the rest of this year, maybe part of next. If you would like -to temporarily take over bug fixing / test writing / new method implementing, hit me up. - -Acknowledgements ----------------- -Mastodon.py contains work by a large amount of contributors, many of which have -put significant work into making it a better library. You can find some information -about who helped with which particular feature or fix in the changelog. - -.. image:: https://travis-ci.org/halcy/Mastodon.py.svg?branch=master - :target: https://travis-ci.org/halcy/Mastodon.py -.. image:: https://codecov.io/gh/halcy/Mastodon.py/branch/master/graph/badge.svg - :target: https://codecov.io/gh/halcy/Mastodon.py - diff --git a/mastodon/Mastodon.py b/mastodon/Mastodon.py index 53b5081..4b5a02d 100644 --- a/mastodon/Mastodon.py +++ b/mastodon/Mastodon.py @@ -756,7 +756,7 @@ class Mastodon: if since_id != None: since_id = self.__unpack_id(since_id) - + params_initial = locals() if timeline == "local": @@ -788,7 +788,7 @@ class Mastodon: since_id=since_id, limit=limit) @api_version("1.0.0", "2.6.0", __DICT_VERSION_STATUS) - def timeline_public(self, max_id=None, min_id=None, since_id=None, limit=None, only_media=False): + def timeline_public(self, max_id=None, min_id=None, since_id=None, limit=None, only_media=False, remote=None): """ Fetches the public / visible-network timeline, not including replies. @@ -809,7 +809,10 @@ class Mastodon: if only_media == False: del params_initial['only_media'] - + + if remote != None: + params_initial['remote'] = remote + url = '/api/v1/timelines/public' params = self.__generate_params(params_initial) diff --git a/setup.py b/setup.py index 3e4f559..6171317 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,6 @@ -from setuptools import setup +import setuptools + +VERSION = '1.5.5.1' test_deps = [ 'pytest', @@ -25,10 +27,16 @@ extras = { "blurhash": blurhash_deps, } -setup(name='Mastodon.py', - version='1.5.1', - description='Python wrapper for the Mastodon API', +with open('README.rst', 'r', encoding='utf-8') as fh: + long_description = fh.read() + +setuptools.setup( + name='Mastodonplus.py', + version=VERSION, + description='Python wrapper for the Mastodon API (new endpoints)', packages=['mastodon'], + long_description=long_description, + long_description_content_type='text/markdown', install_requires=[ 'requests>=2.4.2', 'python-dateutil', @@ -39,7 +47,7 @@ setup(name='Mastodon.py', ] + blurhash_deps, tests_require=test_deps, extras_require=extras, - url='https://github.com/halcy/Mastodon.py', + url='https://git.mastodont.cat/spla/Mastodon.py', author='Lorenz Diener', author_email='lorenzd+mastodonpypypi@gmail.com', license='MIT',