Code Monkey home page Code Monkey logo

pynodes's Introduction

pynodes

A graph-based programming model for Python.

Example

class Person(nodes.GraphEnabled):

    @nodes.graphMethod(nodes.Stored)
    def Name(self):
       return None

    @nodes.graphMethod(nodes.Stored)
    def PublicKey(self):
        return None

    @nodes.graphMethod(nodes.Settable)
    def PrivateKey(self):
        return None

class EncryptedMessage(nodes.GraphEnabled):

    @nodes.graphMethod(nodes.Stored)
    def From(self):
        return None

    @nodes.graphMethod(nodes.Stored)
    def To(self):
        return None

    def setBody(self, value):
        return [nodes.NodeChange(self._BodyStored, encrypt(value, self.To().PublicKey()))]

    @nodes.graphMethod(delegate=setBody)
    def Body(self):
        if not self.To().PrivateKey():
            raise RuntimeError("No private key has been set for %s!" % self.To().Name())
        return decrypt(self._BodyStored(), self.To().PrivateKey())

    @nodes.graphMethod(nodes.Stored)
    def _BodyStored(self):
        return ''

alice = Person(Name='Alice', PublicKey=...)
bob = Person(Name='Bob', PublicKey=...)

message = EncryptedMessage(From=alice, To=bob)
message.Body = "The president is on the line."

print message._BodyStored()    # Encrypted.
print message.Body()           # <error>  (No private key has been set for Alice!)

alice.PrivateKey = ...

print message.Body()           # "The president is on the line.

Components

  • An object-oriented, graph-based programming library with built-in dependency tracking, memoization, lazy evaluation, "what if" scenario creation and computation, database integration, and other features.
  • A graph database with both native and RESTful APIs.
  • A job specification, scheduling, and execution engine.
  • A grid computation framework.
  • Libraries for rapid web UI creation.
  • A bitemporal, fully rewindable event model.
  • A timeseries interface with reactive components.
  • Domain-specific class sets for trading, advertising, and systems configurations.

pynodes's People

Contributors

adamdonahue 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.