Repository navigation
0.1.0
The first release of the revived Pyjoyment: a new port of Mojolicious 9 to Python 3.12 and newer, with asyncio as its event loop and nothing besides the Python standard library. The toolkit and the web framework are ported from Mojolicious 9.53, with its tests, and the API keeps the names of Mojolicious, so its documentation and experience carry over.
pip install Pyjoyment
uv add Pyjoymentfrom Pyjoyment.Lite import *
get('/', {'text': 'I ♥ Pyjoyment!'})
app.start()The toolkit: Pyjo
- HTTP and WebSocket client and server:
Pyjo.UserAgentwith promises andawait, cookies, proxies, SOCKS5, TLS and redirects, andPyjo.Server.Daemon, with Server-Sent Events and IPv6. - The event loop:
Pyjo.IOLoopon theasyncioevent loop ofPyjo.Reactor.Asyncio, so its I/O and the coroutines and tasks ofasyncioshare one loop, or onPyjo.Reactor.Pollwithoutasyncio. TCP, TLS, UDP and UNIX domain sockets, child processes, the standard input and output as a stream of messages, timers, promises and asynchronous iterators. - HTML/XML parser with CSS selectors,
Pyjo.DOM. - JSON with JSON Pointers, JSON Schema from type hints or from a builder after zod, validated against JSON Schema 2020-12, JSON-RPC 2.0 servers and clients over HTTP or any stream, URI Templates of RFC 6570, and YAML and TOML, loaded and dumped.
- Templates with automatic escaping,
Pyjo.Template, and template strings, which take the t-strings of Python 3.14. - Containers for URLs, paths, query strings, headers, cookies and HTTP messages, which convert to and from their counterparts of the standard library.
- Command line options with
Pyjo.GetOpt, also from environment variables, and a logger with JSON Lines for log collectors.
The web framework: Pyjoyment
- Routes with placeholders, types, conditions and nested routes, controllers as classes, the renderer with
eptemplates, layouts, template strings and the compression of dynamic responses, sessions, the validator, static files, andPyjoyment.Litefor a whole application in a single file. - Plugins: configuration files in Python, JSON, YAML and TOML,
Mount,AllowedHostsagainst DNS rebinding, andHealthfor the probes of containers and orchestrators. - Helpers with types for type checkers and editors, and error messages that name the fix of common mistakes.
- The command line interface:
daemon,prefork,prethread,routes,get,eval,inflate, andgenerate app,lite-app,plugin,pyproject,dockerfile,kubernetesandlambda-zip.
Servers and deployment
daemon,prefork,prethreadwith workers as threads, also on the free-threaded Python,pyjo-hotfor deployment without downtime andpyjo-reloadfor development.- An application also runs as an ASGI, WSGI or CGI application, behind FastCGI, and as an event function of AWS Lambda, also streaming its responses.
- Cloud native: the servers stop gracefully on the
TERMof a container, with a delay before the stop for the readiness probe, and listen on the port ofPORT.generate dockerfilewrites the image of an application,generate kubernetesits manifests for Kustomize, andgenerate lambda-zipthe ZIP files of an event function of AWS Lambda.
Mounting other applications
Pyjoyment.Plugin.Mount serves the applications of other frameworks under a path or a host, next to the routes of Pyjoyment: WSGI applications, as those of Flask, ASGI applications, as those of Starlette and the servers of the MCP SDK, with their WebSockets and lifespan, FastCGI applications, as PHP on php-fpm, CGI programs, and event functions of AWS Lambda. An application of another framework can move to Pyjoyment one route at a time.
Tests
Pyjo.Test and Pyjo.Test.Pyjo, inspired by Test::More and Test::Mojo, write test scripts that print TAP, with subtests and chained assertions, and test an application without a server. pyjo-prove runs them in parallel, with reports in JUnit XML and Markdown, and the plugin of pytest runs them too.
Platforms
CPython 3.12 to 3.15, the free-threaded build of 3.15, and PyPy 3.12 on a best-effort basis, on Linux, macOS and Windows, where the servers that fork do not run and prethread runs the workers in threads. The packages are typed, checked with pyright in strict mode.
Documentation and coding agents
- The documentation: the API, ported from the documentation of Mojolicious, and the guides Tutorial, Growing, Routing, Rendering, Mounting, Testing, Cookbook, FAQ and Contributing, whose examples are tested.
- Skills for coding agents, a plugin of Claude Code whose
SKILL.mdfiles other agents read too:claude plugin install pyjoyment --marketplace dex4er/Pyjoyment.generate appandgenerate pluginwrite anAGENTS.mdfor the project.
Supply chain
The wheel and the sdist come with an SBOM in SPDX of the JavaScript libraries that the package bundles, and with attestations of their build provenance, which gh attestation verify checks. They are published to PyPI with trusted publishing and the attestations of PEP 740.
Full Changelog: dex4er/Pyjoyment@0.0.1...0.1.0