{"id":17255373,"url":"https://github.com/krisnova/photoprism-client-go","last_synced_at":"2025-03-22T18:34:30.540Z","repository":{"id":39970788,"uuid":"334541913","full_name":"krisnova/photoprism-client-go","owner":"krisnova","description":"Go client for the Photoprism Application","archived":false,"fork":false,"pushed_at":"2022-12-18T04:08:31.000Z","size":24631,"stargazers_count":32,"open_issues_count":1,"forks_count":12,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-15T07:11:27.753Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krisnova.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-31T00:34:14.000Z","updated_at":"2024-05-11T14:36:39.000Z","dependencies_parsed_at":"2023-01-29T18:31:10.803Z","dependency_job_id":null,"html_url":"https://github.com/krisnova/photoprism-client-go","commit_stats":null,"previous_names":["kris-nova/photoprism-client-go"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisnova%2Fphotoprism-client-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisnova%2Fphotoprism-client-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisnova%2Fphotoprism-client-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krisnova%2Fphotoprism-client-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krisnova","download_url":"https://codeload.github.com/krisnova/photoprism-client-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221832421,"owners_count":16888243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T07:11:26.589Z","updated_at":"2024-10-28T13:34:16.521Z","avatar_url":"https://github.com/krisnova.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Photoprism Client Go\n\nGo client for the Photoprism Application.\n\n**Author**: [Kris Nóva](https://github.com/kris-nova) \u003ckris@nivenly.com\u003e\n\n---\n\n# Install\n\n```bash \n\ngo get github.com/drummonds/photoprism-client-go\n\n```\n\n# Supported Methods\n\n```go\n\nfunc New(connURL *url.URL, token, downloadToken string) *V1Client\nfunc (v1 *V1Client) AddPhotosToAlbum(albumUUID string, photoIDs []string) error\nfunc (v1 *V1Client) ApprovePhoto(uuid string) error\nfunc (v1 *V1Client) CancelIndex() error\nfunc (v1 *V1Client) CloneAlbum(album Album) (Album, error)\nfunc (v1 *V1Client) CreateAlbum(album Album) (Album, error)\nfunc (v1 *V1Client) DeleteAlbums(albumUUIDs []string) error\nfunc (v1 *V1Client) DELETE(payload interface{}, endpointFormat string, a ...interface{}) *V1Response\nfunc (v1 *V1Client) DeletePhotosFromAlbum(albumUUID string, photoIDs []string) error\nfunc (v1 *V1Client) DislikeAlbum(uuid string) error\nfunc (v1 *V1Client) DislikePhoto(uuid string) error\nfunc (v1 *V1Client) Endpoint(str string) string\nfunc (v1 *V1Client) GetAlbumDownload(uuid string) ([]byte, error)\nfunc (v1 *V1Client) GetAlbums(options *AlbumOptions) ([]Album, error)\nfunc (v1 *V1Client) GetAlbum(uuid string) (Album, error)\nfunc (v1 *V1Client) GET(endpointFormat string, a ...interface{}) *V1Response\nfunc (v1 *V1Client) GetPhotoDownload(uuid string) ([]byte, error)\nfunc (v1 *V1Client) GetPhotos(options *PhotoOptions) ([]Photo, error)\nfunc (v1 *V1Client) GetPhoto(uuid string) (Photo, error)\nfunc (v1 *V1Client) GetPhotoYaml(uuid string) ([]byte, error)\nfunc (v1 *V1Client) Import() error\nfunc (v1 *V1Client) Index() error\nfunc (v1 *V1Client) LikeAlbum(uuid string) error\nfunc (v1 *V1Client) LikePhoto(uuid string) error\nfunc (v1 *V1Client) PhotoPrimary(uuid, fileuuid string) error\nfunc (v1 *V1Client) POST(payload interface{}, endpointFormat string, a ...interface{}) *V1Response\nfunc (v1 *V1Client) PUT(payload interface{}, endpointFormat string, a ...interface{}) *V1Response\nfunc (v1 *V1Client) SetToken(token string)\nfunc (v1 *V1Client) UpdateAlbum(album Album) (Album, error)\nfunc (v1 *V1Client) UpdatePhoto(photo Photo) (Photo, error)\n```\n\n# Example Usage \n\n```go \npackage main\n\nimport (\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"path\"\n\n\tphotoprism \"github.com/drummonds/photoprism-client-go\"\n\t\"github.com/kris-nova/logger\"\n)\n\nfunc main()\n\tlogger.Level = 4\n\n\tuuid := \"pqnzigq351j2fqgn\" // This is a known ID\n\tclient := photoprism.New(\"http://localhost:8080\")\n\terr := client.Auth(photoprism.NewClientAuthLogin(\"admin\", \"missy\"))\n\tif err != nil\n\t\tlogger.Critical(\"Error logging into API: %v\", err)\n\t\tos.Exit(1)\n\t}\n\n\t// -----------------\n\t// GetPhoto()\n\t//\n\tphoto, err := client.V1().GetPhoto(uuid)\n\tif err != nil\n\t\tlogger.Critical(\"Error fetching photo: %v\", err)\n\t    os.Exit(1)\n\t}\n\n\t// -----------------\n\t// UpdatePhoto()\n\t//\n\tphoto.PhotoTitle = \"A really great photo!\"\n\tphoto, err = client.V1().UpdatePhoto(photo)\n\tif err != nil\n\t\tlogger.Critical(\"Error updating photo: %v\", err)\n\t    os.Exit(1)\n\t}\n\n\t// -----------------\n\t// GetPhotoDownload()\n\t//\n\tfile, err := client.V1().GetPhotoDownload(photo.UUID)\n\tif err != nil\n\t\tlogger.Critical(\"Error getting photo download: %v\", err)\n\t    os.Exit(1)\n\t}\n\n\tfor _, f := range photo.Files\n\t\tfileName := fmt.Sprintf(\"/tmp/%s\", path.Base(f.FileName))\n\t\tlogger.Always(fileName)\n\t\tioutil.WriteFile(fileName, file, 0666)\n\t}\n    os.Exit(0)\n}\n\n```\n\n\n# Pipeline\n\n - [ ] Upload photo methods/tests\n - [ ] Code generation \n - [ ] Finish the remaining methods\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisnova%2Fphotoprism-client-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrisnova%2Fphotoprism-client-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrisnova%2Fphotoprism-client-go/lists"}