Skip to main content

pyfwapi

Work with the Fotoware API in Python.

Examples

Connect and iterate archives

Each server-side API endpoint is interacted with using a Tenant. Create an non-interactive application integration server-side and supply the client ID and secret to the Tenant.

>>> from pyfwapi import Tenant
>>> fw = Tenant("https://tenant.example.org", client_id="abd123", client_secret="sekret")
>>> async for archive in fw.iter_archives():
...     print(archive.name)
Marketing
Technical docs

Iterate assets in an archive

Assets (files) are organized into archives.

>>> archive = await fw.archive_by(id=5000)
>>> async for asset in fw.iter_assets(in_archive=archive):
...     print(asset.filename, asset.filesize)
 IMG_0021.jpg 27182818
 logo_v3_final_FINAL.pdf 3141592

Search assets

SE builds search expressions fluently; combine terms with & (and), | (or), - (not). Some properties that can be filtered on use abbreviated names, for which predicates.StrSpecial and predicates.Ranged are helpful.

>>> from pyfwapi.search import SE, predicates
... # PNGs at least 500px tall, mentioning "banner"
>>> q = SE().fts("banner").eq(predicates.StrSpecial.FileName, "*.png").pixel_height(min=500, max=None)
>>> async for asset in fw.match_assets(q):
...     print(asset.filename)

Previews and renditions

Previews are prerendered JPEGs, ready to download. Renditions are async, configurable, and include the original file.

>>> async for chunk in await fw.get_preview(asset, asset.previews[0]):
...     outfile.write(chunk)

>>> rendition = asset.renditions[0]
>>> async for chunk in await fw.get_rendition(rendition, "/renditions/image"):
...     outfile.write(chunk)

Change metadata, move, and upload

Changes are staged in a ChangeManager and sent to the server in one go. Note that these commits are neither atomic nor isolated, so parallel requests may find unmoved files during a commit.

>>> from pyfwapi.change.manager import ChangeManager
>>> cm = ChangeManager(fw.api)
>>> cm.set_value(asset, 305, "Approved")          # set field 305
>>> cm.move([asset], destination=other_archive)   # move between archives
>>> with open("photo.jpg", "rb") as f:
...     cm.upload(f, archive, filename="photo.jpg")
>>> await cm.commit()

Design considerations

The API responses are parsed using Pydantic. It's a hefty dependency, but -- for now -- allows easy parsing of the JSON responses. And it also enables easy integration with FastAPI.

Explorations of attrs, cattrs, and msgspec failed to quickly result in satisfactory objects from the API JSON responses.

The name of the library is a portmanteau of Python Fotoware API and I pronounce it as /paɪˈfwɒ.pi/.

Metadata

Release files for pyfwapi 0.5.0

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

Source distribution (sdist)

Source distribution for pyfwapi 0.5.0
File Size Uploaded Provenance Actions
pyfwapi-0.5.0.tar.gz 60.0 kB With provenance Details for pyfwapi-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyfwapi 0.5.0
File Interpreter ABI Platform Actions
pyfwapi-0.5.0-py3-none-any.whl Python 3 none any Details for pyfwapi-0.5.0-py3-none-any.whl

Total release size: 83.7 kB

Release files / pyfwapi-0.5.0.tar.gz

Download URL pyfwapi-0.5.0.tar.gz
Size 60.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9d9a43e9ad81c1baa3a6df1ae7a2a373b20fa03d77794cf30a7f57db775c1107
BLAKE2b-256 checksum
How to use checksums
fcdaaff06b20897be85dda69b8dfb1bf67d076aa4b2dfee4e0c7fe6721e937b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Release files / pyfwapi-0.5.0-py3-none-any.whl

Download URL pyfwapi-0.5.0-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
386e2128983b688965d935a71308cc9f170add6ef26a9c4233cf3dd86d0d526e
BLAKE2b-256 checksum
How to use checksums
d551424542e6776f445c92404c04936d4db82ccd615193816400fc65e81451a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

Security for pyfwapi 0.5.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pyfwapi-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 3, 2026.

Transparency log

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