# UnsplashX
[![GitHub][github_badge]][github_link] [![PyPI][pypi_badge]][pypi_link]
**UnsplashX** is
* an extremely simple **Unsplash** e**X**ploerer for Python
* written in Python Standard Library
**UnsplashX** supports to
* get Unsplash Source's URL of a photo without the Official Unsplash API
## Installation
```bash
pip install unsplashx
```
## Quickstart
```python
import unsplashx
unsplashx.source()
```
## License
**UnsplashX** has a BSD-3-Clause license, as found in the [LICENSE](https://github.com/imyizhang/unsplashx/blob/main/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/random
> ```
> Optionally, limit to a featured selection
> ```
> https://source.unsplash.com/featured
> ```
> Optionally, 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}/likes
> ```
> Optionally, 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 to `None`.
* **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
[github_badge]: https://badgen.net/badge/icon/GitHub?icon=github&color=black&label
[github_link]: https://github.com/imyizhang/unsplashx
[pypi_badge]: https://badgen.net/pypi/v/unsplashx?icon=pypi&color=black&label
[pypi_link]: https://www.pypi.org/project/unsplashx
Raw data
{
"_id": null,
"home_page": "https://pypi.org/project/unsplashx",
"name": "unsplashx",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Yi Zhang",
"author_email": "yizhang.dev@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8a/6c/8d869fe3e4fda4d66769cb1d5b57d689f321b53fa263af7483bb28ea16f3/unsplashx-0.1.3.tar.gz",
"platform": null,
"description": "# UnsplashX\n\n[![GitHub][github_badge]][github_link] [![PyPI][pypi_badge]][pypi_link]\n\n**UnsplashX** is \n\n* an extremely simple **Unsplash** e**X**ploerer for Python\n* written in Python Standard Library\n\n**UnsplashX** supports to\n\n* get Unsplash Source's URL of a photo without the Official Unsplash API\n\n\n\n\n## Installation\n\n```bash\npip install unsplashx\n```\n\n\n\n## Quickstart\n\n```python\nimport unsplashx\n\nunsplashx.source()\n```\n\n\n\n## License\n\n**UnsplashX** has a BSD-3-Clause license, as found in the [LICENSE](https://github.com/imyizhang/unsplashx/blob/main/LICENSE) file.\n\n\n\n## Documentation\n\n### unsplashx.status\n\n#### `unsplashx.status`\n\nUnsplash API Status URL.\n\n\n\n### unsplashx.changelog\n\n#### `unsplashx.changelog`\n\nUnsplash API Changelog URL.\n\n\n\n### unsplashx.id\n\n#### `unsplashx.id(link, verbose=False)`\n\nGet the identifier given Unsplash share link URL.\n\n> **Get the ID of a photo**\n> ```\n> https://unsplash.com/photos/{id}\n> ```\n\n> **Get the username of a user**\n> ```\n> https://unsplash.com/@{id}\n> ```\n\n> **Get the ID of a collection**\n> ```\n> https://unsplash.com/collections/{id}/{name}\n> ```\n\n**Parameters:**\n\n* **link** (str): Unsplash share link URL of a photo, a user, or a collection. \n* **verbose** (bool, optional): Whether to enable verbose output. Defaults to `False`.\n\n**Returns:**\n\n(str): The identifier, that can be the ID of a photo, the username of a user, or the ID of a collection.\n\n\n\n### unsplashx.source\n\n#### `unsplashx.source(photo=None, user=None, liked=None, collection=None, featured=None, resolution=None, update=None, query=None, verbose=False)`\n\nGet Unsplash Source download link URL of a photo given the parameters.\n\n> **Get a random photo**\n> ```\n> https://source.unsplash.com/random\n> ```\n> Optionally, limit to a featured selection\n> ```\n> https://source.unsplash.com/featured\n> ```\n> Optionally, specify a size\n> ```\n> https://source.unsplash.com/{resolution}\n> ```\n> Optionally, limit to only updaing daily or weekly\n> ```\n> https://source.unsplash.com/{update}\n> ```\n> Optionally, limit to matching search terms\n> ```\n> https://source.unsplash.com/random?{query}\n> ```\n> Optionally, narrow the selection further\n> ```\n> https://source.unsplash.com/featured/{resolution}/{update}?{query}\n> ```\n\n> **Get a photo**\n> ```\n> https://source.unsplash.com/{id}\n> ```\n> Optionally, specify a size\n> ```\n> https://source.unsplash.com/{id}/{resolution}\n> ```\n\n> **Get a random photo from a user's photos**\n> ```\n> https://source.unsplash.com/user/{id}\n> ```\n> Optionally, narrow the selection further\n> ```\n> https://source.unsplash.com/user/{id}/featured/{resolution}/{update}\n> ```\n\n> **Get a random photo from a user's liked photos**\n> ```\n> https://source.unsplash.com/user/{id}/likes\n> ```\n> Optionally, specify a size\n> ```\n> https://source.unsplash.com/user/{id}/likes/{resolution}\n> ```\n\n> **Get a random photo from a collection's photos**\n> ```\n> https://source.unsplash.com/collection/{id}\n> ```\n> Optionally, narrow the selection further\n> ```\n> https://source.unsplash.com/collection/{id}/{resolution}/{update}\n> ```\n\n**Note:**\n\nUnsplash Source is being deprecated. Existing uses will continue to work, however for new projects use the full Unsplash API.\n\n**Parameters:**\n\n* **photo** (str, optional): Unsplash share link URL or the ID of a photo.\n* **user** (str, optional): Unsplash share link URL or the username of a user.\n* **liked** (bool, optional): Whether to limit to a user's liked photos. Defaults to `False`.\n* **collection** (str, optional): Unsplash share link URL or the ID of a collection.\n* **featured** (bool, optional): Whether to limit to a featured selection. Defaults to `False`.\n* **resolution** (str, optional): The size of a photo to be set. Formats to `{width}x{height}`. Defaults to `None`. \n* **update** (str, optional): Whether to limit to only updating daily or weekly. Defaults to `False`.\n* **query** (str, optional): Comma-separated search terms. Defaults to `None`.\n* **verbose** (bool, optional): Whether to enable verbose output. Defaults to `False`.\n\n**Returns:**\n\n(str): Unsplash Source download link URL of a photo.\n\n**Reference:**\n\n[1] https://changelog.unsplash.com/deprecations/2021/11/25/source-deprecation.html\n\n\n\n## Contributing\n\nThanks for your interest in contributing to **UnsplashX**! Please feel free to create a pull request.\n\n\n\n## Changelog\n\n**UnsplashX 0.1.0**\n\n* Made Unsplash Source's URL constructor functional\n\n\n\n\n\n[github_badge]: https://badgen.net/badge/icon/GitHub?icon=github&color=black&label\n[github_link]: https://github.com/imyizhang/unsplashx\n\n[pypi_badge]: https://badgen.net/pypi/v/unsplashx?icon=pypi&color=black&label\n[pypi_link]: https://www.pypi.org/project/unsplashx\n",
"bugtrack_url": null,
"license": "BSD-3-Clause",
"summary": "Unsplash eXplorer for Humans\u2122",
"version": "0.1.3",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "9ad8b6e76e631ed289aa40bb4a100690",
"sha256": "e3ffe91f43358c4526878ada0601643ddb31514fffce0a2df44edb21f1694906"
},
"downloads": -1,
"filename": "unsplashx-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9ad8b6e76e631ed289aa40bb4a100690",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<4.0",
"size": 5565,
"upload_time": "2022-12-05T13:38:02",
"upload_time_iso_8601": "2022-12-05T13:38:02.904699Z",
"url": "https://files.pythonhosted.org/packages/62/6b/3ff8a2f1be4bf2aa611b7dfb04fbf56fba6e920317dab516412d9451539e/unsplashx-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "1a1cacdb0ff8a2306c1baa5040744d91",
"sha256": "43da3b4d5acbdf6becbd78a2b922ef6bf3fd00582882fc5393397a3270346877"
},
"downloads": -1,
"filename": "unsplashx-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "1a1cacdb0ff8a2306c1baa5040744d91",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<4.0",
"size": 5303,
"upload_time": "2022-12-05T13:38:04",
"upload_time_iso_8601": "2022-12-05T13:38:04.558725Z",
"url": "https://files.pythonhosted.org/packages/8a/6c/8d869fe3e4fda4d66769cb1d5b57d689f321b53fa263af7483bb28ea16f3/unsplashx-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-05 13:38:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "unsplashx"
}