A library for basic data persistence in Nuke
Project description
A library for basic data persistence in Nuke
Installation
To install nukedatastore, type:
$ pip install nukedatastore
Open Nuke’s init.py file and add:
nuke.pluginAddPath('/path/to/your/local/python/site-packages')
Getting Started
To get started with nukedatastore, type in the Nuke Script Editor:
import nukedatastore
NukeDataStore
To initialise a NukeDataStore, type:
ds = nukedatastore.NukeDataStore('data_store')
To store data in the NukeDataStore, type:
ds['project_data'] = {'id': 1234, 'name': 'project name'}
To list all available keys in the NukeDataStore, type:
ds.list()
# ['project_data']
To retrieve stored data from the NukeDataStore, type:
ds['project_data']
# {'id': 1234, 'name': 'project name'}
A NukeDataStore can be frozen, to freeze, type:
ds.freeze()
Any further attempt to set data on the NukeDataStore will result in an error:
ds['color_data'] = {'id': 'AB-123', 'name': 'White'}
# nukedatastore.NukeDataStoreError: Cannot mutate frozen NukeDataStore
To un-freeze, type:
ds.unfreeze()
NukeAPICache
Working with the NukeAPICache is very similar. To register an API, type:
api_cache = nukedatastore. NukeAPICache('api_cache')
api.cache.register('project_data', 'https://project.your.domain.com')
To read the cached API data, type:
api_cache['project_data']
To update the API data, type:
api_cache.update('project_data')
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
Built Distribution
Hashes for nukedatastore-0.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89715ee70c110e83e6cdcf7577a17f08a12f2fbd4c93fa0bbecaa8654a90ed1a |
|
MD5 | 25bd9dfb7ceef6b556b67521c1aef25a |
|
BLAKE2b-256 | 12a22fe43b8c0c540fda4af16e5abeaebcf3a1388e262ccec389f1794bb38634 |