Skip to main content

A thread-safe wrapper around Flow Production Tracking (formerly ShotGrid) with query field support

Project description

fpt-api

A thread-safe wrapper around Flow Production Tracking (formerly ShotGrid) that extends shotgun_api3 to support query field retrieval and parallel processing.

Features

  • 🔍 Retrieves query fields (not supported in base shotgun_api3)
  • 🧵 Thread-safe operations (not supported in base shotgun_api3)
  • ⚡ Parallel processing for improved performance
  • 🔌 Drop-in replacement for basic shotgun_api3 operations

Installation

From PyPI:

pip install fpt-api
pip install git+https://github.com/shotgunsoftware/python-api.git

From source:

pip install git+https://github.com/ksallee/fpt-api.git
pip install git+https://github.com/shotgunsoftware/python-api.git

Why This Wrapper?

The standard shotgun_api3 library has two main limitations:

  1. No support for query field retrieval, which is essential for reporting and analytics
  2. Not thread-safe, which can cause issues in multi-threaded applications

This wrapper addresses both issues by:

  • Implementing query field retrieval
  • Adding thread safety
  • Parallelizing query field retrieval for better performance

Usage

Basic Usage

from fpt_api import FPT

# Initialize the client
fpt = FPT(
    "https://yourshotgunurl.com",
    script_name="your_script_name",
    api_key="your_script_key"
)

# Find a single shot
shot = fpt.find_one(
    "Shot",
    [["id", "is", 1234]],
    ["code", "sg_status_list", "sg_query_field"]
)

# Find multiple shots
shots = fpt.find(
    "Shot",
    [["id", "in", [1234, 12345]]],
    ["code", "sg_status_list", "sg_query_field"]
)

API Reference

Check out the Official Shotgun API Reference for more information on the base shotgun_api3 library. FPT does not change the base API, but rather extends it with additional functionality.

Performance Notes

  • Query fields are retrieved in parallel using threads
  • Results are returned only after all query fields are retrieved
  • Future versions may implement asynchronous retrieval using futures

Contributing

Contributions are welcome! Please feel free to submit pull requests.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fpt_api-0.1.0.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fpt_api-0.1.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file fpt_api-0.1.0.tar.gz.

File metadata

  • Download URL: fpt_api-0.1.0.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fpt_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d8a71b422275434ec1fe47bddab75702a8cbed289373caf18d1c1b07a43596b7
MD5 187c93c5efd8b4d1e9e38547d45cc2d8
BLAKE2b-256 0f0db035e72d4705ad74f596d835c9736efff3bc512e00bd086aee5f1eefc4ca

See more details on using hashes here.

File details

Details for the file fpt_api-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fpt_api-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for fpt_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ecbf925ba460eee51b9daa5a1dfae4c1d5f4e0c8179f8c9191154962988a8f6
MD5 453b85d31cc7b7de936a5ca0525854d9
BLAKE2b-256 aedd049dbf8faf7623ed81a409075afd3836012d4c72cac9c42ece0040127853

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page