Changelog¶
This page keeps a detailed, human-friendly rendering of what’s new and changed in specific versions.
v0.1.3¶
Hot fix for cases where None was no longer accepted, even though it was the default.
Fixed the wrong or no repr appearing for osme models.
v0.1.2¶
Added support for bottom_text parameter in
CanvasMemes.no_bitches()method.Fixed a bug where the aiohttp session could be closed when passed by the user. The library will always recreate a new session if that’s the case.
Hotfix for Python 3.14 compatibility. The wrapper now supports Python 3.11 to 3.14.
Other Miscellaneous fixes and improvements internally. For example, the type checking implementation was improved to handle more edge cases and be less error-prone.
Improve error messages for some exceptions, like missing keyword arguments or passing positional arguments when only keyword arguments are accepted.
Full Changelog: GitHub Diff
v0.1.1¶
Just for PyPi because v0.1.0 already uploaded to PyPi but something went wrong with it.
Full Changelog: GitHub Diff
v0.1.0¶
Big update! Lots of QoL changes.
New Features¶
Added support for Authorization token; pass your token to the
token=parameter in the constructor of theClient.This may be required for some endpoints, in the future.
This replaces the
key=parameter. This parameter is removed from all relevent classes and methods.Added support for the
username_colorfield for the rankcard endpoint (PremiumClient.rankcard(),Rankcard).Added
AnimuClient.get()method.Added
Animuenum for theAnimuClient.get()method.Added
AnimalClient.get_image_or_fact()method.Added shortcuts to using
AnimuClient.get():Added shortcuts to using
CanvasClient.filter():Added
TweetThemeenum for theCanvasClient.generate_tweet()method andsomerandomapi.Tweetclass.All color methods can now take an integer as a value for the color parameter. This is a hex value, e.g. 0xFF0000 for red.
somerandomapi.RankcardandPremiumClient.rankcard()now take atemplateparameter. This takes an integer from 1 to 9.
Removals¶
Support for Python 3.9 and 3.10 was removed. The library now requires Python 3.11 or higher.
Client.generate_bot_token()no longer takes abot_idparameter. This is because the API no longer supports this feature.Client.dictionarywas removed. The API no longer has this feature.The class
LyricsLinkswas removed. The API no longer has this feature.AnimuClient.face_palmwas removed. The API no longer has this feature.
Bug Fixes¶
Fixed a bug where
PremiumClient.rankcard()did not use the correct endpoint.Fixed a bug where the random color from the library would be less than 6 characters long.
Miscellaneous¶
The
session=parameter in the constructor of theClientcan no longer takeNoneas a value and the passed session will not be closed by the library, you are responsible for that.Most parameters for the following methods can no longer take
Noneas a value:Either pass a value or don’t pass the parameter at all.
The
fontparameter inClient.welcome_image(),PremiumClient.welcome_image,WelcomeFree, andWelcomePremiumnow takes a range of 1 to 7 instead of 0 to 8.Renamed
FactAnimalenum toAnimal.Renamed
ImgAnimalenum toImg.Renamed
AnimuClient.quotetoAnimuClient.random_quote().Renamed
Canvad.filter_colo[u]rtoCanvasClient.color_filter()andCanvasClient.colour_filter().Renamed
CanvasClient.filter_thresholdtoCanvasClient.threshold_filter().The
themeparameter inCanvasClient.generate_tweet()now takes an enum of typeTweetThemeinstead of a string. Still defaults to dark (TweetTheme.DARK).The
lyricsendpoint has changed. The following changes were made in this library:.authorwas changed toLyrics.artist..thumbnailand.linksare simply strings now,Lyrics.thumbnailandLyrics.url, respectively.
Overall the backend of the library was partially rewritten to make it faster and more efficient.
The readthedocs theme changed from
sphinx_rtd_themetofuro.All docstrings were revisited to be constsistent and follow the same format.
Brand new README.
Full Changelog: GitHub Diff
v0.0.8¶
Add debug logging to the http client and endpoints validation. This will log the request and response data if the logger is set to debug. Here is how to enable it:
import logging # http sra_http_logger = logging.getLogger("somerandomapi.http") sra_http_logger.setLevel(logging.DEBUG) # endpoints validation sra_endpoints_logger = logging.getLogger("somerandomapi.endpoints") sra_endpoints_logger.setLevel(logging.DEBUG)
Corrected the font range for the welcome cards to be between 0 and 7. It was previously between 0 and 10. To prevent a breaking change, the library sets the font to 7 if the provided font is greater than 7.
- Affected classes and methods:
Added a new method to the
AnimalClientclass to help with trying all available animal endpoints in order to get an image and a fact or just one of them. The method is calledAnimalClient.get_image_or_fact()and takes all the available animal names and endpoints and tries to get an image and a fact from each one until it succeeds. It returns an instance ofAnimalImageOrFactwith two optional attributes: image and fact. If the method fails to get an image and a fact, it will return None for both attributes.import somerandomapi client = somerandomapi.Client(...) image_fact = await client.animal.get_image_or_fact(<enum or str>) # Example: "cat" or somerandomapi.Animal.PIKACHU print(image_fact.image, image_fact.fact) # <image url or None> <fact or None>
Full Changelog: GitHub Diff
v0.0.7¶
Fix:
discriminatorfield in relevant classes and methods:
It would previously raise an error if the discriminator was provided.
Fix an internal error when the API returns an unexpected status code.
Fix unparsed TypingError.
Sometimes it would send “_UnionGenericAlias” in the error message instead of the actual field type. This was fixed by always parsing the field’s type.
Full Changelog: GitHub Diff
v0.0.6¶
Make: discriminator optional in relevant classes and methods: -
Client.welcome_image()-PremiumClient-Rankcard-WelcomeFree-WelcomePremium
Full Changelog: GitHub Diff
v0.0.5¶
Fix: Exceptions not being accessed from the main namespace (
somerandomapi...).Fix: Link to API in README.
Full Changelog: GitHub Diff
v0.0.4¶
Urgent Fix: Base URL for requests to the API changed from
https://some-random-api.ml/tohttps://some-random-api.com/.
Full Changelog: GitHub Diff
v0.0.3¶
Correct base API URL. URL changed from
https://some-random-api.ml/tohttps://some-random-api.com/.Fix mistake in
AnimalClient.get_image_and_factFix enum conversion errors
Fix link to API in documentation.
Full Changelog: GitHub Diff
v0.0.2¶
Fix: Critical NameError in
Client.
v0.0.1¶
Initial Release!