syncsketch


Namesyncsketch JSON
Version 1.0.11.0 PyPI version JSON
download
home_pagehttps://github.com/syncsketch/python-api
SummarySyncSketch Python API
upload_time2025-03-15 04:38:44
maintainerNone
docs_urlNone
authorPhilip Floetotto
requires_python<=3.12,>=2.7
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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](https://img.shields.io/pypi/v/syncsketch?color=blue)](https://pypi.org/project/syncsketch/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syncsketch)
![PyPI - License](https://img.shields.io/pypi/l/syncsketch)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

Sign up for an account at
[SyncSketch.com](https://syncsketch.com)

API access requires an enterprise level account.

# Documentation

[Read the full documentation here](https://syncsketch.github.io/python-api/)

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+
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12

#### Installation

[PyPi package](https://pypi.org/project/syncsketch/)

Install using `pip`...

```bash
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](https://github.com/syncsketch/python-api/blob/master/syncsketch/syncsketch.py) 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](https://syncsketch.com/pro/#/userProfile/settings). 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. 

```python
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)

```python
# 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

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

Let's create a project with the selected account

```python
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`

```python
review = s.create_review(project['id'], 'DEV Review (api)','DEV Syncsketch API Testing')
```

##### 4) Get list of reviews

```python
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.

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

If all steps were successful, you should see the following in the web-app. 

![alt text](https://github.com/syncsketch/python-api/blob/documentation/examples/resources/exampleResult.jpg?raw=true)

### 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

```python
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
```python
  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
```python
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
```python
response = s.move_items(
    new_review_id,
    [
        {
            "review_id": old_review_id,
            "item_id": item_id,
        }
    ]
)
```


##### Traverse all projects
```python
projects = s.get_projects()

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/syncsketch/python-api",
    "name": "syncsketch",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<=3.12,>=2.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "Philip Floetotto",
    "author_email": "phil@syncsketch.com",
    "download_url": "https://files.pythonhosted.org/packages/d9/6b/f3cc162f31ac64aa9e8b4676ee99debdb72cda28007996089290f33091f5/syncsketch-1.0.11.0.tar.gz",
    "platform": null,
    "description": "# SyncSketch Python API\n\nThis package provides methods to communicate with the syncsketch servers and wraps CRUD (create, read, update, delete) methods to interact with Reviews.\n\n[![PyPI](https://img.shields.io/pypi/v/syncsketch?color=blue)](https://pypi.org/project/syncsketch/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syncsketch)\n![PyPI - License](https://img.shields.io/pypi/l/syncsketch)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nSign up for an account at\n[SyncSketch.com](https://syncsketch.com)\n\nAPI access requires an enterprise level account.\n\n# Documentation\n\n[Read the full documentation here](https://syncsketch.github.io/python-api/)\n\nYou can also find example code snippets below\n\n# Overview\n\nSyncSketch is a synchronized visual review tool for the Film/TV/Games industry.\n\n### Getting Started\n\n#### Compatibility\nThis library was tested with and confirmed on python versions:\n- 2.7.14+\n- 3.6\n- 3.7\n- 3.8\n- 3.9\n- 3.10\n- 3.11\n- 3.12\n\n#### Installation\n\n[PyPi package](https://pypi.org/project/syncsketch/)\n\nInstall using `pip`...\n\n```bash\npip install syncsketch\n```\n\n### Data hierarchy\n\nWithin SyncSketch there is a basic data hierarchy that makes it easy to manage your resources\n\n- Account (aka Workspace)\n- Project\n- Review\n- ReviewItem (many-to-many connection table)\n- Item\n- Frame (aka comment or sketch)\n\nUsers can be connected to a workspace and/or project, and may have different permissions on each connection.\nIt's important to know which connections and permissions your api user has to ensure you can build your integration.\nYou can find these permissions in the website or ask an admin from your project/workspace.\n\nWhat does this mean?\n\n_These depend on the specific permission level_\n\n- Account/Workspace connection means you can\n  - Edit settings on the workspace\n  - Invite new workspace level users\n  - Manage projects in the account\n  - Workspace level users also get all the permissions listed below in projects\n- Project connection means you can\n  - Edit settings on the project\n  - Invite new project level users\n  - Manage reviews in the project\n  - Manage items in the reviews\n  - Manage comments or sketches on items\n\n### Basic Examples\n\nThis 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.\nWe recommend you read the [source code](https://github.com/syncsketch/python-api/blob/master/syncsketch/syncsketch.py) to see all options. \n\n#### Authentication\nBefore we can start working, we need to get an `API_KEY` which you can obtain from the syncsketch [settings page](https://syncsketch.com/pro/#/userProfile/settings). Follow the given link, login and scroll down to the bottom headline `Developer Options` to see your 40 character API-Key.\n\n\nSetting up a connection with your SyncSketch projects is as easy as following. \n\n```python\nfrom syncsketch import SyncSketchAPI\n\nusername = \"username\"\napi_key = \"api-key-123\"\n\ns = SyncSketchAPI(username, api_key)\n\n# Verify your credentials work\ns.is_connected()\n\n# Display your current user data\ns.get_current_user()\n```\n\nIf 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.\n\n\n##### 1) Choose your account\n\nBefore we can create/read/update/delete projects and/or reviews, we need to select an Account (internal api name for Workspace)\n\n```python\n# Get a list of workspaces your user has access to\naccounts = s.get_accounts()\nfirst_account = accounts[\"objects\"][0]\n```\n\nIMPORTANT: You may not see anything in the array returned from `s.get_accounts()`.\nThis means your user is connected directly to the project(s) and not an account.\nIf so you can skip this and proceed to fetching `s.get_projects()`.\n\n##### 2) Interact with Projects\n\nProjects are nested under an Account/Workspace\n\n```python\n# List projects your user has access to\ns.get_projects()\n```\n\nLet's create a project with the selected account\n\n```python\nproject = s.create_project(first_account[\"id\"], 'DEV Example Project', 'DEV API Testing')\n```\n\nThis creates a new Project called `Dev Example Project` with the description `DEV API Testing`\n\n##### 3) Create a review\n\nWe can now add a Review to our newly created Project using it's `id`\n\n```python\nreview = s.create_review(project['id'], 'DEV Review (api)','DEV Syncsketch API Testing')\n```\n\n##### 4) Get list of reviews\n\n```python\nprint(s.get_reviews_by_project_id(project['id'])\n```\n\n##### 5) Upload a review item\n\nYou 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.\n\n```python\nitem_data = s.upload_file(review['id'], 'examples/test.webm')\n```\n\nIf all steps were successful, you should see the following in the web-app. \n\n![alt text](https://github.com/syncsketch/python-api/blob/documentation/examples/resources/exampleResult.jpg?raw=true)\n\n### Additional Examples\n\n##### Get a review from a review url link\n\nIf you have a review link and want to get the review data, first you need to get the uuid from the link\n\n```python\nreview_link = \"https://syncsketch.com/sketch/abcdefg1234/\"\n\nreview_uuid = review_link.split('/')[4]\n\n# Then you can get the review data\nreview_data = s.get_review_by_uuid(review_uuid)\n```\n\n##### Adding a user to the project\n```python\n  added_users = s.add_users_to_project(\n      project_id,\n      [\n          {'email': 'test@syncsketch.com', 'permission':'viewer'}\n      ],\n      \"This is a note to include with the welcome email\"\n  )\n  print(added_users)\n```\n\n\n##### Update sort order of items in a review\n```python\nresponse = s.sort_review_items(\n    review_id,\n    [\n        { \"id\": 111, \"sortorder\": 0 },\n        { \"id\": 222, \"sortorder\": 1 },\n        { \"id\": 333, \"sortorder\": 2 },\n    ]\n)\nprint(response)\n# {u'updated_items': 3}\n```\n\n\n##### Move items from one review to another\n```python\nresponse = s.move_items(\n    new_review_id,\n    [\n        {\n            \"review_id\": old_review_id,\n            \"item_id\": item_id,\n        }\n    ]\n)\n```\n\n\n##### Traverse all projects\n```python\nprojects = s.get_projects()\n\nfor project in projects['objects']:\n    print(project)\n```\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "SyncSketch Python API",
    "version": "1.0.11.0",
    "project_urls": {
        "Homepage": "https://github.com/syncsketch/python-api"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ac09edbfb41ea0b51f00e87e9f9e11db61dcf81b4a341c66db2c9664fe89151",
                "md5": "ca11f195df6987232378e871cf0054df",
                "sha256": "199fe9674baa224baa3cecc570fa2ccadc442e3caac70a89b3bb0734cdd4af53"
            },
            "downloads": -1,
            "filename": "syncsketch-1.0.11.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca11f195df6987232378e871cf0054df",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<=3.12,>=2.7",
            "size": 20586,
            "upload_time": "2025-03-15T04:38:40",
            "upload_time_iso_8601": "2025-03-15T04:38:40.685356Z",
            "url": "https://files.pythonhosted.org/packages/3a/c0/9edbfb41ea0b51f00e87e9f9e11db61dcf81b4a341c66db2c9664fe89151/syncsketch-1.0.11.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d96bf3cc162f31ac64aa9e8b4676ee99debdb72cda28007996089290f33091f5",
                "md5": "dc73a97db8a9aac2580dae8f8ff2c4f3",
                "sha256": "a3541bd98c09a24e0eeafd283792e18dc45845fc25ab6ab3aa5f8974bd516c97"
            },
            "downloads": -1,
            "filename": "syncsketch-1.0.11.0.tar.gz",
            "has_sig": false,
            "md5_digest": "dc73a97db8a9aac2580dae8f8ff2c4f3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<=3.12,>=2.7",
            "size": 22812,
            "upload_time": "2025-03-15T04:38:44",
            "upload_time_iso_8601": "2025-03-15T04:38:44.809445Z",
            "url": "https://files.pythonhosted.org/packages/d9/6b/f3cc162f31ac64aa9e8b4676ee99debdb72cda28007996089290f33091f5/syncsketch-1.0.11.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-03-15 04:38:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "syncsketch",
    "github_project": "python-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "syncsketch"
}
        
Elapsed time: 2.38393s