UnsplashX
UnsplashX is
- an extremely simple Unsplash eXploerer for Python
- written in Python Standard Library
UnsplashX supports to
- get Unsplash Source's URL of a photo without the Official Unsplash API
Installation
pip install unsplashx
Quickstart
import unsplashx
unsplashx.source()
License
UnsplashX has a BSD-3-Clause license, as found in the LICENSE file.
Documentation
unsplashx.status
unsplashx.status
Unsplash API Status URL.
unsplashx.changelog
unsplashx.changelog
Unsplash API Changelog URL.
unsplashx.id
unsplashx.id(link, verbose=False)
Get the identifier given Unsplash share link URL.
Get the ID of a photo
https://unsplash.com/photos/{id}
Get the username of a user
https://unsplash.com/@{id}
Get the ID of a collection
https://unsplash.com/collections/{id}/{name}
Parameters:
- link (str): Unsplash share link URL of a photo, a user, or a collection.
- verbose (bool, optional): Whether to enable verbose output. Defaults to
False.
Returns:
(str): The identifier, that can be the ID of a photo, the username of a user, or the ID of a collection.
unsplashx.source
unsplashx.source(photo=None, user=None, liked=None, collection=None, featured=None, resolution=None, update=None, query=None, verbose=False)
Get Unsplash Source download link URL of a photo given the parameters.
Get a random photo
https://source.unsplash.com/randomOptionally, limit to a featured selection
https://source.unsplash.com/featuredOptionally, specify a size
https://source.unsplash.com/{resolution}Optionally, limit to only updaing daily or weekly
https://source.unsplash.com/{update}Optionally, limit to matching search terms
https://source.unsplash.com/random?{query}Optionally, narrow the selection further
https://source.unsplash.com/featured/{resolution}/{update}?{query}
Get a photo
https://source.unsplash.com/{id}Optionally, specify a size
https://source.unsplash.com/{id}/{resolution}
Get a random photo from a user's photos
https://source.unsplash.com/user/{id}Optionally, narrow the selection further
https://source.unsplash.com/user/{id}/featured/{resolution}/{update}
Get a random photo from a user's liked photos
https://source.unsplash.com/user/{id}/likesOptionally, specify a size
https://source.unsplash.com/user/{id}/likes/{resolution}
Get a random photo from a collection's photos
https://source.unsplash.com/collection/{id}Optionally, narrow the selection further
https://source.unsplash.com/collection/{id}/{resolution}/{update}
Note:
Unsplash Source is being deprecated. Existing uses will continue to work, however for new projects use the full Unsplash API.
Parameters:
- photo (str, optional): Unsplash share link URL or the ID of a photo.
- user (str, optional): Unsplash share link URL or the username of a user.
- liked (bool, optional): Whether to limit to a user's liked photos. Defaults to
False. - collection (str, optional): Unsplash share link URL or the ID of a collection.
- featured (bool, optional): Whether to limit to a featured selection. Defaults to
False. - resolution (str, optional): The size of a photo to be set. Formats to
{width}x{height}. Defaults toNone. - update (str, optional): Whether to limit to only updating daily or weekly. Defaults to
False. - query (str, optional): Comma-separated search terms. Defaults to
None. - verbose (bool, optional): Whether to enable verbose output. Defaults to
False.
Returns:
(str): Unsplash Source download link URL of a photo.
Reference:
[1] https://changelog.unsplash.com/deprecations/2021/11/25/source-deprecation.html
Contributing
Thanks for your interest in contributing to UnsplashX! Please feel free to create a pull request.
Changelog
UnsplashX 0.1.0
- Made Unsplash Source's URL constructor functional
Metadata
Release files for unsplashx 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| unsplashx-0.1.3.tar.gz | 5.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| unsplashx-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / unsplashx-0.1.3.tar.gz
| Download URL | unsplashx-0.1.3.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43da3b4d5acbdf6becbd78a2b922ef6bf3fd00582882fc5393397a3270346877
|
|
BLAKE2b-256 checksum How to use checksums |
8a6c8d869fe3e4fda4d66769cb1d5b57d689f321b53fa263af7483bb28ea16f3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / unsplashx-0.1.3-py3-none-any.whl
| Download URL | unsplashx-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e3ffe91f43358c4526878ada0601643ddb31514fffce0a2df44edb21f1694906
|
|
BLAKE2b-256 checksum How to use checksums |
626b3ff8a2f1be4bf2aa611b7dfb04fbf56fba6e920317dab516412d9451539e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|