
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
A Python SDK for the Imgur API.
The package is supposed to be in strict accordance with the Imgur's documentation, i.e. description for any endpoint implemented in the SDK can also be found there.
The package does not have any third-party dependencies; it requires only Python 3.7+.
Using pip:
$ pip install pyimgurapi
client_id
and client_secret
.https://api.imgur.com/oauth2/authorize?client_id=<your_client_id>&response_type=token
(replace <your_client_id>
with the actual ID)refresh_token
value from the URL field.from pyimgurapi import ImgurAPI
api = ImgurAPI(
refresh_token="<refresh_token>",
client_id="<client_id>",
client_secret="<client_secret>",
)
api.auth()
Getting info about an image:
from pyimgurapi import ImgurAPI
api = ImgurAPI(
refresh_token="<refresh_token>",
client_id="<client_id>",
client_secret="<client_secret>",
)
api.auth()
meme_image = api.image.get_image("6yHmlwT")
Then you can access attributes of the response using a dot-notation:
print(meme_image.data.link)
or using a subscript-notation:
print(meme_image["data"]["link"])
Uploading a new image:
from pyimgurapi import ImgurAPI
api = ImgurAPI(
refresh_token="<refresh_token>",
client_id="<client_id>",
client_secret="<client_secret>",
)
api.auth()
filename = "cat1.jpg"
with open(filename, 'rb') as f:
new_image = api.image.upload(
f,
filename,
title="New image", # optional
description="Absolutely new image" # optional
)
Then you can access attributes of the new image as well:
print(new_image.data.link)
See the contributing guidelines.
FAQs
A Python SDK for the Imgur API.
We found that pyimgurapi 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.