Skip to content

Latest commit

 

History

History
92 lines (61 loc) · 2.25 KB

File metadata and controls

92 lines (61 loc) · 2.25 KB

Python

Pydantic

https://pydantic-xml.readthedocs.io/en/latest/

pydantic-xml extension

Microsoft tooling

Microsoft Graph API

AWS

Lambda

General Tooling

Ruff - Rust-based Python Linter

pyproject.toml

GUIs

UV Notes

uv add --script wordlookup.py httpx

# Use the following shebang to run the script
#!/usr/bin/env -S uv run --quiet

Tips

  • Merging multiple decorators - https://stackoverflow.com/a/5409569/886938 and https://adamj.eu/tech/2020/04/01/how-to-combine-two-python-decorators/

    # Example from StackOverflow link
    def composed(*decs):
        def deco(f):
            for dec in reversed(decs):
                f = dec(f)
            return f
        return deco
    
    # Then
    
    @composed(dec1, dec2)
    def some(f):
        pass
    
    # is equivalent to
    
    @dec1
    @dec2
    def some(f):
        pass
    
    ###############################################################
    # Example from Adam Johnson link
    @require(methods=["GET", "POST"], login=False)
    def blog(request):
    
    def require(methods=("GET", "POST"), login=True):
        def decorator(func):
            wrapped = func
            if methods is not None:
                wrapped = require_http_methods(methods)(func)
            if login:
                wrapped = login_required(func)
            return wrapped
    
        return decorator

Modules

Data Related