stores Package

stores Package

Storage systems for TiddlyWeb.

The base Class and Interface for Classes used to get and put data into a storage system.

class tiddlyweb.stores.StorageInterface(store_config=None, environ=None)

Bases: object

A Store is a collection of methods that either store an object or retrieve an object.

The interface is fairly simple: For the data entities that exist in the TiddlyWeb system there (optionally) exists <entity>_put, <entity>_get and <entity>_delete methods in each Store.

There are also five supporting methods, list_recipes(), list_bags(), list_users(), list_bag_tiddlers(), and list_tiddler_revisions() that provide methods for getting a collection.

It is useful to understand the classes in the tiddlyweb.model package when implementing new StorageInterface classes.

If a method is not implemented by the StorageInterface a StoreMethodNotImplemented exception is raised and the calling code is expected to handle that intelligently.

bag_delete(bag)

Remove the bag from the store, including the tiddlers within the bag.

bag_get(bag)

Get a bag from the store, returning a populated bag object.

bag_put(recipe)

Put a bag into the store.

list_bag_tiddlers(bag)

Retrieve a list of all tiddler objects in the named bag.

list_bags()

Retrieve a list of all bag objects in the system.

list_recipes()

Retrieve a list of all recipe objects in the system.

list_tiddler_revisions(tiddler)

Retrieve a list of all the revision identifiers for one tiddler.

list_users()

Retrieve a list of all the user objects in the system.

recipe_delete(recipe)

Remove the recipe from the store, with no impact on the tiddlers.

recipe_get(recipe)

Get a recipe from the store, returning a populated recipe object.

recipe_put(recipe)

Put a recipe into the store.

search(search_query)

Search the entire tiddler store for search_query.

tiddler_delete(tiddler)

Delete a tiddler from the store.

tiddler_get(tiddler)

Get a tiddler from the store, returning a populated tiddler object. tiddler.creator and tiddler.created are based on the modifier and modified of the first revision of a tiddler.

tiddler_put(tiddler)

Put a tiddler into the store.

user_delete(user)

Delete a user from the store.

user_get(user)

Get a user from the store, returning a populated user object.

user_put(user)

Put a user into the store.

text Module

A text-based StorageInterface that stores entities in the filesystem.

class tiddlyweb.stores.text.Store(store_config=None, environ=None)

Bases: tiddlyweb.stores.StorageInterface

A StorageInterface which stores text-based representations in a collection of directories and files.

bag_delete(bag)

Delete a bag AND THE TIDDLERS WITHIN from the system.

bag_get(bag)

Read a bag from the store.

bag_put(bag)

Put a bag into the store, writing its name, description and policy.

list_bag_tiddlers(bag)

List all the tiddlers in the provided bag.

list_bags()

List all the bags in the store.

list_recipes()

List all the recipes in the store.

list_tiddler_revisions(tiddler)

List all the revisions of one tiddler, returning a list of ints.

list_users()

List all the users in the store.

recipe_delete(recipe)

Remove a recipe, irrevocably, from the system. No impact on tiddlers.

recipe_get(recipe)

Read a recipe from the store.

recipe_put(recipe)

Put a recipe into the store.

search(search_query)

Search in the store for tiddlers that match search_query. This is intentionally simple, slow and broken to encourage overriding.

tiddler_delete(tiddler)

Irrevocably remove a tiddler and its directory.

tiddler_get(tiddler)

Get a tiddler as string from a bag and deserialize it into object.

tiddler_put(tiddler)

Write a tiddler into the store. We only write if the bag already exists. Bag creation is a separate action from writing to a bag.

user_delete(user)

Delete a user from the store.

user_get(user)

Read a user from the store.

user_put(user)

Put a user data into the store. The user’s information is store as JSON, for ease.

Table Of Contents

Previous topic

serializations Package

Next topic

web Package

This Page