Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

bazaar-contrib-server

The Bazaar Compute server itself. The server entry draws the shell around every module — the sidebar, the overview and the settings page — and offers SERVER, where modules register their pages, API and permission points, and THEME, where theme contribs register the looks the pages can wear. The server-theme-night and server-theme-day entries are the theme plugins it comes with: the night market and the morning market.

[[contribs]]
package = "bazaar-contrib-server~=0.3.0rc1"
[[contribs.enabled]]
entry = "server"
[[contribs.enabled]]
entry = "server-theme-night"
[[contribs.enabled]]
entry = "server-theme-day"

A module registers what it serves inside its lifespan; each registration holds while its context is open:

import asyncio
from contextlib import asynccontextmanager

from bazaar_contrib_server import SERVER, PermissionItem, SidebarItem
from bazaar_core import Context, Contrib
from importlib.resources import files
from pathlib import Path
from starlette.routing import Route


@asynccontextmanager
async def lifespan(ctx: Context):
    server = ctx.accept(SERVER)
    pages = await server.pages("notes", __package__)

    async def home(request):
        return await pages.render(request, "notes.html")

    resources = Path(str(files(__package__))) / "resources"
    icon = await asyncio.to_thread((resources / "notes.svg").read_text)
    async with (
        server.module(
            "notes",
            ui=pages.application([Route("/", home)]),
            static=resources / "static",
            locales=resources / "locales",
        ),
        server.permission(
            PermissionItem(point="notes.view", description="notes.view.description")
        ),
        server.sidebar(
            SidebarItem(
                text="notes.title",
                icon=icon,
                path="/notes",
                permission="notes.view",
            )
        ),
    ):
        yield


notes = Contrib(accepts=[SERVER], lifespan=lifespan)

The icon is an SVG drawn as the design's are, with class i and a 24×24 view box. The module's interface is served at /ui/notes inside the shell at /notes, its API at /api/notes and its files at /static/notes. Its templates live in resources/templates of its package and extend server/base.html, which brings the theme stylesheet and the embedding script; pages of any other framework include /static/server/theme.css and /static/server/embed.js themselves. Everything behind the shell needs a login module, which registers itself with server.login; until one does, those pages and APIs answer 503.

Below 960 pixels the shell becomes one column with the sidebar as a bar along the bottom. Pages in its frames lay out as the shell does, not by their frame's width: embed.js marks their root data-layout="narrow" or "wide", and their narrow-screen rules select on that. A page one level below another sets data-back on its root element to the address of the level above, through the root block of server/base.html or on its own <html>; there the shell's top bar shows a way back.

Metadata

Release files for bazaar-contrib-server 0.3.0rc2

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

Source distribution (sdist)

Source distribution for bazaar-contrib-server 0.3.0rc2
File Size Uploaded Provenance Actions
bazaar_contrib_server-0.3.0rc2.tar.gz 475.6 kB Without provenance Details for bazaar_contrib_server-0.3.0rc2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bazaar-contrib-server 0.3.0rc2
File Interpreter ABI Platform Actions
bazaar_contrib_server-0.3.0rc2-py3-none-any.whl Python 3 none any Details for bazaar_contrib_server-0.3.0rc2-py3-none-any.whl

Total release size: 961.9 kB

Release files / bazaar_contrib_server-0.3.0rc2.tar.gz

Download URL bazaar_contrib_server-0.3.0rc2.tar.gz
Size 475.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d4a4d70a5dca33db5e9ef9e95e03b67c5c23a6e249199bfb1b3f970d56f5c115
BLAKE2b-256 checksum
How to use checksums
dabc1d73457b32c9706fa56fb45f400f1f824db77d541482418fcf88935ed728
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / bazaar_contrib_server-0.3.0rc2-py3-none-any.whl

Download URL bazaar_contrib_server-0.3.0rc2-py3-none-any.whl
Size 486.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0575c508061515a32c0b1aa6fccee131c6efc67ab463a476bb4edb78cfef46f2
BLAKE2b-256 checksum
How to use checksums
ef29342f2f31ebe76df91c2432d07728f69a640b405b10d360f1321fd5a77c13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for bazaar-contrib-server 0.3.0rc2

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