![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.
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
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.