syncsketch


Namesyncsketch JSON
Version 1.0.10.1 PyPI version JSON
download
home_pagehttps://github.com/syncsketch/python-api
SummarySyncSketch Python API
upload_time2023-11-21 19:36:17
maintainer
docs_urlNone
authorPhilip Floetotto
requires_python
licenseLICENSE.txt
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.

# Overview

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

API access requires an enterprise level account.  For help or more info reach out to us.

### Getting Started

#### Compatibility
This library was tested with and confirmed on python versions:
- 2.7.14+
- 3.6
- 3.7
- 3.8

PyPi package

https://pypi.org/project/syncsketch/

#### Installation

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](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. 

    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.add_media(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
  addedUsers = s.add_users_to_project(
      project_id,
      [
          {'email': 'test@syncsketch.com', 'permission':'viewer'}
      ],
      "This is a note to include with the welcome email"
  )
  print(addedUsers)
```


##### 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": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Philip Floetotto",
    "author_email": "phil@syncsketch.com",
    "download_url": "https://files.pythonhosted.org/packages/9a/f1/4e53b22e14282d5202591ecc0405224be30af4a6ce09994003c8fb86c662/syncsketch-1.0.10.1.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# Overview\n\nSyncSketch is a synchronized visual review tool for the Film/TV/Games industry.\n\nAPI access requires an enterprise level account.  For help or more info reach out to us.\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\nPyPi package\n\nhttps://pypi.org/project/syncsketch/\n\n#### Installation\n\nInstall using `pip`...\n\n    pip install syncsketch\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    from syncsketch import SyncSketchAPI\n    \n    username = \"username\"\n    api_key = \"api-key-123\"\n    \n    s = SyncSketchAPI(username, api_key)\n    \n    # Verify your credentials work\n    s.is_connected()\n\n    # Display your current user data\n    s.get_current_user()\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    # Get a list of workspaces your user has access to\n    accounts = s.get_accounts()\n    first_account = accounts[\"objects\"][0]\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    # List projects your user has access to\n    s.get_projects()\n\nLet's create a project with the selected account\n\n    project = s.create_project(first_account[\"id\"], 'DEV Example Project', 'DEV API Testing')\n\nThis creates a new Project called `Dev Example Project` with the description `DEV API Testing`\n\n\n##### 3) Create a review\n\nWe can now add a Review to our newly created Project using it's `id`\n\n    review = s.create_review(project['id'], 'DEV Review (api)','DEV Syncsketch API Testing')\n\n\n##### 4) Get list of reviews\n\n\n    print(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    item_data = s.add_media(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  addedUsers = 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(addedUsers)\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": "LICENSE.txt",
    "summary": "SyncSketch Python API",
    "version": "1.0.10.1",
    "project_urls": {
        "Homepage": "https://github.com/syncsketch/python-api"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a50169a74ac1339ca1fc07bbcae34caae2facdfc5bae85c30dc136b885782003",
                "md5": "d443d61eb78eeafcd9201cdd228be4b2",
                "sha256": "b2e383d356147f6269658b406b27a535d3bed8f11db47fa46666b773ec2a7a97"
            },
            "downloads": -1,
            "filename": "syncsketch-1.0.10.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d443d61eb78eeafcd9201cdd228be4b2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 15250,
            "upload_time": "2023-11-21T19:36:12",
            "upload_time_iso_8601": "2023-11-21T19:36:12.405057Z",
            "url": "https://files.pythonhosted.org/packages/a5/01/69a74ac1339ca1fc07bbcae34caae2facdfc5bae85c30dc136b885782003/syncsketch-1.0.10.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9af14e53b22e14282d5202591ecc0405224be30af4a6ce09994003c8fb86c662",
                "md5": "3113e6ef543a61c6cb72364de0e8987e",
                "sha256": "c0bef0f29b96cfa6ce968a58fd3dd1947743921d876f61be79e94a238796d084"
            },
            "downloads": -1,
            "filename": "syncsketch-1.0.10.1.tar.gz",
            "has_sig": false,
            "md5_digest": "3113e6ef543a61c6cb72364de0e8987e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 16604,
            "upload_time": "2023-11-21T19:36:17",
            "upload_time_iso_8601": "2023-11-21T19:36:17.152550Z",
            "url": "https://files.pythonhosted.org/packages/9a/f1/4e53b22e14282d5202591ecc0405224be30af4a6ce09994003c8fb86c662/syncsketch-1.0.10.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-21 19:36:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "syncsketch",
    "github_project": "python-api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "syncsketch"
}
        
Elapsed time: 0.14450s