Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

pyramid_route_7 - 0.5.1 released

9 views
Skip to first unread message

Jonathan Vanasco

unread,
Feb 18, 2025, 7:15:28 PMFeb 18
to pylons-discuss
I've just released v0.5.1 of pyramid_route_7. it is compatible with 3.6-3.13

pyramid_route_7 offers a microtemplating language for creating more maintainable routes in pyramid:  

For example, kv patterns can be created, such as these for matching date components:

    config.include("pyramid_route_7")
    config.add_route_7_kvpattern("year", r"\d\d\d\d")
    config.add_route_7_kvpattern("month", r"\d\d")
    config.add_route_7_kvpattern("day", r"\d\d")

Which can then be reused across multiple routes with a readable syntax:

    config.add_route_7("calendar", "/calendar/{@year}/{@month}/{@day}")

This is equivalent to invoking:

    config.add_route("calendar", r"/calendar/{year:\d\d\d\d}/{month:\d\d}/{day:\d\d}")

A jsonify parameter will also create a secondary json route:

    config.add_route_7("calendar", "/calendar/{@year}/{@month}/{@day}", jsonify=True)

Which is equivalent to invoking:

    config.add_route("calendar", r"/calendar/{year:\d\d\d\d}/{month:\d\d}/{day:\d\d}")
    config.add_route("calendar|json", r"/calendar/{year:\d\d\d\d}/{month:\d\d}/{day:\d\d}.json")

Links:

Github
    https://github.com/jvanasco/pyramid_route_7

PyPi
    https://pypi.org/project/pyramid-route-7/
Reply all
Reply to author
Forward
0 new messages