![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
pytweet
is a simple Python library with one goal: to retrieve tweet information from X for free.
Inspired by React-tweet project.
pip install python-tweet
From source:
make install
or
pip install .
It may cause conflicts with PyTweet if you are using it in your project.
import asyncio
import json
from pytweet import get_tweet
async def main():
tweet_id = "1803774806980022720"
data = await get_tweet(tweet_id)
with open(f"{tweet_id}.json", "w") as f:
json.dump(data, f, indent=2)
if __name__ == '__main__':
asyncio.run(main())
import json
from pytweet.sync import get_tweet
def main():
tweet_id = "1803774806980022720"
data = get_tweet(tweet_id)
with open(f"{tweet_id}.json", "w") as f:
json.dump(data, f, indent=2)
if __name__ == '__main__':
main()
If you prefer working with object-oriented concepts, you may prefer receiving a class. However, be aware that the returned JSON from syndication is undocumented, so errors or data loss may occur during conversion to a class.
Requires the installation of pydantic.
pip install python-tweet[pydantic]
import asyncio
import json
from pytweet import get_tweet
async def main():
tweet_id = "1803774806980022720"
tweet = await get_tweet(tweet_id)
with open(f"{tweet_id}.json", "w") as f:
json.dump(tweet.model_dump(mode="json"), f, indent=2)
if __name__ == '__main__':
asyncio.run(main())
If you are using Pydantic but want to receive a dict
, pass the as_dict
argument to the get_tweet
function.
python-tweet
is released under the MIT License.
See the LICENSE file for license information.
FAQs
A Python library for retrieving tweets from X (f.k.a. Twitter)
We found that python-tweet demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.