Coder Social home page Coder Social logo

pystorz's Introduction

storz

pystorz is an object store framework built in python. It consists of a set of modules implementing the Store interface and features a simple object modeling language used to generate golang object class meta for interacting with Store APIs.

pystorz modules provide functionality to store, modify and retrieve modeled objects from various sources (TBD). Such modules can be composed together to chain Store functionality into more complex logical modules. Combining modules allows handling object changes and manipulating data in complex ways within or across services, making multi-level server complexity achievable with ease. The Store modules are fully compatible with each other and can be composed in any combination since they all implement or expose the same Store interface.

Original storz was written in go. You can check it out here: https://github.com/wazofski/gostorz

This is a python port of the original storz. Still in development.

Quick Start Guide

Installation

pip install pystorz

Model example

You can find a saomple model in the tests folder. https://github.com/wazofski/pystorz/blob/master/tests/model/sample.yml

You can define simple structures and reference them as fields in other structures.

You need to define Objects that will become your root level modeled objects. You can then create, update, delete and retrieve these from using a store.

Only a SQLite store is implemented at the moment.

More to come. Check out the go version (link above) for more information.

Usage

    from pystorz.mgen import builder

    # run the code gen to 
    builder.Generate("path/to/model.yml")
    # this will make a generated folder in the project home directory

    # you can then import the generated model
    from generated import model

    # initialize a store
    stor = SqliteStore(
        Schema(),
        SqliteConnector("path/to/your/sqlite3.db"))

    world = model.WorldFactory()
    world.External().SetName("hello")

    created_world = stor.Create(world)
    world.External().SetDescription("hello world")
    updated_world = stor.Update(world.Metadata().Identity(), world)
    
    # ...

pystorz's People

Contributors

wazofski avatar

Stargazers

 avatar  avatar

Watchers

 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.