Giter VIP home page Giter VIP logo

nukedatastore's Introduction

nukedatastore

https://readthedocs.org/projects/nukedatastore/badge/?version=latest

A library for basic data persistence in Nuke

Full Documentation

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')

To diff existing API data with new API data, type:

api_cache.diff('project_data')
# {'project_data': {'values_changed': {"root['headers']['X-Request-Id']": {'new_value': u'f5800c5e-4edb-4509-8339-4bcdf0b32732', 'old_value': u'd8ed6737-e5c8-49aa-b42e-58eb2ba472b9'}}}}

nukedatastore's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.