Skip to content

matthiasch/photoprismpy

Repository files navigation

photoprismpy: a photoprism client

API request bodies and responses are usually JSON-encoded, except for binary data and some of the OAuth2 endpoints. Note that the Content-Type header must be set to application/json for this, as the request may otherwise fail with error 400. When clients have a valid access token, e.g. obtained through the POST /api/v1/session or POST /api/v1/oauth/token endpoint, they can use a standard Bearer Authorization header to authenticate their requests. Submitting the access token with a custom X-Auth-Token header is supported as well.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v1
  • Package version: 1.0.0
  • Generator version: 7.9.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements.

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import photoprism_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import photoprism_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import photoprism_client
from photoprism_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://demo.photoprism.app
# See configuration.py for a list of all supported configuration parameters.
configuration = photoprism_client.Configuration(
    host = "http://demo.photoprism.app"
)



# Enter a context with an instance of the API client
with photoprism_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = photoprism_client.AlbumsApi(api_client)
    uid = 'uid_example' # str | Album UID
    photos = photoprism_client.FormSelection() # FormSelection | Photo Selection

    try:
        # adds photos to an album
        api_response = api_instance.add_photos_to_album(uid, photos)
        print("The response of AlbumsApi->add_photos_to_album:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AlbumsApi->add_photos_to_album: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to http://demo.photoprism.app

Class Method HTTP request Description
AlbumsApi add_photos_to_album POST /api/v1/albums/{uid}/photos adds photos to an album
AlbumsApi album_cover GET /api/v1/albums/{uid}/t/{token}/{size} returns an album cover image
AlbumsApi batch_albums_delete POST /api/v1/batch/albums/delete permanently removes multiple albums
AlbumsApi clone_albums POST /api/v1/albums/{uid}/clone creates a new album containing pictures from other albums
AlbumsApi create_album POST /api/v1/albums creates a new album
AlbumsApi create_album_link POST /api/v1/albums/{uid}/links adds a new album share link and return it as JSON
AlbumsApi delete_album DELETE /api/v1/albums/{uid} deletes an existing album
AlbumsApi delete_album_link DELETE /api/v1/albums/{uid}/links/{linkuid} deletes an album share link
AlbumsApi dislike_album DELETE /api/v1/albums/{uid}/like removes the favorite flag from an album
AlbumsApi download_album GET /api/v1/albums/{uid}/dl streams the album contents as zip archiv
AlbumsApi get_album GET /api/v1/albums/{uid} returns album details as JSON
AlbumsApi get_album_links GET /api/v1/albums/{uid}/links returns all share links for the given UID as JSON
AlbumsApi get_moments_time GET /api/v1/moments/time returns monthly albums as JSON
AlbumsApi like_album POST /api/v1/albums/{uid}/like sets the favorite flag for an album
AlbumsApi remove_photos_from_album DELETE /api/v1/albums/{uid}/photos removes photos from an album
AlbumsApi search_albums GET /api/v1/albums finds albums and returns them as JSON
AlbumsApi update_album PUT /api/v1/albums/{uid} updates album metadata like title and description
AlbumsApi update_album_link PUT /api/v1/albums/{uid}/links/{linkuid} updates an album share link and return it as JSON
AuthenticationApi api_v1_oauth_revoke_post POST /api/v1/oauth/revoke
AuthenticationApi api_v1_oauth_token_post POST /api/v1/oauth/token
AuthenticationApi api_v1_session_post POST /api/v1/session
AuthenticationApi api_v1_sessions_post POST /api/v1/sessions
AuthenticationApi api_v1_users_uid_password_put PUT /api/v1/users/{uid}/password
AuthenticationApi api_v1_users_uid_sessions_get GET /api/v1/users/{uid}/sessions
ConfigApi get_client_config GET /api/v1/config returns the client configuration values as JSON
ConfigApi get_config_options GET /api/v1/config/options returns backend config options
ConfigApi save_config_options POST /api/v1/config/options updates backend config options
DownloadApi zip_create POST /api/v1/zip creates a zip file archive for download
DownloadApi zip_download GET /api/v1/zip/{filename} downloads a zip file archive
ErrorsApi delete_errors DELETE /api/v1/errors removes all entries from the error logs
ErrorsApi get_errors GET /api/v1/errors searches the error logs and returns the results as JSON
FacesApi get_face GET /api/v1/faces/{id} returns a face as JSON
FacesApi search_faces GET /api/v1/faces finds and returns faces as JSON
FacesApi update_face PUT /api/v1/faces/{id} updates face properties
FilesApi api_v1_markers_post POST /api/v1/markers
FilesApi change_file_orientation PUT /api/v1/photos/{uid}/files/{fileuid}/orientation changes the orientation of a file
FilesApi delete_file DELETE /api/v1/photos/{uid}/files/{fileuid} removes a file from storage
FilesApi get_download GET /api/v1/dl/{hash} returns the raw file data
FilesApi get_file GET /api/v1/files/{hash} returns file details as JSON
FilesApi get_photo_download GET /api/v1/photos/{uid}/dl returns the primary file matching that belongs to the photo
FilesApi get_thumb GET /api/v1/t/{thumb}/{token}/{size} returns a thumbnail image with the requested size
FilesApi get_video GET /api/v1/videos/{hash}/{token}/{format} returns a video, optionally limited to a byte range for streaming
FilesApi users_uid_upload_token_post POST /users/{uid}/upload/{token}
FilesApi zip_create POST /api/v1/zip creates a zip file archive for download
FilesApi zip_download GET /api/v1/zip/{filename} downloads a zip file archive
FoldersApi folder_cover GET /api/v1/folders/t/{uid}/{token}/{size} returns a folder cover image
ImagesApi album_cover GET /api/v1/albums/{uid}/t/{token}/{size} returns an album cover image
ImagesApi download_album GET /api/v1/albums/{uid}/dl streams the album contents as zip archiv
ImagesApi folder_cover GET /api/v1/folders/t/{uid}/{token}/{size} returns a folder cover image
ImagesApi get_download GET /api/v1/dl/{hash} returns the raw file data
ImagesApi get_photo_download GET /api/v1/photos/{uid}/dl returns the primary file matching that belongs to the photo
ImagesApi get_thumb GET /api/v1/t/{thumb}/{token}/{size} returns a thumbnail image with the requested size
ImagesApi label_cover GET /api/v1/labels/{uid}/t/{token}/{size} returns a label cover image
LabelsApi add_photo_label POST /api/v1/photos/{uid}/label adds a label to a photo
LabelsApi batch_labels_delete POST /api/v1/batch/labels/delete deletes multiple labels
LabelsApi dislike_label DELETE /api/v1/labels/{uid}/like removes favorite flag from a label
LabelsApi label_cover GET /api/v1/labels/{uid}/t/{token}/{size} returns a label cover image
LabelsApi like_label POST /api/v1/labels/{uid}/like sets favorite flag for a label
LabelsApi remove_photo_label DELETE /api/v1/photos/{uid}/label/{id} removes a label from a photo
LabelsApi search_labels GET /api/v1/labels finds and returns labels as JSON
LabelsApi update_label PUT /api/v1/labels/{uid} updates label name
LabelsApi update_photo_label PUT /api/v1/photos/{uid}/label/{id} changes a photo label
LibraryApi api_v1_import_path_post POST /api/v1/import/{path}
LibraryApi api_v1_index_post POST /api/v1/index
LinksApi api_v1_entity_uid_links_post POST /api/v1/{entity}/{uid}/links
LinksApi create_album_link POST /api/v1/albums/{uid}/links adds a new album share link and return it as JSON
LinksApi delete_album_link DELETE /api/v1/albums/{uid}/links/{linkuid} deletes an album share link
LinksApi get_album_links GET /api/v1/albums/{uid}/links returns all share links for the given UID as JSON
LinksApi update_album_link PUT /api/v1/albums/{uid}/links/{linkuid} updates an album share link and return it as JSON
MarkersApi clear_marker_subject DELETE /api/v1/markers/{uid}/subject removes an existing marker subject association
MarkersApi update_marker PUT /api/v1/markers/{uid} updates an existing file area marker to assign faces or other subjects
PhotosApi add_photo_label POST /api/v1/photos/{uid}/label adds a label to a photo
PhotosApi approve_photo POST /api/v1/photos/{uid}/approve marks a photo in review as approved
PhotosApi batch_photos_approve POST /api/v1/batch/photos/approve approves multiple photos that are currently under review
PhotosApi batch_photos_archive POST /api/v1/batch/photos/archive moves multiple photos to the archive
PhotosApi batch_photos_delete POST /api/v1/batch/photos/delete permanently removes multiple or all photos from the archive
PhotosApi batch_photos_private POST /api/v1/batch/photos/private toggles private state of multiple photos
PhotosApi batch_photos_restore POST /api/v1/batch/photos/restore restores multiple photos from the archive
PhotosApi dislike_photo DELETE /api/v1/photos/{uid}/like removes the favorite flags from a photo
PhotosApi get_photo GET /api/v1/photos/{uid} returns picture details as JSON
PhotosApi get_photo_yaml GET /api/v1/photos/{uid}/yaml returns picture details as YAML
PhotosApi like_photo POST /api/v1/photos/{uid}/like flags a photo as favorite
PhotosApi photo_primary POST /api/v1/photos/{uid}/files/{fileuid}/primary sets the primary file for a photo
PhotosApi photo_unstack POST /api/v1/photos/{uid}/files/{fileuid}/unstack removes a file from an existing photo stack
PhotosApi remove_photo_label DELETE /api/v1/photos/{uid}/label/{id} removes a label from a photo
PhotosApi search_geo GET /api/v1/geo finds photos and returns results as JSON, so they can be displayed on a map or in a viewer
PhotosApi search_photos GET /api/v1/photos finds pictures and returns them as JSON
PhotosApi update_photo PUT /api/v1/photos/{uid} updates picture details and returns them as JSON
PhotosApi update_photo_label PUT /api/v1/photos/{uid}/label/{id} changes a photo label
ServerApi get_status GET /api/v1/status reports if the server is operational
ServicesApi add_service POST /api/v1/services creates a new remote account configuration
ServicesApi delete_service DELETE /api/v1/services/{id} removes a remote account configuration
ServicesApi get_service GET /api/v1/services/{id} returns an account as JSON
ServicesApi get_service_folders GET /api/v1/services/{id}/folders returns folders that belong to an account as JSON
ServicesApi search_services GET /api/v1/services finds account settings and returns them as JSON
ServicesApi update_service PUT /api/v1/services/{id} updates a remote account configuration
SettingsApi get_config_options GET /api/v1/config/options returns backend config options
SettingsApi get_settings GET /api/v1/settings returns the user app settings as JSON
SettingsApi save_config_options POST /api/v1/config/options updates backend config options
SettingsApi save_settings POST /api/v1/settings saves the user app settings
StacksApi photo_primary POST /api/v1/photos/{uid}/files/{fileuid}/primary sets the primary file for a photo
StacksApi photo_unstack POST /api/v1/photos/{uid}/files/{fileuid}/unstack removes a file from an existing photo stack
SubjectsApi clear_marker_subject DELETE /api/v1/markers/{uid}/subject removes an existing marker subject association
SubjectsApi dislike_subject DELETE /api/v1/subjects/{uid}/like removes the favorite flag from a subject
SubjectsApi get_subject GET /api/v1/subjects/{uid} returns a subject as JSON
SubjectsApi like_subject POST /api/v1/subjects/{uid}/like flags a subject as favorite
SubjectsApi search_subjects GET /api/v1/subjects finds and returns subjects as JSON
SubjectsApi update_marker PUT /api/v1/markers/{uid} updates an existing file area marker to assign faces or other subjects
SubjectsApi update_subject PUT /api/v1/subjects/{uid} updates subject properties
UsersApi api_v1_users_uid_avatar_post POST /api/v1/users/{uid}/avatar
UsersApi api_v1_users_uid_passcode_activate_post POST /api/v1/users/{uid}/passcode/activate
UsersApi api_v1_users_uid_passcode_confirm_post POST /api/v1/users/{uid}/passcode/confirm
UsersApi api_v1_users_uid_passcode_deactivate_post POST /api/v1/users/{uid}/passcode/deactivate
UsersApi api_v1_users_uid_passcode_post POST /api/v1/users/{uid}/passcode
UsersApi api_v1_users_uid_password_put PUT /api/v1/users/{uid}/password
UsersApi api_v1_users_uid_put PUT /api/v1/users/{uid}
UsersApi api_v1_users_uid_sessions_get GET /api/v1/users/{uid}/sessions
UsersApi users_uid_upload_token_post POST /users/{uid}/upload/{token}
VideosApi get_video GET /api/v1/videos/{hash}/{token}/{format} returns a video, optionally limited to a byte range for streaming

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Author

About

python api client for photoprism

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages