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/.
Release files for pyfwapi 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyfwapi-0.4.0.tar.gz | 59.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyfwapi-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 83.4 kB
Release files / pyfwapi-0.4.0.tar.gz
| Download URL | pyfwapi-0.4.0.tar.gz |
|---|---|
| Size | 59.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c535a7b96a298e7558a16b0f12f5817103a962a64e4ab0a17beb914327ed48b6
|
|
BLAKE2b-256 checksum How to use checksums |
8773d101a1b431f4ed6f88a54cb1e35abe1ead66839ce585d6ac9fd195d0188f
|
| 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 Sep 25, 2026.
Transparency logRelease files / pyfwapi-0.4.0-py3-none-any.whl
| Download URL | pyfwapi-0.4.0-py3-none-any.whl |
|---|---|
| Size | 23.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dd2f9111d4096b39a69119de16ff904399e300412fd1610ffbc3f68bcd9ebf3a
|
|
BLAKE2b-256 checksum How to use checksums |
4586e46f30c47d8a59306fef507b52124a85612b26b9f4619b110b150774a9c8
|
| 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 Sep 25, 2026.
Transparency log