immich 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- immich/.openapi-generator/FILES +372 -0
- immich/.openapi-generator/VERSION +1 -0
- immich/.openapi-generator-ignore +48 -0
- immich/__init__.py +3 -0
- immich/client/__init__.py +1162 -0
- immich/client/api/__init__.py +39 -0
- immich/client/api/activities_api.py +1092 -0
- immich/client/api/albums_api.py +3228 -0
- immich/client/api/api_keys_api.py +1484 -0
- immich/client/api/assets_api.py +5834 -0
- immich/client/api/authentication_admin_api.py +254 -0
- immich/client/api/authentication_api.py +3881 -0
- immich/client/api/deprecated_api.py +2199 -0
- immich/client/api/download_api.py +603 -0
- immich/client/api/duplicates_api.py +743 -0
- immich/client/api/faces_api.py +1053 -0
- immich/client/api/jobs_api.py +783 -0
- immich/client/api/libraries_api.py +2004 -0
- immich/client/api/maintenance_admin_api.py +533 -0
- immich/client/api/map_api.py +640 -0
- immich/client/api/memories_api.py +2250 -0
- immich/client/api/notifications_admin_api.py +808 -0
- immich/client/api/notifications_api.py +1564 -0
- immich/client/api/partners_api.py +1278 -0
- immich/client/api/people_api.py +2905 -0
- immich/client/api/plugins_api.py +730 -0
- immich/client/api/queues_api.py +1292 -0
- immich/client/api/search_api.py +3198 -0
- immich/client/api/server_api.py +3466 -0
- immich/client/api/sessions_api.py +1472 -0
- immich/client/api/shared_links_api.py +2177 -0
- immich/client/api/stacks_api.py +1769 -0
- immich/client/api/sync_api.py +1512 -0
- immich/client/api/system_config_api.py +967 -0
- immich/client/api/system_metadata_api.py +964 -0
- immich/client/api/tags_api.py +2296 -0
- immich/client/api/timeline_api.py +1193 -0
- immich/client/api/trash_api.py +739 -0
- immich/client/api/users_admin_api.py +2607 -0
- immich/client/api/users_api.py +3577 -0
- immich/client/api/views_api.py +503 -0
- immich/client/api/workflows_api.py +1257 -0
- immich/client/api_client.py +756 -0
- immich/client/api_response.py +20 -0
- immich/client/configuration.py +638 -0
- immich/client/exceptions.py +222 -0
- immich/client/models/__init__.py +424 -0
- immich/client/models/activity_create_dto.py +94 -0
- immich/client/models/activity_response_dto.py +121 -0
- immich/client/models/activity_statistics_response_dto.py +85 -0
- immich/client/models/add_users_dto.py +101 -0
- immich/client/models/admin_onboarding_update_dto.py +82 -0
- immich/client/models/album_response_dto.py +199 -0
- immich/client/models/album_statistics_response_dto.py +90 -0
- immich/client/models/album_user_add_dto.py +87 -0
- immich/client/models/album_user_create_dto.py +87 -0
- immich/client/models/album_user_response_dto.py +95 -0
- immich/client/models/album_user_role.py +34 -0
- immich/client/models/albums_add_assets_dto.py +86 -0
- immich/client/models/albums_add_assets_response_dto.py +86 -0
- immich/client/models/albums_response.py +83 -0
- immich/client/models/albums_update.py +85 -0
- immich/client/models/api_key_create_dto.py +87 -0
- immich/client/models/api_key_create_response_dto.py +94 -0
- immich/client/models/api_key_response_dto.py +102 -0
- immich/client/models/api_key_update_dto.py +87 -0
- immich/client/models/asset_bulk_delete_dto.py +84 -0
- immich/client/models/asset_bulk_update_dto.py +143 -0
- immich/client/models/asset_bulk_upload_check_dto.py +98 -0
- immich/client/models/asset_bulk_upload_check_item.py +85 -0
- immich/client/models/asset_bulk_upload_check_response_dto.py +101 -0
- immich/client/models/asset_bulk_upload_check_result.py +126 -0
- immich/client/models/asset_copy_dto.py +113 -0
- immich/client/models/asset_delta_sync_dto.py +87 -0
- immich/client/models/asset_delta_sync_response_dto.py +102 -0
- immich/client/models/asset_face_create_dto.py +110 -0
- immich/client/models/asset_face_delete_dto.py +82 -0
- immich/client/models/asset_face_response_dto.py +125 -0
- immich/client/models/asset_face_update_dto.py +96 -0
- immich/client/models/asset_face_update_item.py +86 -0
- immich/client/models/asset_face_without_person_response_dto.py +111 -0
- immich/client/models/asset_full_sync_dto.py +95 -0
- immich/client/models/asset_ids_dto.py +83 -0
- immich/client/models/asset_ids_response_dto.py +109 -0
- immich/client/models/asset_job_name.py +36 -0
- immich/client/models/asset_jobs_dto.py +87 -0
- immich/client/models/asset_media_response_dto.py +84 -0
- immich/client/models/asset_media_size.py +35 -0
- immich/client/models/asset_media_status.py +35 -0
- immich/client/models/asset_metadata_key.py +33 -0
- immich/client/models/asset_metadata_response_dto.py +92 -0
- immich/client/models/asset_metadata_upsert_dto.py +101 -0
- immich/client/models/asset_metadata_upsert_item_dto.py +84 -0
- immich/client/models/asset_ocr_response_dto.py +145 -0
- immich/client/models/asset_order.py +34 -0
- immich/client/models/asset_response_dto.py +291 -0
- immich/client/models/asset_stack_response_dto.py +90 -0
- immich/client/models/asset_stats_response_dto.py +90 -0
- immich/client/models/asset_type_enum.py +36 -0
- immich/client/models/asset_visibility.py +36 -0
- immich/client/models/audio_codec.py +36 -0
- immich/client/models/auth_status_response_dto.py +100 -0
- immich/client/models/avatar_update.py +83 -0
- immich/client/models/bulk_id_error_reason.py +36 -0
- immich/client/models/bulk_id_response_dto.py +102 -0
- immich/client/models/bulk_ids_dto.py +83 -0
- immich/client/models/cast_response.py +88 -0
- immich/client/models/cast_update.py +82 -0
- immich/client/models/change_password_dto.py +101 -0
- immich/client/models/check_existing_assets_dto.py +91 -0
- immich/client/models/check_existing_assets_response_dto.py +82 -0
- immich/client/models/clip_config.py +85 -0
- immich/client/models/colorspace.py +34 -0
- immich/client/models/contributor_count_response_dto.py +85 -0
- immich/client/models/cq_mode.py +35 -0
- immich/client/models/create_album_dto.py +112 -0
- immich/client/models/create_library_dto.py +103 -0
- immich/client/models/create_profile_image_response_dto.py +95 -0
- immich/client/models/database_backup_config.py +94 -0
- immich/client/models/download_archive_info.py +85 -0
- immich/client/models/download_info_dto.py +96 -0
- immich/client/models/download_response.py +90 -0
- immich/client/models/download_response_dto.py +100 -0
- immich/client/models/download_update.py +93 -0
- immich/client/models/duplicate_detection_config.py +89 -0
- immich/client/models/duplicate_response_dto.py +98 -0
- immich/client/models/email_notifications_response.py +90 -0
- immich/client/models/email_notifications_update.py +90 -0
- immich/client/models/exif_response_dto.py +284 -0
- immich/client/models/face_dto.py +83 -0
- immich/client/models/facial_recognition_config.py +107 -0
- immich/client/models/folders_response.py +92 -0
- immich/client/models/folders_update.py +85 -0
- immich/client/models/image_format.py +34 -0
- immich/client/models/job_create_dto.py +83 -0
- immich/client/models/job_name.py +87 -0
- immich/client/models/job_settings_dto.py +83 -0
- immich/client/models/library_response_dto.py +118 -0
- immich/client/models/library_stats_response_dto.py +92 -0
- immich/client/models/license_key_dto.py +98 -0
- immich/client/models/license_response_dto.py +101 -0
- immich/client/models/log_level.py +38 -0
- immich/client/models/login_credential_dto.py +85 -0
- immich/client/models/login_response_dto.py +109 -0
- immich/client/models/logout_response_dto.py +85 -0
- immich/client/models/machine_learning_availability_checks_dto.py +90 -0
- immich/client/models/maintenance_action.py +34 -0
- immich/client/models/maintenance_auth_dto.py +82 -0
- immich/client/models/maintenance_login_dto.py +82 -0
- immich/client/models/manual_job_name.py +38 -0
- immich/client/models/map_marker_response_dto.py +111 -0
- immich/client/models/map_reverse_geocode_response_dto.py +105 -0
- immich/client/models/memories_response.py +92 -0
- immich/client/models/memories_update.py +86 -0
- immich/client/models/memory_create_dto.py +112 -0
- immich/client/models/memory_response_dto.py +142 -0
- immich/client/models/memory_search_order.py +35 -0
- immich/client/models/memory_statistics_response_dto.py +82 -0
- immich/client/models/memory_type.py +33 -0
- immich/client/models/memory_update_dto.py +91 -0
- immich/client/models/merge_person_dto.py +83 -0
- immich/client/models/metadata_search_dto.py +277 -0
- immich/client/models/notification_create_dto.py +120 -0
- immich/client/models/notification_delete_all_dto.py +83 -0
- immich/client/models/notification_dto.py +112 -0
- immich/client/models/notification_level.py +36 -0
- immich/client/models/notification_type.py +38 -0
- immich/client/models/notification_update_all_dto.py +90 -0
- immich/client/models/notification_update_dto.py +88 -0
- immich/client/models/o_auth_authorize_response_dto.py +82 -0
- immich/client/models/o_auth_callback_dto.py +90 -0
- immich/client/models/o_auth_config_dto.py +90 -0
- immich/client/models/o_auth_token_endpoint_auth_method.py +34 -0
- immich/client/models/ocr_config.py +109 -0
- immich/client/models/on_this_day_dto.py +86 -0
- immich/client/models/onboarding_dto.py +82 -0
- immich/client/models/onboarding_response_dto.py +82 -0
- immich/client/models/partner_create_dto.py +83 -0
- immich/client/models/partner_direction.py +34 -0
- immich/client/models/partner_response_dto.py +108 -0
- immich/client/models/partner_update_dto.py +82 -0
- immich/client/models/people_response.py +92 -0
- immich/client/models/people_response_dto.py +104 -0
- immich/client/models/people_update.py +85 -0
- immich/client/models/people_update_dto.py +96 -0
- immich/client/models/people_update_item.py +128 -0
- immich/client/models/permission.py +177 -0
- immich/client/models/person_create_dto.py +117 -0
- immich/client/models/person_response_dto.py +115 -0
- immich/client/models/person_statistics_response_dto.py +82 -0
- immich/client/models/person_update_dto.py +125 -0
- immich/client/models/person_with_faces_response_dto.py +133 -0
- immich/client/models/pin_code_change_dto.py +90 -0
- immich/client/models/pin_code_reset_dto.py +85 -0
- immich/client/models/pin_code_setup_dto.py +82 -0
- immich/client/models/places_response_dto.py +100 -0
- immich/client/models/plugin_action_response_dto.py +112 -0
- immich/client/models/plugin_context_type.py +35 -0
- immich/client/models/plugin_filter_response_dto.py +112 -0
- immich/client/models/plugin_response_dto.py +139 -0
- immich/client/models/plugin_trigger_response_dto.py +87 -0
- immich/client/models/plugin_trigger_type.py +34 -0
- immich/client/models/purchase_response.py +88 -0
- immich/client/models/purchase_update.py +92 -0
- immich/client/models/queue_command.py +37 -0
- immich/client/models/queue_command_dto.py +86 -0
- immich/client/models/queue_delete_dto.py +85 -0
- immich/client/models/queue_job_response_dto.py +93 -0
- immich/client/models/queue_job_status.py +38 -0
- immich/client/models/queue_name.py +49 -0
- immich/client/models/queue_response_dto.py +97 -0
- immich/client/models/queue_response_legacy_dto.py +100 -0
- immich/client/models/queue_statistics_dto.py +103 -0
- immich/client/models/queue_status_legacy_dto.py +85 -0
- immich/client/models/queue_update_dto.py +82 -0
- immich/client/models/queues_response_legacy_dto.py +242 -0
- immich/client/models/random_search_dto.py +234 -0
- immich/client/models/ratings_response.py +84 -0
- immich/client/models/ratings_update.py +82 -0
- immich/client/models/reaction_level.py +34 -0
- immich/client/models/reaction_type.py +34 -0
- immich/client/models/reverse_geocoding_state_response_dto.py +101 -0
- immich/client/models/search_album_response_dto.py +114 -0
- immich/client/models/search_asset_response_dto.py +127 -0
- immich/client/models/search_explore_item.py +94 -0
- immich/client/models/search_explore_response_dto.py +98 -0
- immich/client/models/search_facet_count_response_dto.py +85 -0
- immich/client/models/search_facet_response_dto.py +103 -0
- immich/client/models/search_response_dto.py +100 -0
- immich/client/models/search_statistics_response_dto.py +82 -0
- immich/client/models/search_suggestion_type.py +38 -0
- immich/client/models/server_about_response_dto.py +156 -0
- immich/client/models/server_apk_links_dto.py +97 -0
- immich/client/models/server_config_dto.py +118 -0
- immich/client/models/server_features_dto.py +130 -0
- immich/client/models/server_media_types_response_dto.py +90 -0
- immich/client/models/server_ping_response.py +87 -0
- immich/client/models/server_stats_response_dto.py +119 -0
- immich/client/models/server_storage_response_dto.py +108 -0
- immich/client/models/server_theme_dto.py +82 -0
- immich/client/models/server_version_history_response_dto.py +91 -0
- immich/client/models/server_version_response_dto.py +90 -0
- immich/client/models/session_create_dto.py +96 -0
- immich/client/models/session_create_response_dto.py +120 -0
- immich/client/models/session_response_dto.py +117 -0
- immich/client/models/session_unlock_dto.py +85 -0
- immich/client/models/session_update_dto.py +84 -0
- immich/client/models/set_maintenance_mode_dto.py +83 -0
- immich/client/models/shared_link_create_dto.py +142 -0
- immich/client/models/shared_link_edit_dto.py +134 -0
- immich/client/models/shared_link_response_dto.py +173 -0
- immich/client/models/shared_link_type.py +34 -0
- immich/client/models/shared_links_response.py +92 -0
- immich/client/models/shared_links_update.py +85 -0
- immich/client/models/sign_up_dto.py +90 -0
- immich/client/models/smart_search_dto.py +245 -0
- immich/client/models/source_type.py +35 -0
- immich/client/models/stack_create_dto.py +86 -0
- immich/client/models/stack_response_dto.py +100 -0
- immich/client/models/stack_update_dto.py +83 -0
- immich/client/models/statistics_search_dto.py +217 -0
- immich/client/models/sync_ack_delete_dto.py +83 -0
- immich/client/models/sync_ack_dto.py +84 -0
- immich/client/models/sync_ack_set_dto.py +83 -0
- immich/client/models/sync_album_delete_v1.py +82 -0
- immich/client/models/sync_album_to_asset_delete_v1.py +85 -0
- immich/client/models/sync_album_to_asset_v1.py +85 -0
- immich/client/models/sync_album_user_delete_v1.py +85 -0
- immich/client/models/sync_album_user_v1.py +91 -0
- immich/client/models/sync_album_v1.py +122 -0
- immich/client/models/sync_asset_delete_v1.py +82 -0
- immich/client/models/sync_asset_exif_v1.py +296 -0
- immich/client/models/sync_asset_face_delete_v1.py +82 -0
- immich/client/models/sync_asset_face_v1.py +120 -0
- immich/client/models/sync_asset_metadata_delete_v1.py +86 -0
- immich/client/models/sync_asset_metadata_v1.py +91 -0
- immich/client/models/sync_asset_v1.py +187 -0
- immich/client/models/sync_auth_user_v1.py +154 -0
- immich/client/models/sync_entity_type.py +79 -0
- immich/client/models/sync_memory_asset_delete_v1.py +85 -0
- immich/client/models/sync_memory_asset_v1.py +85 -0
- immich/client/models/sync_memory_delete_v1.py +82 -0
- immich/client/models/sync_memory_v1.py +143 -0
- immich/client/models/sync_partner_delete_v1.py +88 -0
- immich/client/models/sync_partner_v1.py +90 -0
- immich/client/models/sync_person_delete_v1.py +82 -0
- immich/client/models/sync_person_v1.py +131 -0
- immich/client/models/sync_request_type.py +52 -0
- immich/client/models/sync_stack_delete_v1.py +82 -0
- immich/client/models/sync_stack_v1.py +101 -0
- immich/client/models/sync_stream_dto.py +86 -0
- immich/client/models/sync_user_delete_v1.py +82 -0
- immich/client/models/sync_user_metadata_delete_v1.py +84 -0
- immich/client/models/sync_user_metadata_v1.py +91 -0
- immich/client/models/sync_user_v1.py +118 -0
- immich/client/models/system_config_backups_dto.py +92 -0
- immich/client/models/system_config_dto.py +302 -0
- immich/client/models/system_config_f_fmpeg_dto.py +156 -0
- immich/client/models/system_config_faces_dto.py +82 -0
- immich/client/models/system_config_generated_fullsize_image_dto.py +92 -0
- immich/client/models/system_config_generated_image_dto.py +92 -0
- immich/client/models/system_config_image_dto.py +124 -0
- immich/client/models/system_config_job_dto.py +194 -0
- immich/client/models/system_config_library_dto.py +104 -0
- immich/client/models/system_config_library_scan_dto.py +85 -0
- immich/client/models/system_config_library_watch_dto.py +82 -0
- immich/client/models/system_config_logging_dto.py +86 -0
- immich/client/models/system_config_machine_learning_dto.py +147 -0
- immich/client/models/system_config_map_dto.py +90 -0
- immich/client/models/system_config_metadata_dto.py +92 -0
- immich/client/models/system_config_new_version_check_dto.py +82 -0
- immich/client/models/system_config_nightly_tasks_dto.py +103 -0
- immich/client/models/system_config_notifications_dto.py +92 -0
- immich/client/models/system_config_o_auth_dto.py +155 -0
- immich/client/models/system_config_password_login_dto.py +82 -0
- immich/client/models/system_config_reverse_geocoding_dto.py +82 -0
- immich/client/models/system_config_server_dto.py +94 -0
- immich/client/models/system_config_smtp_dto.py +100 -0
- immich/client/models/system_config_smtp_transport_dto.py +107 -0
- immich/client/models/system_config_storage_template_dto.py +94 -0
- immich/client/models/system_config_template_emails_dto.py +94 -0
- immich/client/models/system_config_template_storage_option_dto.py +109 -0
- immich/client/models/system_config_templates_dto.py +94 -0
- immich/client/models/system_config_theme_dto.py +82 -0
- immich/client/models/system_config_trash_dto.py +86 -0
- immich/client/models/system_config_user_dto.py +83 -0
- immich/client/models/tag_bulk_assets_dto.py +86 -0
- immich/client/models/tag_bulk_assets_response_dto.py +82 -0
- immich/client/models/tag_create_dto.py +111 -0
- immich/client/models/tag_response_dto.py +107 -0
- immich/client/models/tag_update_dto.py +87 -0
- immich/client/models/tag_upsert_dto.py +82 -0
- immich/client/models/tags_response.py +92 -0
- immich/client/models/tags_update.py +85 -0
- immich/client/models/template_dto.py +82 -0
- immich/client/models/template_response_dto.py +83 -0
- immich/client/models/test_email_response_dto.py +82 -0
- immich/client/models/time_bucket_asset_response_dto.py +195 -0
- immich/client/models/time_buckets_response_dto.py +88 -0
- immich/client/models/tone_mapping.py +36 -0
- immich/client/models/transcode_hw_accel.py +37 -0
- immich/client/models/transcode_policy.py +37 -0
- immich/client/models/trash_response_dto.py +82 -0
- immich/client/models/update_album_dto.py +106 -0
- immich/client/models/update_album_user_dto.py +83 -0
- immich/client/models/update_asset_dto.py +135 -0
- immich/client/models/update_library_dto.py +95 -0
- immich/client/models/usage_by_user_dto.py +117 -0
- immich/client/models/user_admin_create_dto.py +136 -0
- immich/client/models/user_admin_delete_dto.py +82 -0
- immich/client/models/user_admin_response_dto.py +176 -0
- immich/client/models/user_admin_update_dto.py +141 -0
- immich/client/models/user_avatar_color.py +42 -0
- immich/client/models/user_license.py +91 -0
- immich/client/models/user_metadata_key.py +35 -0
- immich/client/models/user_preferences_response_dto.py +186 -0
- immich/client/models/user_preferences_update_dto.py +197 -0
- immich/client/models/user_response_dto.py +105 -0
- immich/client/models/user_status.py +35 -0
- immich/client/models/user_update_me_dto.py +98 -0
- immich/client/models/validate_access_token_response_dto.py +82 -0
- immich/client/models/validate_library_dto.py +93 -0
- immich/client/models/validate_library_import_path_response_dto.py +92 -0
- immich/client/models/validate_library_response_dto.py +103 -0
- immich/client/models/version_check_state_response_dto.py +98 -0
- immich/client/models/video_codec.py +36 -0
- immich/client/models/video_container.py +36 -0
- immich/client/models/workflow_action_item_dto.py +89 -0
- immich/client/models/workflow_action_response_dto.py +105 -0
- immich/client/models/workflow_create_dto.py +128 -0
- immich/client/models/workflow_filter_item_dto.py +89 -0
- immich/client/models/workflow_filter_response_dto.py +105 -0
- immich/client/models/workflow_response_dto.py +144 -0
- immich/client/models/workflow_update_dto.py +128 -0
- immich/client/py.typed +0 -0
- immich/client/rest.py +199 -0
- immich/client_wrapper/__init__.py +15 -0
- immich/client_wrapper/assets_api_wrapped.py +87 -0
- immich/client_wrapper/download_api_wrapped.py +111 -0
- immich/client_wrapper/users_api_wrapped.py +41 -0
- immich/py.typed +0 -0
- immich/sdk.py +365 -0
- immich/utils.py +100 -0
- immich-1.2.1.dist-info/METADATA +166 -0
- immich-1.2.1.dist-info/RECORD +387 -0
- immich-1.2.1.dist-info/WHEEL +4 -0
- immich-1.2.1.dist-info/licenses/LICENSE +9 -0
immich/sdk.py
ADDED
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from aiohttp import ClientSession # type: ignore[import-not-found]
|
|
6
|
+
|
|
7
|
+
from immich.client.api_client import ApiClient
|
|
8
|
+
from immich.client.configuration import Configuration
|
|
9
|
+
|
|
10
|
+
from immich.client.api.activities_api import ActivitiesApi
|
|
11
|
+
from immich.client.api.albums_api import AlbumsApi
|
|
12
|
+
from immich.client.api.api_keys_api import APIKeysApi
|
|
13
|
+
from immich.client_wrapper.assets_api_wrapped import AssetsApiWrapped
|
|
14
|
+
from immich.client.api.authentication_admin_api import AuthenticationAdminApi
|
|
15
|
+
from immich.client.api.authentication_api import AuthenticationApi
|
|
16
|
+
from immich.client.api.deprecated_api import DeprecatedApi
|
|
17
|
+
from immich.client_wrapper.download_api_wrapped import DownloadApiWrapped
|
|
18
|
+
from immich.client.api.duplicates_api import DuplicatesApi
|
|
19
|
+
from immich.client.api.faces_api import FacesApi
|
|
20
|
+
from immich.client.api.jobs_api import JobsApi
|
|
21
|
+
from immich.client.api.libraries_api import LibrariesApi
|
|
22
|
+
from immich.client.api.maintenance_admin_api import MaintenanceAdminApi
|
|
23
|
+
from immich.client.api.map_api import MapApi
|
|
24
|
+
from immich.client.api.memories_api import MemoriesApi
|
|
25
|
+
from immich.client.api.notifications_admin_api import NotificationsAdminApi
|
|
26
|
+
from immich.client.api.notifications_api import NotificationsApi
|
|
27
|
+
from immich.client.api.partners_api import PartnersApi
|
|
28
|
+
from immich.client.api.people_api import PeopleApi
|
|
29
|
+
from immich.client.api.plugins_api import PluginsApi
|
|
30
|
+
from immich.client.api.queues_api import QueuesApi
|
|
31
|
+
from immich.client.api.search_api import SearchApi
|
|
32
|
+
from immich.client.api.server_api import ServerApi
|
|
33
|
+
from immich.client.api.sessions_api import SessionsApi
|
|
34
|
+
from immich.client.api.shared_links_api import SharedLinksApi
|
|
35
|
+
from immich.client.api.stacks_api import StacksApi
|
|
36
|
+
from immich.client.api.sync_api import SyncApi
|
|
37
|
+
from immich.client.api.system_config_api import SystemConfigApi
|
|
38
|
+
from immich.client.api.system_metadata_api import SystemMetadataApi
|
|
39
|
+
from immich.client.api.tags_api import TagsApi
|
|
40
|
+
from immich.client.api.timeline_api import TimelineApi
|
|
41
|
+
from immich.client.api.trash_api import TrashApi
|
|
42
|
+
from immich.client.api.users_admin_api import UsersAdminApi
|
|
43
|
+
from immich.client_wrapper.users_api_wrapped import UsersApiWrapped
|
|
44
|
+
from immich.client.api.views_api import ViewsApi
|
|
45
|
+
from immich.client.api.workflows_api import WorkflowsApi
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _normalize_base_url(base_url: str) -> str:
|
|
49
|
+
return base_url.rstrip("/")
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_configuration(
|
|
53
|
+
*,
|
|
54
|
+
api_key: Optional[str],
|
|
55
|
+
bearer_token: Optional[str],
|
|
56
|
+
cookie: Optional[str],
|
|
57
|
+
base_url: str,
|
|
58
|
+
) -> Configuration:
|
|
59
|
+
config = Configuration(host=_normalize_base_url(base_url))
|
|
60
|
+
if api_key:
|
|
61
|
+
# Security scheme name is `api_key` (header: x-api-key)
|
|
62
|
+
config.api_key["api_key"] = api_key
|
|
63
|
+
if cookie:
|
|
64
|
+
# Security scheme name is `cookie` (cookie: immich_access_token)
|
|
65
|
+
config.api_key["cookie"] = cookie
|
|
66
|
+
if bearer_token:
|
|
67
|
+
# JWT access token (Authorization: Bearer <token>)
|
|
68
|
+
config.access_token = bearer_token
|
|
69
|
+
return config
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class AsyncClient:
|
|
73
|
+
"""
|
|
74
|
+
Async client for the Immich API.
|
|
75
|
+
"""
|
|
76
|
+
|
|
77
|
+
activities: ActivitiesApi
|
|
78
|
+
"""An activity is a like or a comment made by a user on an asset or album.
|
|
79
|
+
|
|
80
|
+
https://api.immich.app/endpoints/activities
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
albums: AlbumsApi
|
|
84
|
+
"""An album is a collection of assets that can be shared with other users or via shared links.
|
|
85
|
+
|
|
86
|
+
https://api.immich.app/endpoints/albums
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
api_keys: APIKeysApi
|
|
90
|
+
"""An api key can be used to programmatically access the Immich API.
|
|
91
|
+
|
|
92
|
+
https://api.immich.app/endpoints/api-keys
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
assets: AssetsApiWrapped
|
|
96
|
+
"""An asset is an image or video that has been uploaded to Immich.
|
|
97
|
+
|
|
98
|
+
https://api.immich.app/endpoints/assets
|
|
99
|
+
"""
|
|
100
|
+
|
|
101
|
+
authentication: AuthenticationApi
|
|
102
|
+
"""Endpoints related to user authentication, including OAuth.
|
|
103
|
+
|
|
104
|
+
https://api.immich.app/endpoints/authentication
|
|
105
|
+
"""
|
|
106
|
+
|
|
107
|
+
authentication_admin: AuthenticationAdminApi
|
|
108
|
+
"""Administrative endpoints related to authentication.
|
|
109
|
+
|
|
110
|
+
https://api.immich.app/endpoints/authentication-(admin)
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
deprecated: DeprecatedApi
|
|
114
|
+
"""Deprecated endpoints that are planned for removal in the next major release.
|
|
115
|
+
|
|
116
|
+
https://api.immich.app/endpoints/deprecated
|
|
117
|
+
"""
|
|
118
|
+
|
|
119
|
+
download: DownloadApiWrapped
|
|
120
|
+
"""Endpoints for downloading assets or collections of assets.
|
|
121
|
+
|
|
122
|
+
https://api.immich.app/endpoints/download
|
|
123
|
+
"""
|
|
124
|
+
|
|
125
|
+
duplicates: DuplicatesApi
|
|
126
|
+
"""Endpoints for managing and identifying duplicate assets.
|
|
127
|
+
|
|
128
|
+
https://api.immich.app/endpoints/duplicates
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
faces: FacesApi
|
|
132
|
+
"""A face is a detected human face within an asset, which can be associated with a person. Faces are normally detected via machine learning, but can also be created via manually.
|
|
133
|
+
|
|
134
|
+
https://api.immich.app/endpoints/faces
|
|
135
|
+
"""
|
|
136
|
+
|
|
137
|
+
jobs: JobsApi
|
|
138
|
+
"""Queues and background jobs are used for processing tasks asynchronously. Queues can be paused and resumed as needed.
|
|
139
|
+
|
|
140
|
+
https://api.immich.app/endpoints/jobs
|
|
141
|
+
"""
|
|
142
|
+
|
|
143
|
+
libraries: LibrariesApi
|
|
144
|
+
"""An external library is made up of input file paths or expressions that are scanned for asset files. Discovered files are automatically imported. Assets much be unique within a library, but can be duplicated across libraries. Each user has a default upload library, and can have one or more external libraries.
|
|
145
|
+
|
|
146
|
+
https://api.immich.app/endpoints/libraries
|
|
147
|
+
"""
|
|
148
|
+
|
|
149
|
+
maintenance_admin: MaintenanceAdminApi
|
|
150
|
+
"""Maintenance mode allows you to put Immich in a read-only state to perform various operations.
|
|
151
|
+
|
|
152
|
+
https://api.immich.app/endpoints/maintenance-(admin)
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
map: MapApi
|
|
156
|
+
"""Map endpoints include supplemental functionality related to geolocation, such as reverse geocoding and retrieving map markers for assets with geolocation data.
|
|
157
|
+
|
|
158
|
+
https://api.immich.app/endpoints/map
|
|
159
|
+
"""
|
|
160
|
+
|
|
161
|
+
memories: MemoriesApi
|
|
162
|
+
"""A memory is a specialized collection of assets with dedicated viewing implementations in the web and mobile clients. A memory includes fields related to visibility and are automatically generated per user via a background job.
|
|
163
|
+
|
|
164
|
+
https://api.immich.app/endpoints/memories
|
|
165
|
+
"""
|
|
166
|
+
|
|
167
|
+
notifications: NotificationsApi
|
|
168
|
+
"""A notification is a specialized message sent to users to inform them of important events. Currently, these notifications are only shown in the Immich web application.
|
|
169
|
+
|
|
170
|
+
https://api.immich.app/endpoints/notifications
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
notifications_admin: NotificationsAdminApi
|
|
174
|
+
"""Notification administrative endpoints.
|
|
175
|
+
|
|
176
|
+
https://api.immich.app/endpoints/notifications-(admin)
|
|
177
|
+
"""
|
|
178
|
+
|
|
179
|
+
partners: PartnersApi
|
|
180
|
+
"""A partner is a link with another user that allows sharing of assets between two users.
|
|
181
|
+
|
|
182
|
+
https://api.immich.app/endpoints/partners
|
|
183
|
+
"""
|
|
184
|
+
|
|
185
|
+
people: PeopleApi
|
|
186
|
+
"""A person is a collection of faces, which can be favorited and named. A person can also be merged into another person. People are automatically created via the face recognition job.
|
|
187
|
+
|
|
188
|
+
https://api.immich.app/endpoints/people
|
|
189
|
+
"""
|
|
190
|
+
|
|
191
|
+
plugins: PluginsApi
|
|
192
|
+
"""A plugin is an installed module that makes filters and actions available for the workflow feature.
|
|
193
|
+
|
|
194
|
+
https://api.immich.app/endpoints/plugins
|
|
195
|
+
"""
|
|
196
|
+
|
|
197
|
+
queues: QueuesApi
|
|
198
|
+
"""Queues and background jobs are used for processing tasks asynchronously. Queues can be paused and resumed as needed.
|
|
199
|
+
|
|
200
|
+
https://api.immich.app/endpoints/queues
|
|
201
|
+
"""
|
|
202
|
+
|
|
203
|
+
search: SearchApi
|
|
204
|
+
"""Endpoints related to searching assets via text, smart search, optical character recognition (OCR), and other filters like person, album, and other metadata. Search endpoints usually support pagination and sorting.
|
|
205
|
+
|
|
206
|
+
https://api.immich.app/endpoints/search
|
|
207
|
+
"""
|
|
208
|
+
|
|
209
|
+
server: ServerApi
|
|
210
|
+
"""Information about the current server deployment, including version and build information, available features, supported media types, and more.
|
|
211
|
+
|
|
212
|
+
https://api.immich.app/endpoints/server
|
|
213
|
+
"""
|
|
214
|
+
|
|
215
|
+
sessions: SessionsApi
|
|
216
|
+
"""A session represents an authenticated login session for a user. Sessions also appear in the web application as "Authorized devices".
|
|
217
|
+
|
|
218
|
+
https://api.immich.app/endpoints/sessions
|
|
219
|
+
"""
|
|
220
|
+
|
|
221
|
+
shared_links: SharedLinksApi
|
|
222
|
+
"""A shared link is a public url that provides access to a specific album, asset, or collection of assets. A shared link can be protected with a password, include a specific slug, allow or disallow downloads, and optionally include an expiration date.
|
|
223
|
+
|
|
224
|
+
https://api.immich.app/endpoints/shared-links
|
|
225
|
+
"""
|
|
226
|
+
|
|
227
|
+
stacks: StacksApi
|
|
228
|
+
"""A stack is a group of related assets. One asset is the "primary" asset, and the rest are "child" assets. On the main timeline, stack parents are included by default, while child assets are hidden.
|
|
229
|
+
|
|
230
|
+
https://api.immich.app/endpoints/stacks
|
|
231
|
+
"""
|
|
232
|
+
|
|
233
|
+
sync: SyncApi
|
|
234
|
+
"""A collection of endpoints for the new mobile synchronization implementation.
|
|
235
|
+
|
|
236
|
+
https://api.immich.app/endpoints/sync
|
|
237
|
+
"""
|
|
238
|
+
|
|
239
|
+
system_config: SystemConfigApi
|
|
240
|
+
"""Endpoints to view, modify, and validate the system configuration settings.
|
|
241
|
+
|
|
242
|
+
https://api.immich.app/endpoints/system-config
|
|
243
|
+
"""
|
|
244
|
+
|
|
245
|
+
system_metadata: SystemMetadataApi
|
|
246
|
+
"""Endpoints to view, modify, and validate the system metadata, which includes information about things like admin onboarding status.
|
|
247
|
+
|
|
248
|
+
https://api.immich.app/endpoints/system-metadata
|
|
249
|
+
"""
|
|
250
|
+
|
|
251
|
+
tags: TagsApi
|
|
252
|
+
"""A tag is a user-defined label that can be applied to assets for organizational purposes. Tags can also be hierarchical, allowing for parent-child relationships between tags.
|
|
253
|
+
|
|
254
|
+
https://api.immich.app/endpoints/tags
|
|
255
|
+
"""
|
|
256
|
+
|
|
257
|
+
timeline: TimelineApi
|
|
258
|
+
"""Specialized endpoints related to the timeline implementation used in the web application. External applications or tools should not use or rely on these endpoints, as they are subject to change without notice.
|
|
259
|
+
|
|
260
|
+
https://api.immich.app/endpoints/timeline
|
|
261
|
+
"""
|
|
262
|
+
|
|
263
|
+
trash: TrashApi
|
|
264
|
+
"""Endpoints for managing the trash can, which includes assets that have been discarded. Items in the trash are automatically deleted after a configured amount of time.
|
|
265
|
+
|
|
266
|
+
https://api.immich.app/endpoints/trash
|
|
267
|
+
"""
|
|
268
|
+
|
|
269
|
+
users_admin: UsersAdminApi
|
|
270
|
+
"""Administrative endpoints for managing users, including creating, updating, deleting, and restoring users. Also includes endpoints for resetting passwords and PIN codes.
|
|
271
|
+
|
|
272
|
+
https://api.immich.app/endpoints/users-(admin)
|
|
273
|
+
"""
|
|
274
|
+
|
|
275
|
+
users: UsersApiWrapped
|
|
276
|
+
"""Endpoints for viewing and updating the current users, including product key information, profile picture data, onboarding progress, and more.
|
|
277
|
+
|
|
278
|
+
https://api.immich.app/endpoints/users
|
|
279
|
+
"""
|
|
280
|
+
|
|
281
|
+
views: ViewsApi
|
|
282
|
+
"""Endpoints for specialized views, such as the folder view.
|
|
283
|
+
|
|
284
|
+
https://api.immich.app/endpoints/views
|
|
285
|
+
"""
|
|
286
|
+
|
|
287
|
+
workflows: WorkflowsApi
|
|
288
|
+
"""A workflow is a set of actions that run whenever a triggering event occurs. Workflows also can include filters to further limit execution.
|
|
289
|
+
|
|
290
|
+
https://api.immich.app/endpoints/workflows
|
|
291
|
+
"""
|
|
292
|
+
|
|
293
|
+
def __init__(
|
|
294
|
+
self,
|
|
295
|
+
*,
|
|
296
|
+
api_key: Optional[str] = None,
|
|
297
|
+
bearer_token: Optional[str] = None,
|
|
298
|
+
cookie: Optional[str] = None,
|
|
299
|
+
base_url: str,
|
|
300
|
+
http_client: Optional[ClientSession] = None,
|
|
301
|
+
) -> None:
|
|
302
|
+
self._owns_http_client = http_client is None
|
|
303
|
+
self._injected_http_client = http_client
|
|
304
|
+
self.config = _build_configuration(
|
|
305
|
+
api_key=api_key,
|
|
306
|
+
bearer_token=bearer_token,
|
|
307
|
+
cookie=cookie,
|
|
308
|
+
base_url=base_url,
|
|
309
|
+
)
|
|
310
|
+
self.base_client = ApiClient(configuration=self.config)
|
|
311
|
+
self.base_client.user_agent = "immich-python-client"
|
|
312
|
+
|
|
313
|
+
# Allow caller to inject a pre-configured aiohttp session.
|
|
314
|
+
if http_client is not None:
|
|
315
|
+
self.base_client.rest_client.pool_manager = http_client
|
|
316
|
+
|
|
317
|
+
# API groups (single upstream API, not microservices)
|
|
318
|
+
self.activities = ActivitiesApi(self.base_client)
|
|
319
|
+
self.albums = AlbumsApi(self.base_client)
|
|
320
|
+
self.api_keys = APIKeysApi(self.base_client)
|
|
321
|
+
self.assets = AssetsApiWrapped(self.base_client)
|
|
322
|
+
self.authentication = AuthenticationApi(self.base_client)
|
|
323
|
+
self.authentication_admin = AuthenticationAdminApi(self.base_client)
|
|
324
|
+
self.deprecated = DeprecatedApi(self.base_client)
|
|
325
|
+
self.download = DownloadApiWrapped(self.base_client)
|
|
326
|
+
self.duplicates = DuplicatesApi(self.base_client)
|
|
327
|
+
self.faces = FacesApi(self.base_client)
|
|
328
|
+
self.jobs = JobsApi(self.base_client)
|
|
329
|
+
self.libraries = LibrariesApi(self.base_client)
|
|
330
|
+
self.maintenance_admin = MaintenanceAdminApi(self.base_client)
|
|
331
|
+
self.map = MapApi(self.base_client)
|
|
332
|
+
self.memories = MemoriesApi(self.base_client)
|
|
333
|
+
self.notifications = NotificationsApi(self.base_client)
|
|
334
|
+
self.notifications_admin = NotificationsAdminApi(self.base_client)
|
|
335
|
+
self.partners = PartnersApi(self.base_client)
|
|
336
|
+
self.people = PeopleApi(self.base_client)
|
|
337
|
+
self.plugins = PluginsApi(self.base_client)
|
|
338
|
+
self.queues = QueuesApi(self.base_client)
|
|
339
|
+
self.search = SearchApi(self.base_client)
|
|
340
|
+
self.server = ServerApi(self.base_client)
|
|
341
|
+
self.sessions = SessionsApi(self.base_client)
|
|
342
|
+
self.shared_links = SharedLinksApi(self.base_client)
|
|
343
|
+
self.stacks = StacksApi(self.base_client)
|
|
344
|
+
self.sync = SyncApi(self.base_client)
|
|
345
|
+
self.system_config = SystemConfigApi(self.base_client)
|
|
346
|
+
self.system_metadata = SystemMetadataApi(self.base_client)
|
|
347
|
+
self.tags = TagsApi(self.base_client)
|
|
348
|
+
self.timeline = TimelineApi(self.base_client)
|
|
349
|
+
self.trash = TrashApi(self.base_client)
|
|
350
|
+
self.users = UsersApiWrapped(self.base_client)
|
|
351
|
+
self.users_admin = UsersAdminApi(self.base_client)
|
|
352
|
+
self.views = ViewsApi(self.base_client)
|
|
353
|
+
self.workflows = WorkflowsApi(self.base_client)
|
|
354
|
+
|
|
355
|
+
async def close(self) -> None:
|
|
356
|
+
# If the caller injected the aiohttp session, don't close it.
|
|
357
|
+
if not self._owns_http_client and self._injected_http_client is not None:
|
|
358
|
+
self.base_client.rest_client.pool_manager = None
|
|
359
|
+
await self.base_client.close()
|
|
360
|
+
|
|
361
|
+
async def __aenter__(self) -> "AsyncClient":
|
|
362
|
+
return self
|
|
363
|
+
|
|
364
|
+
async def __aexit__(self, exc_type, exc_val, exc_tb) -> None:
|
|
365
|
+
await self.close()
|
immich/utils.py
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from email.message import Message
|
|
4
|
+
from mimetypes import guess_extension
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def filename_from_headers(
|
|
10
|
+
headers: dict[str, str] | None, *, fallback_base: str
|
|
11
|
+
) -> Optional[str]:
|
|
12
|
+
"""
|
|
13
|
+
Derive a filename from response headers.
|
|
14
|
+
|
|
15
|
+
Order of precedence:
|
|
16
|
+
- Content-Disposition filename (if present)
|
|
17
|
+
- if it has no extension, append an extension derived from Content-Type (if available)
|
|
18
|
+
- Content-Type derived extension + `fallback_base`
|
|
19
|
+
|
|
20
|
+
:param headers: The response headers.
|
|
21
|
+
:param fallback_base: The filename without extension if we cannot derive the original filename from the Content-Disposition header.
|
|
22
|
+
|
|
23
|
+
:returns: The derived filename or None if we cannot derive the filename from the headers.
|
|
24
|
+
"""
|
|
25
|
+
if not headers:
|
|
26
|
+
return None
|
|
27
|
+
|
|
28
|
+
def h(name: str) -> Optional[str]:
|
|
29
|
+
return next((v for k, v in headers.items() if k.lower() == name.lower()), None)
|
|
30
|
+
|
|
31
|
+
cd_name: Optional[str] = None
|
|
32
|
+
if cd := h("content-disposition"):
|
|
33
|
+
msg = Message()
|
|
34
|
+
msg["content-disposition"] = cd
|
|
35
|
+
if filename := msg.get_filename():
|
|
36
|
+
cd_name = Path(filename).name
|
|
37
|
+
|
|
38
|
+
ext = (
|
|
39
|
+
guess_extension(ct.partition(";")[0].strip())
|
|
40
|
+
if (ct := h("content-type"))
|
|
41
|
+
else None
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Content-Disposition wins for the base name; Content-Type is the safety net for the extension.
|
|
45
|
+
if cd_name:
|
|
46
|
+
return cd_name if Path(cd_name).suffix or not ext else f"{cd_name}{ext}"
|
|
47
|
+
|
|
48
|
+
return f"{fallback_base}{ext}" if ext else None
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def resolve_output_filename(
|
|
52
|
+
headers: dict[str, str] | None,
|
|
53
|
+
*,
|
|
54
|
+
name: Optional[str] = None,
|
|
55
|
+
default_base: str,
|
|
56
|
+
default_ext: Optional[str] = None,
|
|
57
|
+
) -> str:
|
|
58
|
+
"""
|
|
59
|
+
Resolve an output filename by selecting a base name and an extension.
|
|
60
|
+
|
|
61
|
+
Base name precedence:
|
|
62
|
+
- user-supplied `name`
|
|
63
|
+
- Content-Disposition filename
|
|
64
|
+
- `default_base`
|
|
65
|
+
|
|
66
|
+
Extension precedence:
|
|
67
|
+
- `default_ext` (if provided; overrides any other extension)
|
|
68
|
+
- extension present on the chosen base name (e.g. from Content-Disposition)
|
|
69
|
+
- Content-Type derived extension
|
|
70
|
+
- none
|
|
71
|
+
|
|
72
|
+
:param headers: The response headers.
|
|
73
|
+
:param name: The user-supplied name.
|
|
74
|
+
:param default_base: The default base name, used when no user/header filename can be derived.
|
|
75
|
+
:param default_ext: The default extension (must start with `.`), used when you want to force a specific extension (e.g. `.zip`).
|
|
76
|
+
|
|
77
|
+
:returns: The resolved filename.
|
|
78
|
+
"""
|
|
79
|
+
if default_ext and not default_ext.startswith("."):
|
|
80
|
+
raise ValueError("default_ext must start with '.' (e.g. '.zip')")
|
|
81
|
+
|
|
82
|
+
base = default_base
|
|
83
|
+
ext = None
|
|
84
|
+
|
|
85
|
+
header_path = None
|
|
86
|
+
if _ := filename_from_headers(headers, fallback_base=default_base):
|
|
87
|
+
header_path = Path(_)
|
|
88
|
+
|
|
89
|
+
# Base name
|
|
90
|
+
if name:
|
|
91
|
+
base = Path(name).stem
|
|
92
|
+
elif header_path:
|
|
93
|
+
base = header_path.stem
|
|
94
|
+
|
|
95
|
+
# Extension
|
|
96
|
+
if default_ext:
|
|
97
|
+
ext = default_ext
|
|
98
|
+
elif header_path:
|
|
99
|
+
ext = header_path.suffix
|
|
100
|
+
return f"{base}{ext}" if ext else base
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: immich
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: Unofficial Python client for Immich
|
|
5
|
+
Keywords: immich,photos,backup,client,api
|
|
6
|
+
Author: Immich Python Client
|
|
7
|
+
Author-email: Immich Python Client <contact@timonrieger.de>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Classifier: Topic :: Multimedia
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Dist: aiohttp>=3.8.4,<4.0.0
|
|
22
|
+
Requires-Dist: aiohttp-retry>=2.8.3,<3.0.0
|
|
23
|
+
Requires-Dist: pydantic>=2.0.0,<3.0.0
|
|
24
|
+
Requires-Dist: python-dateutil>=2.8.2,<3.0.0
|
|
25
|
+
Requires-Dist: requests>=2.32.0,<3.0.0
|
|
26
|
+
Requires-Dist: tqdm>=4.67.0,<5.0.0
|
|
27
|
+
Requires-Dist: typing-extensions>=4.7.1,<5.0.0
|
|
28
|
+
Requires-Dist: urllib3>=1.25.3,<3.0.0
|
|
29
|
+
Requires-Dist: uv==0.9.21 ; extra == 'build'
|
|
30
|
+
Requires-Python: >=3.10
|
|
31
|
+
Project-URL: Changelog, https://github.com/timonrieger/immich-python-client/releases
|
|
32
|
+
Project-URL: Repository, https://github.com/timonrieger/immich-python-client
|
|
33
|
+
Provides-Extra: build
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# Immich API Client
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<a href="https://coderabbit.ai" target="_blank" rel="noopener noreferrer">
|
|
40
|
+
<img src="https://img.shields.io/coderabbit/prs/github/timonrieger/immich-python-client?utm_source=oss&utm_medium=github&utm_campaign=timonrieger%2Fimmich-python-client&labelColor=171717&color=FF570A&link=https%3A%2F%2Fcoderabbit.ai&label=CodeRabbit+Reviews" alt="CodeRabbit Pull Request Reviews">
|
|
41
|
+
</a>
|
|
42
|
+
<a href="https://github.com/timonrieger/immich-python-client/actions/workflows/test.yml">
|
|
43
|
+
<img src="https://github.com/timonrieger/immich-python-client/actions/workflows/test.yml/badge.svg" alt="Tests">
|
|
44
|
+
</a>
|
|
45
|
+
<a href="https://pypi.org/project/immich" target="_blank" rel="noopener noreferrer">
|
|
46
|
+
<img src="https://img.shields.io/pypi/v/immich?color=%2334D058&label=pypi%20package" alt="Package version">
|
|
47
|
+
</a>
|
|
48
|
+
<a href="https://pypi.org/project/immich" target="_blank" rel="noopener noreferrer">
|
|
49
|
+
<img src="https://img.shields.io/pypi/pyversions/immich.svg?color=%2334D058" alt="Supported Python versions">
|
|
50
|
+
</a>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
Unofficial Python client for the [Immich](https://immich.app) API.
|
|
54
|
+
|
|
55
|
+
> [!IMPORTANT]
|
|
56
|
+
> This repository is **auto-generated** from the Immich OpenAPI specification.
|
|
57
|
+
> **Do not open pull requests**. See [CONTRIBUTING](CONTRIBUTING.md) for more details.
|
|
58
|
+
|
|
59
|
+
## Status
|
|
60
|
+
|
|
61
|
+
- **Unofficial**: Not affiliated with or endorsed by Immich.
|
|
62
|
+
- **Auto-synced**: Kept in sync with the **latest Immich release** (regenerated as upstream changes land).
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
You need Python 3.10–3.14 installed to be able to use this library.
|
|
67
|
+
|
|
68
|
+
Install the latest stable version from PyPI:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install immich
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
If you want the latest version (which may be a pre-release):
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pip install --pre immich
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Structure
|
|
81
|
+
|
|
82
|
+
This SDK is **async-only**. The client exposes API groups as attributes, and endpoints as methods on those groups. Groups and endpoints are documented in the [Immich API documentation](https://api.immich.app/endpoints).
|
|
83
|
+
|
|
84
|
+
## Authentication
|
|
85
|
+
|
|
86
|
+
Immich supports API keys. Create one in your server and pass it via `api_key=...`. Cookie and Bearer tokens are also supported.
|
|
87
|
+
|
|
88
|
+
## Usage
|
|
89
|
+
|
|
90
|
+
With a context manager (recommended):
|
|
91
|
+
|
|
92
|
+
```python
|
|
93
|
+
from immich import AsyncClient
|
|
94
|
+
|
|
95
|
+
async with AsyncClient(api_key="your-immich-api-key", base_url="http://localhost:2283/api") as client:
|
|
96
|
+
await client.server.get_about_info()
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Without a context manager:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import asyncio
|
|
103
|
+
from immich import AsyncClient
|
|
104
|
+
|
|
105
|
+
async def main():
|
|
106
|
+
client = AsyncClient(api_key="your-immich-api-key", base_url="http://localhost:2283/api")
|
|
107
|
+
try:
|
|
108
|
+
await client.server.get_about_info()
|
|
109
|
+
finally:
|
|
110
|
+
await client.close()
|
|
111
|
+
|
|
112
|
+
asyncio.run(main())
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Response Types
|
|
116
|
+
|
|
117
|
+
There are three different available output formats you can choose from:
|
|
118
|
+
|
|
119
|
+
### Serialized Response
|
|
120
|
+
|
|
121
|
+
You can get fully serialized responses as Pydantic models. Using this, you get the full benefits of Pydantic's type checking.
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
res = await client.server.get_about_info()
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
The output would look like this:
|
|
128
|
+
|
|
129
|
+
```python
|
|
130
|
+
ServerAboutResponseDto(...)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Serialized Response with HTTP Info
|
|
134
|
+
|
|
135
|
+
```python
|
|
136
|
+
res = await client.server.get_about_info_with_http_info()
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
The output would look like this:
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
status_code=200 headers={'Content-Type': 'application/json'} data=ServerAboutResponseDto(...) raw_data=b'{"...": "..."}'
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### JSON Response
|
|
146
|
+
|
|
147
|
+
You can receive a classical JSON response by suffixing the function name with `_without_preload_content`:
|
|
148
|
+
|
|
149
|
+
```python
|
|
150
|
+
response = await client.server.get_about_info_without_preload_content()
|
|
151
|
+
await response.json()
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Session management
|
|
155
|
+
|
|
156
|
+
The client can manage a shared `aiohttp.ClientSession`, or you can pass your own via `http_client=...` (you are responsible for its lifecycle).
|
|
157
|
+
|
|
158
|
+
## Versioning
|
|
159
|
+
|
|
160
|
+
This package follows **[Semantic Versioning](https://semver.org)**.
|
|
161
|
+
|
|
162
|
+
- **Package version is not the server version**: `immich` package `X.Y.Z` is the client’s own version.
|
|
163
|
+
- **Upstream breaking changes ⇒ major bump**: Breaking Immich changes that require breaking client changes produce a new **major** version.
|
|
164
|
+
- **Supported Immich server version**: `IMMICH-VERSION` (repo root) tracks the Immich version this client was generated from.
|
|
165
|
+
- If you run an **older** Immich server version, you can install an **older** `immich` package release where `IMMICH-VERSION` matches your server.
|
|
166
|
+
- This client supports **Immich v2.4.1** and above.
|