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.1

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.1
File Size Uploaded Provenance Actions
pyfwapi-0.5.1.tar.gz 60.0 kB With provenance Details for pyfwapi-0.5.1.tar.gz

Built distribution (wheel)

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

Total release size: 83.7 kB

Release files / pyfwapi-0.5.1.tar.gz

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

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 Nov 20, 2026.

Transparency log

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

Download URL pyfwapi-0.5.1-py3-none-any.whl
Size 23.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4ad1511f0ca261d36ed546c35c5eb51ccc00dd872b3bb63e85d9c4e4bda0604b
BLAKE2b-256 checksum
How to use checksums
1341e806d51106582e6929254576c384a430764151525a51917425df16d7d91c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Security for pyfwapi 0.5.1

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.1.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 Nov 20, 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