nsa-pythonik


Namensa-pythonik JSON
Version 0.9.0 PyPI version JSON
download
home_pagehttps://github.com/NorthShoreAutomation/pythonik
SummaryPython SDK for Iconik's API
upload_time2024-11-14 18:33:00
maintainerNone
docs_urlNone
authorbrant
requires_python<4.0,>=3.9
licenseMIT
keywords iconik api sdk media
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pythonik

Pythonik is a comprehensive Python SDK designed for seamless interaction with
the Iconik API. It offers a user-friendly interface to access various
functionalities of Iconik, making it easier for developers to integrate and
manage Iconik assets and metadata within their applications.

## Features

- Easy-to-use methods for accessing Iconik assets and metadata.
- Robust handling of API authentication and requests.
- Configurable timeout settings for API interactions.

## Installation

You can install Pythonik directly from PyPI:

```bash
pip install nsa-pythonik
```

If you're using Poetry:
```bash
poetry add nsa-pythonik
```

## Usage

### Get an Asset from Iconik

To retrieve an asset from Iconik, use the following code:

```python
from pythonik.client import PythonikClient
from pythonik.models.assets.assets import Asset
from pythonik.models.base import Response

app_id = secrets.get_secret("app_id")
auth_token = secrets.get_secret("auth_token")
asset_id = secrets.get_secret("asset_id")

client: PythonikClient = PythonikClient(app_id=app_id, auth_token=auth_token, timeout=10)


res: Response = client.assets().get(asset_id)
data: Asset = res.data
data_as_dict = data.model_dump()
data_as_json = data.model_dump_json()

```

### Get Metadata from a View

To get metadata for an asset from a specific view, use the following code:

```python
from pythonik.client import PythonikClient
from pythonik.models.assets.metadata import ViewMetadata
from pythonik.models.base import Response

app_id = secrets.get_secret("app_id")
auth_token = secrets.get_secret("auth_token")

asset_id = 'a31sd2asdf123jasdfq134'
view_id = 'a12sl34s56asdf123jhas2'

client: PythonikClient = PythonikClient(app_id=app_id, auth_token=auth_token, timeout=5)

default_model = ViewMetadata()
# intercept_404 intercepts 404 errors if no metadata is found in view and returns a ViewMetadata model you provide so you can handle the error gracefully
res: Response = client.metadata().get_asset_metadata(asset_id, view_id, intercept_404=default_model)
data: ViewMetadata = res.data
data_as_dict = data.model_dump()
data_as_json = data.model_dump_json()
```

Checkout the [API reference](./docs/API_REFERENCE.md) and [advanced usage guide](./docs/ADVANCED_USAGE.md) to see all you can do with Pythonik.

## Publishing to PyPI (for maintainers) 

To publish a new version to PyPI please see the [release how-to guide](./docs/RELEASE_HOW_TO.md).


## Using Poetry

This project uses Poetry for dependency management and packaging. Below are instructions on how to work with Poetry, create a Poetry shell, and run tests using pytest.

### Setting Up Poetry

First, install Poetry if you haven't already:

### Creating a Poetry Shell

To create and activate a Poetry shell, which sets up an isolated virtual environment for your project:

1. Navigate to your project directory.
2. Run the following command:

   ```sh
   poetry shell
   ```

This command will activate a virtual environment managed by Poetry. You can now run Python commands and scripts within this environment.

### Install all dependencies including pytest

```sh
    poetry install
```

### Running Tests with pytest

To run tests using pytest, follow these steps:

1. Inside the Poetry shell, run the tests with the following command:

   ```sh
   pytest
   ```

This will discover and execute all the tests in your project.

---

By following these steps, you can efficiently manage dependencies, create a virtual environment, and run tests in your Python project using Poetry.

## Support

For support, please contact NSA.

## Roadmap

Details about upcoming features and enhancements will be added here.

## Contributing

Please see the [contribution guide](./CONTRIBUTING.md) for information on how to contribute.

## Authors and Acknowledgment

This SDK is developed and maintained by North Shore Automation developers,
including Brant Goddard, Prince Duepa, Giovann Wah, and Brandon Dedolph.

## Contributors

## License

License information will be available soon.

## Project Status

Current project status and updates will be posted here.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/NorthShoreAutomation/pythonik",
    "name": "nsa-pythonik",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "iconik, api, sdk, media",
    "author": "brant",
    "author_email": "brant@northshoreautomation.com",
    "download_url": "https://files.pythonhosted.org/packages/3a/e0/9b60c6830eed8d12a263da9a4d44ba2dac0f92bc90b24337e0789874465e/nsa_pythonik-0.9.0.tar.gz",
    "platform": null,
    "description": "# Pythonik\n\nPythonik is a comprehensive Python SDK designed for seamless interaction with\nthe Iconik API. It offers a user-friendly interface to access various\nfunctionalities of Iconik, making it easier for developers to integrate and\nmanage Iconik assets and metadata within their applications.\n\n## Features\n\n- Easy-to-use methods for accessing Iconik assets and metadata.\n- Robust handling of API authentication and requests.\n- Configurable timeout settings for API interactions.\n\n## Installation\n\nYou can install Pythonik directly from PyPI:\n\n```bash\npip install nsa-pythonik\n```\n\nIf you're using Poetry:\n```bash\npoetry add nsa-pythonik\n```\n\n## Usage\n\n### Get an Asset from Iconik\n\nTo retrieve an asset from Iconik, use the following code:\n\n```python\nfrom pythonik.client import PythonikClient\nfrom pythonik.models.assets.assets import Asset\nfrom pythonik.models.base import Response\n\napp_id = secrets.get_secret(\"app_id\")\nauth_token = secrets.get_secret(\"auth_token\")\nasset_id = secrets.get_secret(\"asset_id\")\n\nclient: PythonikClient = PythonikClient(app_id=app_id, auth_token=auth_token, timeout=10)\n\n\nres: Response = client.assets().get(asset_id)\ndata: Asset = res.data\ndata_as_dict = data.model_dump()\ndata_as_json = data.model_dump_json()\n\n```\n\n### Get Metadata from a View\n\nTo get metadata for an asset from a specific view, use the following code:\n\n```python\nfrom pythonik.client import PythonikClient\nfrom pythonik.models.assets.metadata import ViewMetadata\nfrom pythonik.models.base import Response\n\napp_id = secrets.get_secret(\"app_id\")\nauth_token = secrets.get_secret(\"auth_token\")\n\nasset_id = 'a31sd2asdf123jasdfq134'\nview_id = 'a12sl34s56asdf123jhas2'\n\nclient: PythonikClient = PythonikClient(app_id=app_id, auth_token=auth_token, timeout=5)\n\ndefault_model = ViewMetadata()\n# intercept_404 intercepts 404 errors if no metadata is found in view and returns a ViewMetadata model you provide so you can handle the error gracefully\nres: Response = client.metadata().get_asset_metadata(asset_id, view_id, intercept_404=default_model)\ndata: ViewMetadata = res.data\ndata_as_dict = data.model_dump()\ndata_as_json = data.model_dump_json()\n```\n\nCheckout the [API reference](./docs/API_REFERENCE.md) and [advanced usage guide](./docs/ADVANCED_USAGE.md) to see all you can do with Pythonik.\n\n## Publishing to PyPI (for maintainers) \n\nTo publish a new version to PyPI please see the [release how-to guide](./docs/RELEASE_HOW_TO.md).\n\n\n## Using Poetry\n\nThis project uses Poetry for dependency management and packaging. Below are instructions on how to work with Poetry, create a Poetry shell, and run tests using pytest.\n\n### Setting Up Poetry\n\nFirst, install Poetry if you haven't already:\n\n### Creating a Poetry Shell\n\nTo create and activate a Poetry shell, which sets up an isolated virtual environment for your project:\n\n1. Navigate to your project directory.\n2. Run the following command:\n\n   ```sh\n   poetry shell\n   ```\n\nThis command will activate a virtual environment managed by Poetry. You can now run Python commands and scripts within this environment.\n\n### Install all dependencies including pytest\n\n```sh\n    poetry install\n```\n\n### Running Tests with pytest\n\nTo run tests using pytest, follow these steps:\n\n1. Inside the Poetry shell, run the tests with the following command:\n\n   ```sh\n   pytest\n   ```\n\nThis will discover and execute all the tests in your project.\n\n---\n\nBy following these steps, you can efficiently manage dependencies, create a virtual environment, and run tests in your Python project using Poetry.\n\n## Support\n\nFor support, please contact NSA.\n\n## Roadmap\n\nDetails about upcoming features and enhancements will be added here.\n\n## Contributing\n\nPlease see the [contribution guide](./CONTRIBUTING.md) for information on how to contribute.\n\n## Authors and Acknowledgment\n\nThis SDK is developed and maintained by North Shore Automation developers,\nincluding Brant Goddard, Prince Duepa, Giovann Wah, and Brandon Dedolph.\n\n## Contributors\n\n## License\n\nLicense information will be available soon.\n\n## Project Status\n\nCurrent project status and updates will be posted here.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Python SDK for Iconik's API",
    "version": "0.9.0",
    "project_urls": {
        "Homepage": "https://github.com/NorthShoreAutomation/pythonik",
        "Repository": "https://github.com/NorthShoreAutomation/pythonik"
    },
    "split_keywords": [
        "iconik",
        " api",
        " sdk",
        " media"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4017e9d835e0b8b271023da0fa3f3dfb087a711c5817d24d49316d3577c62969",
                "md5": "20d4a548b1dd32b4f523ad93b9e306e9",
                "sha256": "f6aff1b09e091b14b4a7791f6780a3f8184412d61ce32aeae02d4f5936285a09"
            },
            "downloads": -1,
            "filename": "nsa_pythonik-0.9.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "20d4a548b1dd32b4f523ad93b9e306e9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 34287,
            "upload_time": "2024-11-14T18:32:59",
            "upload_time_iso_8601": "2024-11-14T18:32:59.016435Z",
            "url": "https://files.pythonhosted.org/packages/40/17/e9d835e0b8b271023da0fa3f3dfb087a711c5817d24d49316d3577c62969/nsa_pythonik-0.9.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3ae09b60c6830eed8d12a263da9a4d44ba2dac0f92bc90b24337e0789874465e",
                "md5": "50ca5809cf3e2e2774fa492ce4ed9e5f",
                "sha256": "cdb1f12dc826660208875ef674d688036e1b1e57bd13f20c3306165f73ad3cbc"
            },
            "downloads": -1,
            "filename": "nsa_pythonik-0.9.0.tar.gz",
            "has_sig": false,
            "md5_digest": "50ca5809cf3e2e2774fa492ce4ed9e5f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 22909,
            "upload_time": "2024-11-14T18:33:00",
            "upload_time_iso_8601": "2024-11-14T18:33:00.659959Z",
            "url": "https://files.pythonhosted.org/packages/3a/e0/9b60c6830eed8d12a263da9a4d44ba2dac0f92bc90b24337e0789874465e/nsa_pythonik-0.9.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-14 18:33:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "NorthShoreAutomation",
    "github_project": "pythonik",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "nsa-pythonik"
}
        
Elapsed time: 2.25098s