Skip to main content

Python package for the Storz object store framework.

Project description

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)
    
    # ...

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

pystorz-0.7.6.tar.gz (31.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pystorz-0.7.6-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

Details for the file pystorz-0.7.6.tar.gz.

File metadata

  • Download URL: pystorz-0.7.6.tar.gz
  • Upload date:
  • Size: 31.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for pystorz-0.7.6.tar.gz
Algorithm Hash digest
SHA256 d1a87c3a8ff10f3e7e12e1cffee3ac4ec7dcba8847812ac6f27c23dd9f0b2d37
MD5 c441e89b24faad63e5a689197c17a398
BLAKE2b-256 44d5dbe2efdbdd026ca0043307d09f73b8b51f2bf4286f1dee5e4e720b06a4de

See more details on using hashes here.

File details

Details for the file pystorz-0.7.6-py3-none-any.whl.

File metadata

  • Download URL: pystorz-0.7.6-py3-none-any.whl
  • Upload date:
  • Size: 41.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.10

File hashes

Hashes for pystorz-0.7.6-py3-none-any.whl
Algorithm Hash digest
SHA256 167f0c8bec21d7dcf9099229c6163cd33b4a694f11166aa2ddc8a8e3e038f9ce
MD5 96afbfd8dc283f6816051a6d19223358
BLAKE2b-256 a55e5f7b18ca714896e4734b015220e3933e027270bbfc6aa8931e42906d8dfd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page