All Projects → odrling → Peony Twitter

odrling / Peony Twitter

Licence: mit
An asynchronous Twitter API client for Python 3.5+

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Peony Twitter

Aiormq
Pure python AMQP 0.9.1 asynchronous client library
Stars: ✭ 112 (+80.65%)
Mutual labels:  async, asyncio, asynchronous
Chili
Chili: HTTP Served Hot
Stars: ✭ 7 (-88.71%)
Mutual labels:  async, asyncio, asynchronous
Kubernetes asyncio
Python asynchronous client library for Kubernetes http://kubernetes.io/
Stars: ✭ 147 (+137.1%)
Mutual labels:  async, asyncio, asynchronous
Tornado Celery
Non-blocking Celery client for Tornado
Stars: ✭ 561 (+804.84%)
Mutual labels:  async, asyncio, asynchronous
Fastapi
FastAPI framework, high performance, easy to learn, fast to code, ready for production
Stars: ✭ 39,588 (+63751.61%)
Mutual labels:  async, asyncio
Iguazu Rest
✨ Iguazu REST is a plugin for the Iguazu ecosystem that allows for pre-built async calls for REST with smart caching.
Stars: ✭ 21 (-66.13%)
Mutual labels:  async, asynchronous
Csp
Communicating Sequential Processes in JavaScript
Stars: ✭ 33 (-46.77%)
Mutual labels:  async, asynchronous
Async
An awesome asynchronous event-driven reactor for Ruby.
Stars: ✭ 1,000 (+1512.9%)
Mutual labels:  async, asyncio
Handle Path Oz
Android Library to handle multiple Uri's(paths) received through Intents.
Stars: ✭ 36 (-41.94%)
Mutual labels:  async, asynchronous
Uvloop
Ultra fast asyncio event loop.
Stars: ✭ 8,246 (+13200%)
Mutual labels:  async, asyncio
Aiodine
🧪 Async-first Python dependency injection library
Stars: ✭ 51 (-17.74%)
Mutual labels:  async, asyncio
Ktor
Framework for quickly creating connected applications in Kotlin with minimal effort
Stars: ✭ 9,190 (+14722.58%)
Mutual labels:  async, asynchronous
Request.swift
A tiny HTTP client written in swift. URLSession alternative
Stars: ✭ 14 (-77.42%)
Mutual labels:  async, asynchronous
Turbulette
😴 Turbulette - A batteries-included framework to build high performance, fully async GraphQL APIs
Stars: ✭ 29 (-53.23%)
Mutual labels:  async, asyncio
Parallel Ssh
Asynchronous parallel SSH client library.
Stars: ✭ 864 (+1293.55%)
Mutual labels:  async, asynchronous
Vim Strand
A barebones Vim plugin manger written in Rust
Stars: ✭ 38 (-38.71%)
Mutual labels:  async, asyncio
Before After Hook
wrap methods with before/after hooks
Stars: ✭ 49 (-20.97%)
Mutual labels:  async, asynchronous
Aiomultiprocess
Take a modern Python codebase to the next level of performance.
Stars: ✭ 1,070 (+1625.81%)
Mutual labels:  async, asyncio
Ea Async
EA Async implements async-await methods in the JVM.
Stars: ✭ 1,085 (+1650%)
Mutual labels:  async, asynchronous
Vue Loadable
⏳ Improve your loading state control with pretty simple methods and helpers.
Stars: ✭ 23 (-62.9%)
Mutual labels:  async, asynchronous

Asynchronous Twitter API client for Python 3.5+

.. image:: https://travis-ci.org/odrling/peony-twitter.svg?branch=master :target: https://travis-ci.org/odrling/peony-twitter

.. image:: https://codecov.io/gh/odrling/peony-twitter/branch/master/graph/badge.svg :target: https://codecov.io/gh/odrling/peony-twitter

.. image:: https://readthedocs.org/projects/peony-twitter/badge/?version=stable :target: https://peony-twitter.readthedocs.io/en/stable/?badge=stable :alt: Documentation Status

Installation

To install this module simply run::

pip install peony-twitter[all]

This will install all the modules required to make peony run out of the box. You might feel like some of them are not fit for your needs. Check Advanced installation_ for more information about how to install only the modules you will need.

.. _Advanced installation: https://peony-twitter.readthedocs.io/en/latest/adv_usage/install.html#adv-install

Authorize your client

You can use peony.oauth_dance to authorize your client:

.. code-block:: python

>>> from peony.oauth_dance import oauth_dance
>>> tokens = oauth_dance(YOUR_CONSUMER_KEY, YOUR_CONSUMER_SECRET)
>>> from peony import PeonyClient
>>> client = PeonyClient(**tokens)

This should open a browser to get a pin to authorize your application.

Getting started

You can easily create a client using the class PeonyClient. Make sure to get your api keys and access tokens from Twitter's application management page_ and/or to Authorize your client_

.. code-block:: python

import asyncio

# NOTE: the package name is peony and not peony-twitter
from peony import PeonyClient

loop = asyncio.get_event_loop()

# create the client using your api keys
client = PeonyClient(consumer_key=YOUR_CONSUMER_KEY,
                     consumer_secret=YOUR_CONSUMER_SECRET,
                     access_token=YOUR_ACCESS_TOKEN,
                     access_token_secret=YOUR_ACCESS_TOKEN_SECRET)

# this is a coroutine
req = client.api.statuses.update.post(status="I'm using Peony!!")

# run the coroutine
loop.run_until_complete(req)

.. _Twitter's application management page: https://apps.twitter.com

.. _Authorize your client: #authorize-your-client

Documentation

Read Peony's documentation_.

.. _Peony's documentation: https://peony-twitter.readthedocs.io

Contributing

Every kind of contribution is appreciated.

If you find a bug please start an issue and if you're very motivated you can create a pull request.

If you have a suggestion you can also start an issue and create a pull request if you managed to make it work.

Tests

To run the tests run:

.. code-block:: bash

make test

The first time this command is run it will install all the dependencies which can take a bit of time.

The tests include a code style test. The code style is mostly PEP8, the only exception so far being long urls included in docstrings and some imports that are not at the top of the file (because they can't be there).

To resolve the most trivial errors you can run:

.. code-block:: bash

make format

Note that running make is equivalent to running make format && make test

You can also use tox to run the tests, a configuration file is provided:

.. code-block:: bash

tox
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].