Skip to content

0.1.0

Choose a tag to compare

@github-actions github-actions released this 01 Nov 15:15
· 122 commits to main since this release
5b5b954

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 Pyjoyment
from Pyjoyment.Lite import *

get('/', {'text': 'I ♥ Pyjoyment!'})

app.start()

The toolkit: Pyjo

  • HTTP and WebSocket client and server: Pyjo.UserAgent with promises and await, cookies, proxies, SOCKS5, TLS and redirects, and Pyjo.Server.Daemon, with Server-Sent Events and IPv6.
  • The event loop: Pyjo.IOLoop on the asyncio event loop of Pyjo.Reactor.Asyncio, so its I/O and the coroutines and tasks of asyncio share one loop, or on Pyjo.Reactor.Poll without asyncio. 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 ep templates, layouts, template strings and the compression of dynamic responses, sessions, the validator, static files, and Pyjoyment.Lite for a whole application in a single file.
  • Plugins: configuration files in Python, JSON, YAML and TOML, Mount, AllowedHosts against DNS rebinding, and Health for 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, and generate app, lite-app, plugin, pyproject, dockerfile, kubernetes and lambda-zip.

Servers and deployment

  • daemon, prefork, prethread with workers as threads, also on the free-threaded Python, pyjo-hot for deployment without downtime and pyjo-reload for 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 TERM of a container, with a delay before the stop for the readiness probe, and listen on the port of PORT. generate dockerfile writes the image of an application, generate kubernetes its manifests for Kustomize, and generate lambda-zip the 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.md files other agents read too: claude plugin install pyjoyment --marketplace dex4er/Pyjoyment. generate app and generate plugin write an AGENTS.md for 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