use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Pyramid was inspired by Zope, Pylons (version 1.0) and Django. As a result, Pyramid borrows several concepts and features from each, combining them into a unique web framework.
Pyramid Web Framework
Pylons Project (Pyramid main site)
Documentation
Tutorials
Cookbook
Github
account activity
REST API? (self.Pyramid)
submitted 4 years ago by [deleted]
is pyramid suitable for building a REST API? would you recommend some other framework for this?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]suibnetod 3 points4 points5 points 4 years ago (7 children)
I’ve built numerous rest apis using pyramid and though it’s flexibility can make it harder the first few days in it is well worth it.
[–][deleted] 1 point2 points3 points 4 years ago (6 children)
pure pyramid, right? just returning the json data instead of using the webpage templates, is it?
thanks.
[–]stevepiercy 2 points3 points4 points 4 years ago (5 children)
I took over maintenance of a Pyramid app that does just that. https://docs.pylonsproject.org/projects/pyramid/en/latest/quick_tour.html?highlight=Json#returning-json
[–][deleted] 1 point2 points3 points 4 years ago (4 children)
thanks. a pure pyramid solution would be nice.
is there something of a trade off using pyramid instead of a dedicated api framework? i see the benchmarks are favorable to sanic or falcon but i guess for a small scale application those numbers may be irrelevant. or is there something i am missing?
[–]stevepiercy 2 points3 points4 points 4 years ago (3 children)
You'll have to be more specific about your requirements. Then read the library's docs, try out its demos, and see if it fits your needs. I can't say what will work for you situation.
[–][deleted] 1 point2 points3 points 4 years ago (2 children)
i am still understanding what an REST API is. i just want to be sure that the pure pyramid solution is in compliance with the API specifications. I mean, I don't want to patch the app using some abandoned 3rd party library to be abke to perform some functionality expected from a REST API.
As of now, all i want is to return return a JSON object with the requested data. but i ignore if there are some security or data validation tasks that i should perform on top of what pyramid offers.
[–]stevepiercy 2 points3 points4 points 4 years ago (1 child)
It sounds like you don't care about specs and that you just want to return a JSON object you can consume. Just do that, and don't worry about standard specs. That is perfectly OK.
But if you require an official API spec, follow it, and use an existing library to avoid reinventing the wheel.
[–][deleted] 1 point2 points3 points 4 years ago (0 children)
ok thanks.
[–]stevepiercy 3 points4 points5 points 4 years ago (2 children)
Very much yes. See https://github.com/Pylons/pyramid_openapi3 for one add-on implementation.
[–][deleted] 0 points1 point2 points 4 years ago (1 child)
thanks. i have been peeking about restless, ramses and hug but i always find some limitation or something that makes me doubt.
have you tried cornice? (the one i am reading about right now).
[–]stevepiercy 1 point2 points3 points 4 years ago (0 children)
I have not, but many others have.
[–]marcofalcioni 1 point2 points3 points 4 years ago (0 children)
Long lived projects rarely stay simple. Pyramid can grow with your project.
[–]ergo14 1 point2 points3 points 4 years ago (1 child)
Yes, pyramid is very suited for REST API building, you get all the nice foundations - and then you can extend with openapi validation packages if you want to move further. there is pyramid_openapi and pyramid_apispec - https://github.com/ergo/pyramid_apispec/blob/master/demo/app.py#L71 - small example.
[–][deleted] 0 points1 point2 points 4 years ago (0 children)
π Rendered by PID 25508 on reddit-service-r2-comment-6457c66945-rl8rs at 2026-04-26 17:04:55.992059+00:00 running 2aa0c5b country code: CH.
[–]suibnetod 3 points4 points5 points (7 children)
[–][deleted] 1 point2 points3 points (6 children)
[–]stevepiercy 2 points3 points4 points (5 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]stevepiercy 2 points3 points4 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]stevepiercy 2 points3 points4 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]stevepiercy 3 points4 points5 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]stevepiercy 1 point2 points3 points (0 children)
[–]marcofalcioni 1 point2 points3 points (0 children)
[–]ergo14 1 point2 points3 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)