Skip to main content

Kalpa

Kalpa provides a starting point for resource traversal in Pyramid. It provides two classes for this, a Branch and a Leaf, which allow you to create arbitrary resource trees without the boilerplate.

There is also a Root class for added convenience that accepts a request during initialization. This can be used to create a starting point for Pyramid’s traversal.

from kalpa import Root, Node, branch

USERS = {...}


class Root(Root):
    """Root resource for Pyramid traversal."""
    users = branch('UserCollection')


class UserCollection(Node):
    """User collection, for listings, or loading single users."""
    __child_cls__ = 'User'

    def __load__(self, key):
        """Returns dict with attributes to create a child node from."""
        return {'user': USERS[key]}  # Load user or raise KeyError.


class User(Node):
    """User resource, a single loaded user."""
    gallery = branch('UserGallery', aliases=['images'])


class UserGallery(Node):
    """Gallery of images posted by a user.

    Reachable as `/users/:id/gallery` but also `/users/:id/images`.
    """

Metadata

Release files for kalpa 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kalpa 0.5.1
File Size Uploaded Provenance Actions
kalpa-0.5.1.tar.gz 10.7 kB Without provenance Details for kalpa-0.5.1.tar.gz

Release files / kalpa-0.5.1.tar.gz

Download URL kalpa-0.5.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ec637642e58aa1cd6534fc307d20a6388c193a2a2bbb41fe1cd33b862c9146aa
BLAKE2b-256 checksum
How to use checksums
2d67f494c820a2a18ce3499d8d7e3277232b76d8f1ed3d9a7c3820145390e3d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Python-urllib/3.7

Security for kalpa 0.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page