Repository navigation
0.2.0
Pyjoyment 0.2.0 brings INI files, lazy iterators, SHA-2 and Base64 for URLs to the toolkit. It also makes the ZIP files of AWS Lambda reproducible and much smaller with the public layers, and fixes buffers and queues that slowed down with the square of their size.
pip install -U Pyjoyment
uv add 'Pyjoyment>=0.2.0'New
-
INI files.
Pyjo.INIloads and dumps the INI files that well-known programs read and write, as~/.aws/configand~/.aws/credentials,php.iniandphp-fpm.conf. It handles:- sections and keys that keep their case;
- the nested settings of AWS, which load as a dict;
- a key that comes again, which loads as a list;
- quotes, kept by default or taken off with
unquote; - comments, kept with
comments=True, so that a file dumps back as it was.
~/.aws/configloads the same as botocore reads it.Pyjoyment.Plugin.INIConfigreads the configuration of an application from$moniker.ini, and its sections[plugin Name]load the deployment specific plugins. (#491) -
Lazy iterators.
Pyjo.Iteratoriterates an iterable or an asynchronous iterable, withforandasync foralike.- Its chain of
map,grep,uniq,flatten,compactandheadpasses each element on as soon as it has it. map(cb, concurrency=N)takes callbacks that return promises or are coroutines.- Its final methods block, and their forms with
_preturn promises.
Streams, messages, datagrams and the events of
Pyjo.EventEmitteriterate with it.dom.iterate(css)ofPyjo.DOMfinds the matches one by one, sofirststops the search.i()makes an iterator in the one-liners ofpython -m Pyjo. (#468, #469, #470) - Its chain of
-
SHA-2 and Base64 for URLs.
Pyjo.Utilhassha256_bytes,sha256_sum,sha512_bytes,sha512_sum,hmac_sha256_sumandhmac_sha512_sumbeside those of SHA-1, andb64url_encodeandb64url_decodeof RFC 4648 for tokens, signatures and ids in URLs.Pyjo.String.BytesandPyjo.String.Unicodehave all of them as methods that chain. (#477, #478) -
Plain log messages.
--log-format plain,PYJO_LOG_FORMAT=plainor the attributeplainofPyjo.Logwrites a message with its level only, as[info] Hello. This suits a CI log, which adds its own time to each line. (#480) -
Reruns of subtests.
subtest(name, reruns=2, reruns_delay=10)ofPyjo.Testruns a subtest again after a failure. Use it for a test of a remote host when the network fails. Only the last run counts, and the runs before it become diagnostic messages. (#494)
AWS Lambda
- Public layers.
generate lambda-zip --function-onlywritesfunction.zipalone, for the public layers of Python and Pyjoyment that Pyjoyment-Lambda-Layers publishes in the commercial regions of AWS. It reports the layer of Pyjoyment that the function needs. The cookbook explains where to find the ARNs of the layers. The OpenTofu exampleslambda_zip,lambdaandlambda_streamtake the public layers by default. (#487) - Reproducible builds. The bytecode of the ZIP files is the same on every machine and with any number of CPUs, on the free-threaded Python too. (#485, #486)
- Any machine. The generator installs the Python of the target version with uv before it installs the dependencies, so it also works on a machine that does not have that Python. (#473)
Fixes and speed
- Buffers and queues.
Pyjo.File.slurp,Pyjo.Asset.File.slurp,Pyjo.Asset.Memory, the bodies of HTTP messages and the request bodies of the ASGI and WSGI servers grow as abytearray. Before, they took time in the square of their size:slurpof 50 MB took 1 s, and now takes 8 ms.findofPyjo.DOMon a large document is 4 times faster, andall_text14 times. (#475, #476) - Command output. The messages of the commands are flushed at once, so their progress shows as it happens in a pipe, as the log of CI. (#479)
Pyjo.GetOpt. An option whose target is not a list, a dict or a callback fails when it is added, withInvalid option linkage, as in Getopt::Long. Before, it failed only when the option was given. (#482)
The project
- The repository is now pyjoyment/Pyjoyment. The plugin of Claude Code installs with
claude plugin install pyjoyment --marketplace pyjoyment/Pyjoyment. (#464) - The skills for coding agents now cover the log of the application in the place of
print, the commands of an application, the iterators, a signature in the eventstartof the user agent, and the functions ofPyjo.Utilin the place ofhashlib,hmacandbase64. (#477, #478, #479, #482)
Supply chain
The wheel and the sdist come with an SBOM in SPDX and with attestations of their build provenance:
gh attestation verify pyjoyment-0.2.0.tar.gz -R pyjoyment/PyjoymentFull Changelog: 0.1.0...0.2.0