Skip to main content
https://codecov.io/gh/odrling/peony-twitter/branch/master/graph/badge.svg 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.

Authorize your client

You can use peony.oauth_dance to authorize your client:

>>> 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

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)

Documentation

Read Peony’s documentation on Read The Docs.

There is a #peony channel on the Libera IRC network for support and discussion about Peony. You can use Libera’s webchat to connect to this channel from your web browser.

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:

make

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).

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

tox

Metadata

Release files for peony-twitter 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for peony-twitter 2.1.2
File Size Uploaded
peony-twitter-2.1.2.tar.gz 32.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for peony-twitter 2.1.2
File Interpreter ABI Platform
peony_twitter-2.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 69.9 kB

Release files / peony-twitter-2.1.2.tar.gz

Download URL peony-twitter-2.1.2.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8a4b29919df070e387234ed71be3b0efa7068c9caf87fcc17e581320f6748453
BLAKE2b-256 checksum
How to use checksums
72936ba24dea212c87cf846f62dc766dd8eb6ef3e0384528676889c824b507ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / peony_twitter-2.1.2-py3-none-any.whl

Download URL peony_twitter-2.1.2-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bcd8ed166107c40771d31a86b98fb36443ed262fb2fabd0cdc746d4b6aa36ca
BLAKE2b-256 checksum
How to use checksums
fb923d6265e1c42e3031424bbb4c4ea3877a8efbbd1a64af0f1168900828ca58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release history Release notifications | RSS feed

This release

2.1.2 This release

2 release files

2.1.1

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.7

2 release files

1.1.6

2 release files

1.1.5

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.6

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page