Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Twypy is a super lightweight Twitter REST API v1.1 client written in Python, based on Birdy.
Minimizing lines of code it aims to be a simpler yet more intuitive aproach to avoid all the boilerplate that most of the clients has using a simplified call constructor.
The requests come with a built-in code syntax to easely map all API calls.
You can install the package via easy_install
or pip
:
easy_install twypy
pip install twypy
Import the module at the beginning of your file:
from twypy.api import Api
Init the client
with your credentials:
client = Api(client_key, client_secret, access_token, access_token_secret)
Call Twitter REST API methods following this example pattern:
<method> <first>/<second --> api.<first>.<second>.<method>.(<params>)
So the following GET
resource url:
GET statuses/user_timeline | https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=twitterapi
with Twypy is handled with the following syntax:
client.api.statuses.user_timeline.get(screen_name='twitterapi')
A visual example of previous explanation with a response
object goes like this:
response = client.api.statuses.user_timeline.get(screen_name='twitterapi')
The same using a POST
resource url:
POST statuses/update | https://api.twitter.com/1.1/statuses/update.json?status='Maybe he'll finally find his keys. #peterfalk!'
with Twypy is handled with the following syntax:
client.api.statuses.update.post(status='Maybe he'll finally find his keys. #peterfalk!')
A visual example of previous explanation with a response
object goes like this:
response = client.api.statuses.update.post(status='Maybe he'll finally find his keys. #peterfalk!')
To simply see the the JSON response just print the response
object:
print response
Twypy is Copyright © 2014 Roger Fernandez Guri. It is free software, and may be redistributed under the terms specified in the LICENCE file.
FAQs
Twitter REST API v1.1 client for Python
We found that twypy 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.