Skip to main content

SyncSketch Python API

Project description

SyncSketch Python API

This package provides methods to communicate with the syncsketch servers and wraps CRUD (create, read, update, delete) methods to interact with Reviews.

PyPI PyPI - Python Version PyPI - License Code style: black

Sign up for an account at SyncSketch.com

API access requires an enterprise level account.

Documentation

Read the full documentation here

You can also find example code snippets below

Overview

SyncSketch is a synchronized visual review tool for the Film/TV/Games industry.

Getting Started

Compatibility

This library was tested with and confirmed on python versions:

  • 2.7.14+ (see note below)
  • 3.7 (see note below)
  • 3.8
  • 3.9
  • 3.10
  • 3.11
  • 3.12
  • 3.13
  • 3.14

Python 2.7 & 3.7 Deprecation Notice: Python 2.7 and 3.7 have reached end-of-life and are no longer actively supported by the Python community. While existing functionality in this library will continue to work on these versions, new features and improvements will only be tested against Python 3.8 and above. We recommend upgrading to a supported Python version.

Installation

PyPi package

Install using pip...

pip install syncsketch

Data hierarchy

Within SyncSketch there is a basic data hierarchy that makes it easy to manage your resources

  • Account (aka Workspace)
  • Project
  • Review
  • ReviewItem (many-to-many connection table)
  • Item
  • Frame (aka comment or sketch)

Users can be connected to a workspace and/or project, and may have different permissions on each connection. It's important to know which connections and permissions your api user has to ensure you can build your integration. You can find these permissions in the website or ask an admin from your project/workspace.

What does this mean?

These depend on the specific permission level

  • Account/Workspace connection means you can
    • Edit settings on the workspace
    • Invite new workspace level users
    • Manage projects in the account
    • Workspace level users also get all the permissions listed below in projects
  • Project connection means you can
    • Edit settings on the project
    • Invite new project level users
    • Manage reviews in the project
    • Manage items in the reviews
    • Manage comments or sketches on items

Basic Examples

This page includes simple examples to get you started working with our api, but does not show all the methods or parameters that you can use. We recommend you read the source code to see all options.

Authentication

Before we can start working, we need to get an API_KEY which you can obtain from the syncsketch settings page. Follow the given link, login and scroll down to the bottom headline Developer Options to see your 40 character API-Key.

Setting up a connection with your SyncSketch projects is as easy as following.

from syncsketch import SyncSketchAPI

username = "username"
api_key = "api-key-123"

s = SyncSketchAPI(username, api_key)

# Verify your credentials work
s.is_connected()

# Display your current user data
s.get_current_user()

If you got a 200 response, you successfully connected to the syncsketch server! You can proceed with the next examples. We will skip the setup code for the next examples and the snippets will rely on each other, so make sure you run them one by one.

1) Choose your account

Before we can create/read/update/delete projects and/or reviews, we need to select an Account (internal api name for Workspace)

# Get a list of workspaces your user has access to
accounts = s.get_accounts()
first_account = accounts["objects"][0]

IMPORTANT: You may not see anything in the array returned from s.get_accounts(). This means your user is connected directly to the project(s) and not an account. If so you can skip this and proceed to fetching s.get_projects().

2) Interact with Projects

Projects are nested under an Account/Workspace

# List projects your user has access to
s.get_projects()

Let's create a project with the selected account

project = s.create_project(first_account["id"], 'DEV Example Project', 'DEV API Testing')

This creates a new Project called Dev Example Project with the description DEV API Testing

3) Create a review

We can now add a Review to our newly created Project using it's id

review = s.create_review(project['id'], 'DEV Review (api)','DEV Syncsketch API Testing')
4) Get list of reviews
print(s.get_reviews_by_project_id(project['id'])
5) Upload a review item

You can upload a file to the created review with the review id, we provided one example file in this repo under examples/test.webm for testing.

item_data = s.upload_file(review['id'], 'examples/test.webm')

If all steps were successful, you should see the new item under the review in the web-app.

Additional Examples

Get a review from a review url link

If you have a review link and want to get the review data, first you need to get the uuid from the link

review_link = "https://syncsketch.com/sketch/abcdefg1234/"

review_uuid = review_link.split('/')[4]

# Then you can get the review data
review_data = s.get_review_by_uuid(review_uuid)
Adding a user to the project
  added_users = s.add_users_to_project(
      project_id,
      [
          {'email': 'test@syncsketch.com', 'permission':'viewer'}
      ],
      "This is a note to include with the welcome email"
  )
  print(added_users)
Update sort order of items in a review
response = s.sort_review_items(
    review_id,
    [
        { "id": 111, "sortorder": 0 },
        { "id": 222, "sortorder": 1 },
        { "id": 333, "sortorder": 2 },
    ]
)
print(response)
# {u'updated_items': 3}
Move items from one review to another
response = s.move_items(
    new_review_id,
    [
        {
            "review_id": old_review_id,
            "item_id": item_id,
        }
    ]
)
Traverse all projects
projects = s.get_projects()

for project in projects['objects']:
    print(project)

Publishing a New Release

  1. Update the version in both setup.py and syncsketch/__init__.py (keep them in sync).

  2. Build the distribution:

python -m build
  1. Verify the build artifacts in dist/:
ls dist/syncsketch-<version>*
  1. Upload to PyPI:
python -m twine upload dist/syncsketch-<version>*

To test with TestPyPI first:

python -m twine upload --repository testpypi dist/syncsketch-<version>*

Requires the build and twine packages (pip install build twine).

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

syncsketch-1.0.12.1.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

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

syncsketch-1.0.12.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file syncsketch-1.0.12.1.tar.gz.

File metadata

  • Download URL: syncsketch-1.0.12.1.tar.gz
  • Upload date:
  • Size: 36.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for syncsketch-1.0.12.1.tar.gz
Algorithm Hash digest
SHA256 43e2875ae7a124f7792286e4428dbcb772a4ad57c201d8d39ce0bbf6ec9e855e
MD5 9eb757800a63ab1ce97a1c4a49a3116f
BLAKE2b-256 2638bc13625994baba4846733414a25c0ebedda698fae5712c6119558a45f337

See more details on using hashes here.

Provenance

The following attestation bundles were made for syncsketch-1.0.12.1.tar.gz:

Publisher: publish.yml on syncsketch/python-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file syncsketch-1.0.12.1-py3-none-any.whl.

File metadata

  • Download URL: syncsketch-1.0.12.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for syncsketch-1.0.12.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9cf13905ca2167d2db90bcf2801ed8dbc5e247b6adccc5efd2c51eb513daec55
MD5 9e16fb2a87f2db51b8345fdf076b62e0
BLAKE2b-256 ab5249a3309fffd129a63bafecf170d64acf5aa60b645cc8e35ca26aa5c1f17d

See more details on using hashes here.

Provenance

The following attestation bundles were made for syncsketch-1.0.12.1-py3-none-any.whl:

Publisher: publish.yml on syncsketch/python-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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