Stream: python

Topic: Refactoring the `api.py` module


view this post on Zulip Jan Range (May 17 2024 at 10:30):

All endpoints are currently implemented in api.py, and if we want to extend this in the future, this file simply becomes too large. I have just opened an issue and proposed a refactoring idea.

https://github.com/gdcc/pyDataverse/issues/189

view this post on Zulip Jan Range (May 17 2024 at 10:30):

What are your thoughts?

view this post on Zulip Philip Durbin 🚀 (May 17 2024 at 11:16):

Yes, sounds good to split up the file.

I'm reminded of how the native API docs themselves are so long. I'd like to split them up too, I think, into datasets, collections, etc. Like GitHub's API docs. But docs are a separate topic.

What about our thoughts on using OpenAPI to programmatically generate code? Won't some kind of reorg happen naturally then? Or would it all go in one file?

view this post on Zulip Jan Range (May 17 2024 at 11:40):

Yes, Codegen will split files up as proposed in the issue and solve this automatically. I saw @Juan Pablo Tosca Villanueva pushed a commit to the PR a couple of days ago. If it is ready soon, we could leave this to the code generation.

view this post on Zulip Jan Range (May 17 2024 at 11:41):

Plus it would support the docs with Readme.io :grinning_face_with_smiling_eyes:

view this post on Zulip Juan Pablo Tosca Villanueva (May 17 2024 at 12:34):

:flushed: I think the commit I did was on the website page :rolling_on_the_floor_laughing::joy::sweat_smile:

view this post on Zulip Juan Pablo Tosca Villanueva (May 17 2024 at 12:34):

Py.gdcc

view this post on Zulip Juan Pablo Tosca Villanueva (May 17 2024 at 13:12):

https://github.com/gdcc/py.gdcc.io/pull/1

view this post on Zulip Jan Range (May 17 2024 at 13:44):

Thanks! Just merged it


Last updated: Nov 01 2025 at 14:11 UTC