# Photoprism Python API Client
## Installation
```bash
pip install photoprism
```
## Usage
```python
import asyncio
from pathlib import Path
from photoprism import PhotoprismSession, PhotoprismClient
from photoprism.models.query import Size
async def main():
session = PhotoprismSession(
username="username",
password="password",
host="localhost",
protocol="http",
)
client = PhotoprismClient(session)
albums = await client.albums.filter(count=3, q="cats")
for album in albums:
image_path = await client.albums.download_cover_image(
album_uid=album.uid,
size=Size.Tile50,
file_dir=Path("data/album_covers"),
)
print(image_path)
if __name__ == '__main__':
asyncio.run(main())
```
Raw data
{
"_id": null,
"home_page": "https://github.com/mkornat/photoprism-python",
"name": "photoprism",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "photoprism",
"author": "Marcin Kornat",
"author_email": "marcin.kornat@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/99/46/f2dd56abcfaf77ca60a8944432d07985230e59ed1fd8c262900b4940dd94/photoprism-0.1.0.tar.gz",
"platform": null,
"description": "# Photoprism Python API Client\n\n## Installation\n\n```bash\npip install photoprism\n```\n\n## Usage\n\n```python\nimport asyncio\nfrom pathlib import Path\n\nfrom photoprism import PhotoprismSession, PhotoprismClient\nfrom photoprism.models.query import Size\n\n\nasync def main():\n session = PhotoprismSession(\n username=\"username\",\n password=\"password\",\n host=\"localhost\",\n protocol=\"http\",\n )\n client = PhotoprismClient(session)\n \n albums = await client.albums.filter(count=3, q=\"cats\")\n for album in albums:\n image_path = await client.albums.download_cover_image(\n album_uid=album.uid,\n size=Size.Tile50,\n file_dir=Path(\"data/album_covers\"),\n )\n print(image_path)\n\n \nif __name__ == '__main__':\n asyncio.run(main())\n\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Photoprism Python API Client ",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/mkornat/photoprism-python",
"Repository": "https://github.com/mkornat/photoprism-python"
},
"split_keywords": [
"photoprism"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9ae12676dd514fbeed70a9674676110e479addfd06850e39355dae7e86aa68bd",
"md5": "d36871799c3a3902c0a5d9643eecfce6",
"sha256": "e392194c3b2c9f64398a4ca60dbc403cdbfe31bd7fc8403067b5342dd3a4ba81"
},
"downloads": -1,
"filename": "photoprism-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d36871799c3a3902c0a5d9643eecfce6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 19864,
"upload_time": "2024-09-04T18:50:40",
"upload_time_iso_8601": "2024-09-04T18:50:40.813020Z",
"url": "https://files.pythonhosted.org/packages/9a/e1/2676dd514fbeed70a9674676110e479addfd06850e39355dae7e86aa68bd/photoprism-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9946f2dd56abcfaf77ca60a8944432d07985230e59ed1fd8c262900b4940dd94",
"md5": "80702372b303f0838f09ce4e736e7fa5",
"sha256": "fd5f21b523113ef4e7a2a6e3883fcde84adcdea316e1877fa1af889630fd6ac4"
},
"downloads": -1,
"filename": "photoprism-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "80702372b303f0838f09ce4e736e7fa5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 13510,
"upload_time": "2024-09-04T18:50:42",
"upload_time_iso_8601": "2024-09-04T18:50:42.416447Z",
"url": "https://files.pythonhosted.org/packages/99/46/f2dd56abcfaf77ca60a8944432d07985230e59ed1fd8c262900b4940dd94/photoprism-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-04 18:50:42",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mkornat",
"github_project": "photoprism-python",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "photoprism"
}