This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Pure python. Path keys. ChainedMap on steroids.


Pure python.

pip install multiplane


Contexts are python dictionaries with path lookups:

import multiplane

context = multiplane.Context()

# normal dictionary operations
context["foo"] = "bar"
assert "bar" == context["foo"]
del context["foo"]

# paths
context[""] = "baz"
assert "baz" == context[""]
del context[""]

# length, iteration
n = 10
context.update((i, i+1) for i in range(n))
assert len(context) == n

for key, value in context.items():
    assert key + 1 == value

But they also track contextual changes:

ctx = multiplane.Context()
ctx["root.layer.key"] = "root_value"

with ctx("layer1"):
    # read through
    assert "root_value" == ctx["root.layer.key"]
    # local to layer1
    ctx["layer1.key"] = "layer1_value"

# layer1 not active
assert "layer1.key" not in ctx

# manually push layer1 back on
assert "layer1_value" == ctx["layer1.key"]

# global context
# WARNING: be careful in the reserved area of the global root,
# as you can break the context tracking.
assert ctx.g is ctx.g["_.root"]
assert ctx.g is ctx.g["_.current"]

# all contexts are available from the root node
assert "layer1" in ctx.g["_.contexts"]
assert "layer1.key" in ctx.g["_.contexts.layer1"]
assert "layer1_value" == ctx.g["_.contexts.layer1.layer1.key"]

# nesting:
ctx["root_key"] = "root_value"

with ctx("layer1"):
    ctx["layer1_key"] = "layer1_value"

    with ctx("layer2"):
        ctx["layer2_key"] = "layer2_value"

        assert "root_key" in ctx
        assert "layer1_key" in ctx
        assert "layer2_key" in ctx

    # Lost layer2
    assert "root_key" in ctx
    assert "layer1_key" in ctx
    assert "layer2_key" not in ctx

# Lost layer1, layer2
assert "root_key" in ctx
assert "layer1_key" not in ctx
assert "layer2_key" not in ctx
Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting