{"id":19253420,"url":"https://github.com/stevearc/pyramid_duh","last_synced_at":"2025-07-06T15:07:22.458Z","repository":{"id":12831006,"uuid":"15506377","full_name":"stevearc/pyramid_duh","owner":"stevearc","description":"Utilities that you'll want for nearly every pyramid app","archived":false,"fork":false,"pushed_at":"2014-05-09T05:06:34.000Z","size":392,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-02T05:40:39.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevearc.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-12-29T09:33:57.000Z","updated_at":"2021-04-21T20:38:11.000Z","dependencies_parsed_at":"2022-08-30T12:02:12.784Z","dependency_job_id":null,"html_url":"https://github.com/stevearc/pyramid_duh","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/stevearc/pyramid_duh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fpyramid_duh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fpyramid_duh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fpyramid_duh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fpyramid_duh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevearc","download_url":"https://codeload.github.com/stevearc/pyramid_duh/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevearc%2Fpyramid_duh/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263922513,"owners_count":23530338,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T18:30:47.199Z","updated_at":"2025-07-06T15:07:22.441Z","avatar_url":"https://github.com/stevearc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Pyramid Duh\n===========\n:Master Build: |build|_ |coverage|_\n:0.1 Build: |build-0.1|_ |coverage-0.1|_\n:Documentation: http://pyramid_duh.readthedocs.org/\n:Downloads: http://pypi.python.org/pypi/pyramid_duh\n:Source: https://github.com/stevearc/pyramid_duh\n\n.. |build| image:: https://travis-ci.org/stevearc/pyramid_duh.png?branch=master\n.. _build: https://travis-ci.org/stevearc/pyramid_duh\n.. |coverage| image:: https://coveralls.io/repos/stevearc/pyramid_duh/badge.png?branch=master\n.. _coverage: https://coveralls.io/r/stevearc/pyramid_duh?branch=master\n\n.. |build-0.1| image:: https://travis-ci.org/stevearc/pyramid_duh.png?branch=0.1\n.. _build-0.1: https://travis-ci.org/stevearc/pyramid_duh\n.. |coverage-0.1| image:: https://coveralls.io/repos/stevearc/pyramid_duh/badge.png?branch=0.1\n.. _coverage-0.1: https://coveralls.io/r/stevearc/pyramid_duh?branch=0.1\n\nThis is just a collection of utilities that I found myself putting into *every\nsingle* pyramid project I made. So now they're all in one place.\n\nHere's a quick taste.\n\nDon't do this::\n\n    def register_user(request):\n        username = request.POST['username']\n        password = request.POST['password']\n        birthdate = request.POST['birthdate']\n\nDo this::\n\n    @argify(birthdate=date)\n    def register_user(request, username, password, birthdate):\n        ...\n\nWhat urls does this match?\n\n::\n\n    @view_config(context=Root, name='package')\n    def get_or_list_packages(request):\n        ...\n\nWell, it matches\n\n* ``/package``\n* ``/package/``\n* ``/package/1234``\n* ``/package/wait/hold/on``\n* ``/package/this/seems/confusing``\n\nWhaaaat? Let's fix that::\n\n    @view_config(context=Root, name='package', subpath=())\n    def list_packages(request):\n        # return a list of packages\n\n    @view_config(context=Root, name='package', subpath=('id/*')\n    def get_package(request):\n        package_id = request.named_subpaths['id']\n        # fetch a single package\n\nThe first one matches\n\n* ``/package``\n* ``/package/``\n\nThe second matches\n\n* ``/package/*``\n* ``/package/*/``\n\nBut that still seems sloppy. You *demand* consistency!\n\n::\n\n    @view_config(context=Root, name='package', subpath=())\n    @addslash\n    def list_packages(request):\n        # return a list of packages\n\n    @view_config(context=Root, name='package', subpath=('id/*')\n    @addslash\n    def get_package(request):\n        package_id = request.named_subpaths['id']\n        # fetch a single package\n\nNow it's just ``/package/`` and ``/package/*/``\n\nThat's the sales pitch. Read the docs for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fpyramid_duh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevearc%2Fpyramid_duh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevearc%2Fpyramid_duh/lists"}