Pytweet

Latest version: v1.3.6

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

1.3.5

Breaking Changes

* `client.user` method name changed to `client.account`. It works the same, we just changed the name.
* Refactored `fetch_user_by_username()` method name to `fetch_user_by_name`
* Fixed typos in `DirectMessage.author` property to `recipient` the user who receive the message.

New & Improve Methods

Improve
* Finished `def Client.tweet()` method. Added a whole bunch of arguments! You can check our docs for that!
* Finished `def User.send()` method. Added a whole bunch of arguments! You can check our docs for that!
* We also improved the chances of you getting ratelimit by:
- Instead of returning a Twitter object we return their raw-object i.e id which you can fetch. Not all method return id! Some which return a pre-made.
- Fixed: doc string, dunder repr & str method, code refactoring, docs style, commit messages to make commit more clear and human understandable, Removed useless methods which you can use directly rather then making another methods.


Methods

* Added `def User.trigger_typing()` method. Trigger the typing animation in the user's dm for more then 3 seconds!
* Added `def DirectMessage.mark_read()` method. Mark someone's message as read and other messages before that.
* Added `def Client.search_geo()` method. Search a location with the given arguments.
* Added `def Client.create_welcome_message` method. Create a welcome message for the authenticated user.
* Added `def Client.fetch_welcome_message` method. Fetch a welcome message with the id.
* Added `def Client.fetch_welcome_message_rule` method. Fetch a welcome message rule with the id.
* Added `def Client.fetch_space` method. Fetch a space with the space's id.
* Added `def Client.fetch_space_by_title` method. Fetch a space with the title also with the space's state using `enums SpaceState`.
* Added `def Client.create_custom_profile()` method. Create a custom profile where you can attach in a `def User.send()` method.
* Added `def Client.stream()` method. Stream real time for tweets!
* Added `def User.report()` method. Report a user as spam account to twitter.
* Added `def Tweet.raw_reply_setting()` method. Returns the tweet's reply setting in a string.

Classes

* Added `class Geo` class. Its a new attachment for tweet and this will be returns in `Client.search_geo()`.
* Added `class CTA` class. A new attachment that can be attach in a direct message. CTA also known as call-to-action, will perform an action whenever it got "call" example of this is `dataclass Button`.
* Added `class WelcomeMessage` class. A message that's going to be trigger whenever someone open the authenticated user's dm.
* Added `class WelcomeMessageRule` class. Determines which Welcome Message will be shown in a given conversation.
* Added `class Space` class. Represent a space event in twitter.
* Added `class File` class. Represent a file where you can attach in someone's dm or in a tweet.
* Added `class CustomProfile` class. With this you can dm someone with different profile picture and name.
* Added `class Stream` class. You can make a stream connection with this, make an instance and pass it in your client instance with the stream kwarg! after that use the `def Client.stream()` at the very buttom of your code!

Dataclasses

* Added `dataclass Button`. Returns via `property CTA.buttons` property.
* Added `dataclass PollOption`. Returns via `property Poll.options` property.
* Added `dataclass Option`. Returns via `property QuickReply.options` property.
* Added `dataclass StreamRule`. Returns via `property Stream.rules` property.

Enums
* Added `Enum SpaceState`. Represent the space's state either its a live or scheduled space.
* Added `Enum ReplySetting`. Represent a tweet's reply setting.
* Added `Enums ButtonStyle`. Represent the button's type.

Events
New feature we keep for the last announcement! Events is here! you can make method and pytweet will trigger the method and executing the code bellow it! We currently only have 3 events, you can check our docs for full documentations in event reference. To make an event you just need to use the event decorator! example:

py

client.event
def on_stream(tweet, connection):
... do something with tweet and connection you got!

1.2.0

1.1.3

1.1.0

Added most of the features, including: functions to get info about user and a tweet.

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.