Skip to main content

oculist

Statically typed, purely functional lenses for Python.

Features

Quickstart

from dataclasses import dataclass

from oculist import Lens


@dataclass(frozen=True)
def Address:
    street: Lens[str] = Lens()


@dataclass(frozen=True)
def User:
    name: Lens[str] = Lens()  # 'Lens' is a descriptor
    address: Lens[Address] = Lens()


bob = User('bob', Address("Some st."))

alice = (
    bob
    > User.name << 'alice'  # Define transformations using << and apply using >
    | User.address * Address.street << 'Other st.' # Compose transformations with | and chain lenses with *
)

assert bob.name == 'bob' and alice.name == 'alice'  # original target is left untouched

Concepts

Lenses, Attributes and Setters

Special Lenses

List

Tuple

Dict

Set

Metadata

Release files for oculist 0.0.0

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

Source distribution (sdist)

Source distribution for oculist 0.0.0
File Size Uploaded Provenance Actions
oculist-0.0.0.tar.gz 2.1 kB Without provenance Details for oculist-0.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for oculist 0.0.0
File Interpreter ABI Platform Actions
oculist-0.0.0-py3-none-any.whl Python 3 none any Details for oculist-0.0.0-py3-none-any.whl

Total release size: 4.4 kB

Release files / oculist-0.0.0.tar.gz

Download URL oculist-0.0.0.tar.gz
Size 2.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f94675a1389f9bef0c806c6d4f5ef18287d66560203e48b3cb5bb14abd14deee
BLAKE2b-256 checksum
How to use checksums
0fbcaccdaa0457ad08c1013ae1180cd4a2545e1400a9c48832f2bb3737620878
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Darwin/23.1.0

Release files / oculist-0.0.0-py3-none-any.whl

Download URL oculist-0.0.0-py3-none-any.whl
Size 2.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21abd970f8598989c824321d94b5c915158907b32f5bb0d0787b7233b4f46e08
BLAKE2b-256 checksum
How to use checksums
6a15947a879b505f0b2c5d19c65fa88cea57a035e1ce510a42dcd2f6c2bc41c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.10.12 Darwin/23.1.0

Security for oculist 0.0.0

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.

Release history Release notifications | RSS feed

This release

0.0.0 This release

2 release files No provenance

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