Skip to main content

cloudinary-people

A typed Python SDK for the Cloudinary People Search API.

Prerequisite: People Search must be enabled for your Cloudinary product environment before these endpoints can be used.


3D visualization of AI facial recognition technology showing a translucent data-fiber bust being analyzed by digital sensors, set against a dark blue high-tech cloud background.

Installation

pip install cloudinary-people

Or directly from source:

git clone https://github.com/akshayranganath/cld-people-search.git
cd cld-people-search
pip install -e ".[dev]"

Quick Start

Option 1 — credentials from environment variable (recommended)

export CLOUDINARY_URL=cloudinary://api_key:api_secret@cloud_name
from cloudinary_people import CloudinaryPeopleClient

client = CloudinaryPeopleClient()   # reads CLOUDINARY_URL automatically

response = client.list_people(max_results=10)
for person in response.people:
    print(person.id, person.name, person.status)

Option 2 — explicit credentials

client = CloudinaryPeopleClient(
    cloud_name="my-cloud",
    api_key="123456789012345",
    api_secret="abcdefghijklmnopqrstuvwxyz",
)

Explicit values always take precedence over CLOUDINARY_URL. You can also mix them — any credential not passed explicitly is read from the environment variable.


API Reference

CloudinaryPeopleClient(cloud_name=None, api_key=None, api_secret=None, ...)

Creates a new client instance.

Credentials can be supplied explicitly or omitted; in that case they are read from the CLOUDINARY_URL environment variable (cloudinary://api_key:api_secret@cloud_name). Explicit values always win.

Parameter Type Required Description
cloud_name str No* Your Cloudinary cloud name
api_key str No* API key (used as Basic Auth username)
api_secret str No* API secret (used as Basic Auth password)
timeout float No Request timeout in seconds (default 30.0)

* Required unless CLOUDINARY_URL is set in the environment.


list_people(...) → ListPeopleResponse

Returns a paginated list of all recognized people in the product environment.

from cloudinary_people import NameStatus, PersonStatus, SortBy, SortDirection

response = client.list_people(
    max_results=20,          # 1–100, default 50
    next_cursor="...",       # for pagination
    name_status=NameStatus.NAMED,
    name_prefix="Jane",
    status=PersonStatus.ACTIVE,
    sort_by=SortBy.CREATED_AT,
    direction=SortDirection.DESC,
)

for person in response.people:
    print(person.id, person.name)

# Fetch next page
if response.next_cursor:
    next_page = client.list_people(next_cursor=response.next_cursor)

Parameters

Parameter Type Description
max_results int Max people to return (1–100, default 50)
next_cursor str Pagination cursor from the previous response
name_status NameStatus all (default) | named | unnamed
name_prefix str Return only people whose name starts with this prefix
status PersonStatus active | hidden
sort_by SortBy name (default) | created_at | updated_at
direction SortDirection asc | desc

get_person(person_id) → PersonDetails

Returns full details of a single recognized person.

person = client.get_person("f10f893da5a1586dca6764b22514aa0d25e6b867baffc4fb43a2318a25d8e5b2")
print(person.name, person.status, person.thumbnail.url)

update_person(person_id, name=None, status=None, thumbnail_asset_id=None) → UpdatePersonResponse

Updates a person's name, status, or thumbnail. At least one field must be provided.

from cloudinary_people import PersonStatus

result = client.update_person(
    person_id="f10f893da5a1586dca6764b22514aa0d25e6b867baffc4fb43a2318a25d8e5b2",
    name="Jane Doe",
    status=PersonStatus.ACTIVE,
)
print(result.id, result.name, result.status)

Models

Model Fields
PersonDetails id, name, status, thumbnail, created_at, updated_at
Thumbnail asset_id, bounding_box, url, resource_type, type, public_id, version
ListPeopleResponse people: list[PersonDetails], next_cursor: str | None
UpdatePersonResponse person_id, name, status

Enums

Enum Values
PersonStatus active, hidden
NameStatus all, named, unnamed
SortBy name, created_at, updated_at
SortDirection asc, desc

Exceptions

All exceptions extend CloudinaryPeopleError and expose .message and .status_code.

Exception HTTP Status Cause
AuthenticationError 401 Invalid API key or secret
FeatureNotEnabledError 403 People Search not enabled for the environment
PersonNotFoundError 404 No person found for the given person_id
APIValidationError 400 Invalid parameter value or missing field
ServerError 5xx Unexpected server-side error
from cloudinary_people import PersonNotFoundError, AuthenticationError

try:
    person = client.get_person("nonexistent-id")
except PersonNotFoundError as e:
    print(f"Not found: {e.message}")
except AuthenticationError as e:
    print(f"Auth failed ({e.status_code}): {e.message}")

Running Tests

pip install -e ".[dev]"
pytest

Verbose Logging

All requests and responses are logged via the cloudinary_people logger at DEBUG level. Enable it using Python's standard logging module:

import logging

logging.getLogger("cloudinary_people").setLevel(logging.DEBUG)
logging.basicConfig(level=logging.DEBUG)

client = CloudinaryPeopleClient(
    cloud_name="my-cloud",
    api_key="...",
    api_secret="...",
)

License

MIT

Metadata

Release files for cloudinary-people 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudinary-people 0.1.3
File Size Uploaded Provenance Actions
cloudinary_people-0.1.3.tar.gz 15.9 kB Without provenance Details for cloudinary_people-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cloudinary-people 0.1.3
File Interpreter ABI Platform Actions
cloudinary_people-0.1.3-py3-none-any.whl Python 3 none any Details for cloudinary_people-0.1.3-py3-none-any.whl

Total release size: 29.2 kB

Release files / cloudinary_people-0.1.3.tar.gz

Download URL cloudinary_people-0.1.3.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
832fee21dcbf831e89116691188b707d50a4da263fd9fd79e493382154ac0d17
BLAKE2b-256 checksum
How to use checksums
d3a754bd316df2548778ac59b1ca2f278b8d231ea509c987335884febeedcf84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / cloudinary_people-0.1.3-py3-none-any.whl

Download URL cloudinary_people-0.1.3-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27d51855397a9ab9a376a61f3ad93ae36e4103a2b207658eb517c415ce07d325
BLAKE2b-256 checksum
How to use checksums
4b0d46159af7c2c1570dcba702a1bce1d5e6e3efbd1948281fca2db79d64ad5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Security for cloudinary-people 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page