gdcc / pyDataverse

Python module for Dataverse Software (dataverse.org).
http://pydataverse.readthedocs.io/
MIT License
64 stars 45 forks source link

Re-factor models module #102

Open skasberger opened 3 years ago

skasberger commented 3 years ago

Re-factor the models module.

Goals are:

Requirements

ACTIONS

0. Pre-Requisites

1. Research

Design

Schema

Tools

Architecture

2. Plan

Prioritize

3. Implement

visualize data flow / Architecture

draw all functions, paths etc.

models.py

class Dataverse():
  .__created_at
  .json
  .validate
  .json()
  .metadata()
  .metadata
  .__get_dataverse_download_json()
  .__validate()

class Dataset():
  .__created_at
  .json
  .validate
  .json()
  .mdb()
  .mdbs
  .__get_dataverse_download_json()
  .__validate()

class Datafile():
  .__created_at
  .json
  .validate
  .json()
  .metadata()
  .metadata
  .dataframe
  .__get_dataverse_download_json()
  .__validate()

class BaseMetaDataBlock(ABC):
  self.__mdb_type = "custom" # options: `citation`, `journal` etc and `custom`
  self.__mdb_version = "4.18.1" # options: for Dataverse mdb types = Dataverse Version in semantic string, for custom a custom versioning in semantic versioning string.
  self.__mdb_date_created = datetime.now() # options: for Dataverse mdb types = Dataverse Version in semantic string, for custom a custom versioning in semantic versioning string.

class MetaDataBlock(BaseMetaDataBlock():
  .__created_at
  .__name

class MetaDataBlockEntry():
  .__created_at
  .__value
  .__multiple
  .__type_class
  .__class

class Roles();
  .__created_at

class Group():
  .__created_at

class User():
  .__created_at

4. Follow Ups

JR-1991 commented 1 year ago

Just discovered this issue and the idea seems to align very well to what has been done with EasyDataverse already. The library also utilizes PyDantic and generates objects according to the metadatablock schemes found at api/metadatablocks/blockname.

Wouldnt it make sense to merge the functionality into PyDataverse? In my opinion having a single Python library makes more sense since both are heading in the same direction. What do you think @skasberger @pdurbin @poikilotherm?

pdurbin commented 1 year ago

I think a single library would be easier for the community, sure.

skasberger commented 1 year ago

Agree on that, especially as pyDataverse is very lightweight and is made to build upon other, more specialized services/functions.

pdurbin commented 7 months ago

As discussed during the 2024-02-14 meeting of the pyDataverse working group, we are closing old milestones in favor of a new project board at https://github.com/orgs/gdcc/projects/1 and removing issues (like this one) from those old milestones. Please feel free to join the working group! You can find us at https://py.gdcc.io and https://dataverse.zulipchat.com/#narrow/stream/377090-python