Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor api.py into sub-modules #189

Open
JR-1991 opened this issue May 17, 2024 · 0 comments
Open

Refactor api.py into sub-modules #189

JR-1991 opened this issue May 17, 2024 · 0 comments
Assignees
Labels
status:incoming Newly created issue to be forwarded type:feature New feature

Comments

@JR-1991
Copy link
Member

JR-1991 commented May 17, 2024

The entire API is currently implemented in api.py, which consists of almost 3k lines. This makes maintenance, extension, and gaining a general overview difficult. It would be beneficial to separate the implementation of endpoints or groups of endpoints into individual files and then reference them in NativeApi/DataAccessApi.

I suggest grouping similar endpoints into modules to improve the user experience. Currently, all endpoints are accessible through the NativeApi interface, which means one must know if a certain function is related to a dataset, collection, and so on. This results in a naming problem as we rely on encoding this information into the function name. Making the API more intuitive would involve something like the following:

native_api = NativeApi(...)

# Get the version
native_api.info.version()

# Create a dataset
native_api.datasets.create()

By utilizing this approach, collaborative work is streamlined, enabling team members to independently focus on different components without the concern of conflicting changes or merge issues.

@JR-1991 JR-1991 added type:feature New feature status:incoming Newly created issue to be forwarded labels May 17, 2024
@JR-1991 JR-1991 added this to the 0.4.0 milestone May 17, 2024
@JR-1991 JR-1991 self-assigned this May 17, 2024
@JR-1991 JR-1991 moved this from QA to Todo in PyDataverse Working Group Jul 3, 2024
@JR-1991 JR-1991 removed this from the 0.4.0 milestone Jul 3, 2024
This was referenced Jul 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:incoming Newly created issue to be forwarded type:feature New feature
Projects
Development

No branches or pull requests

1 participant