Repository: astropenguin/pandas-dataclasses

Issue:
Update package structure

Discussion:

Patch:
diff --git a/pandas_dataclasses/__init__.py b/pandas_dataclasses/__init__.py
index 20c11b0..ab4a214 100644
--- a/pandas_dataclasses/__init__.py
+++ b/pandas_dataclasses/__init__.py
@@ -1,11 +1,10 @@
-__version__ = "0.3.0"
-
+# type: ignore
+from . import core
+from .core.frame import *
+from .core.generic import *
+from .core.series import *
+from .core.typing import *
 
-# submodules
-from .core import *
-from .specs import *
-from .typing import *
 
-
-# subpackages
-from .pandas import *
+# metadata
+__version__ = "0.3.0"
diff --git a/pandas_dataclasses/core/__init__.py b/pandas_dataclasses/core/__init__.py
new file mode 100644
index 0000000..0fdfdac
--- /dev/null
+++ b/pandas_dataclasses/core/__init__.py
@@ -0,0 +1,6 @@
+# type: ignore
+from . import frame
+from . import generic
+from . import specs
+from . import series
+from . import typing
diff --git a/pandas_dataclasses/pandas/frame.py b/pandas_dataclasses/core/frame.py
similarity index 94%
rename from pandas_dataclasses/pandas/frame.py
rename to pandas_dataclasses/core/frame.py
index 390b441..39b65d5 100644
--- a/pandas_dataclasses/pandas/frame.py
+++ b/pandas_dataclasses/core/frame.py
@@ -13,8 +13,8 @@ from morecopy import copy
 
 
 # submodules
-from ..core import get_attrs, get_columns, get_data, get_factory, get_index
-from ..typing import DataClass, P, PandasClass
+from .parsers import get_attrs, get_columns, get_data, get_factory, get_index
+from .typing import DataClass, P, PandasClass
 
 
 # type hints
diff --git a/pandas_dataclasses/pandas/generic.py b/pandas_dataclasses/core/generic.py
similarity index 97%
rename from pandas_dataclasses/pandas/generic.py
rename to pandas_dataclasses/core/generic.py
index f6b6677..5572370 100644
--- a/pandas_dataclasses/pandas/generic.py
+++ b/pandas_dataclasses/core/generic.py
@@ -16,7 +16,7 @@ from typing_extensions import get_args, get_origin
 # submodules
 from .frame import asdataframe
 from .series import asseries
-from ..typing import AnyPandas, P, PandasClass
+from .typing import AnyPandas, P, PandasClass
 
 
 # type hints
diff --git a/pandas_dataclasses/core.py b/pandas_dataclasses/core/parsers.py
similarity index 100%
rename from pandas_dataclasses/core.py
rename to pandas_dataclasses/core/parsers.py
diff --git a/pandas_dataclasses/pandas/series.py b/pandas_dataclasses/core/series.py
similarity index 94%
rename from pandas_dataclasses/pandas/series.py
rename to pandas_dataclasses/core/series.py
index 1875376..9382c82 100644
--- a/pandas_dataclasses/pandas/series.py
+++ b/pandas_dataclasses/core/series.py
@@ -13,8 +13,8 @@ from morecopy import copy
 
 
 # submodules
-from ..core import get_attrs, get_data, get_factory, get_index, get_name
-from ..typing import DataClass, P, PandasClass
+from .parsers import get_attrs, get_data, get_factory, get_index, get_name
+from .typing import DataClass, P, PandasClass
 
 
 # type hints
diff --git a/pandas_dataclasses/specs.py b/pandas_dataclasses/core/specs.py
similarity index 100%
rename from pandas_dataclasses/specs.py
rename to pandas_dataclasses/core/specs.py
diff --git a/pandas_dataclasses/typing.py b/pandas_dataclasses/core/typing.py
similarity index 100%
rename from pandas_dataclasses/typing.py
rename to pandas_dataclasses/core/typing.py
diff --git a/pandas_dataclasses/pandas/__init__.py b/pandas_dataclasses/pandas/__init__.py
deleted file mode 100644
index 5080d12..0000000
--- a/pandas_dataclasses/pandas/__init__.py
+++ /dev/null
@@ -1,4 +0,0 @@
-# submodules
-from .frame import *
-from .generic import *
-from .series import *


Test patch:
diff --git a/tests/test_frame.py b/tests/test_frame.py
index 8e99dd5..04b3ca8 100644
--- a/tests/test_frame.py
+++ b/tests/test_frame.py
@@ -6,8 +6,8 @@ from typing import ClassVar
 # dependencies
 import numpy as np
 import pandas as pd
-from pandas_dataclasses.pandas.frame import AsDataFrame
-from pandas_dataclasses.typing import Attr, Data, Index
+from pandas_dataclasses.core.frame import AsDataFrame
+from pandas_dataclasses.core.typing import Attr, Data, Index
 from typing_extensions import Annotated as Ann
 
 
diff --git a/tests/test_frame_generic.py b/tests/test_frame_generic.py
index 604e47b..f8c22ac 100644
--- a/tests/test_frame_generic.py
+++ b/tests/test_frame_generic.py
@@ -5,8 +5,8 @@ from dataclasses import dataclass
 # dependencies
 import numpy as np
 import pandas as pd
-from pandas_dataclasses.pandas.generic import As
-from pandas_dataclasses.typing import Attr, Data, Index
+from pandas_dataclasses.core.generic import As
+from pandas_dataclasses.core.typing import Attr, Data, Index
 from typing_extensions import Annotated as Ann
 
 
diff --git a/tests/test_core.py b/tests/test_parsers.py
similarity index 94%
rename from tests/test_core.py
rename to tests/test_parsers.py
index 1a05fe4..a9a9d51 100644
--- a/tests/test_core.py
+++ b/tests/test_parsers.py
@@ -5,14 +5,14 @@ from dataclasses import dataclass, field
 # dependencies
 import numpy as np
 import pandas as pd
-from pandas_dataclasses.core import (
+from pandas_dataclasses.core.parsers import (
     get_attrs,
     get_data,
     get_factory,
     get_index,
     get_name,
 )
-from pandas_dataclasses.typing import Attr, Data, Index, Name
+from pandas_dataclasses.core.typing import Attr, Data, Index, Name
 from typing_extensions import Annotated as Ann
 
 
diff --git a/tests/test_series.py b/tests/test_series.py
index 564270b..13f4b72 100644
--- a/tests/test_series.py
+++ b/tests/test_series.py
@@ -6,8 +6,8 @@ from typing import ClassVar
 # dependencies
 import numpy as np
 import pandas as pd
-from pandas_dataclasses.pandas.series import AsSeries
-from pandas_dataclasses.typing import Attr, Data, Index, Name
+from pandas_dataclasses.core.series import AsSeries
+from pandas_dataclasses.core.typing import Attr, Data, Index, Name
 from typing_extensions import Annotated as Ann
 from typing_extensions import Literal as L
 
diff --git a/tests/test_series_generic.py b/tests/test_series_generic.py
index fec7946..fabcfbf 100644
--- a/tests/test_series_generic.py
+++ b/tests/test_series_generic.py
@@ -5,8 +5,8 @@ from dataclasses import dataclass
 # dependencies
 import numpy as np
 import pandas as pd
-from pandas_dataclasses.pandas.generic import As
-from pandas_dataclasses.typing import Attr, Data, Index, Name
+from pandas_dataclasses.core.generic import As
+from pandas_dataclasses.core.typing import Attr, Data, Index, Name
 from typing_extensions import Annotated as Ann
 from typing_extensions import Literal as L
 
diff --git a/tests/test_specs.py b/tests/test_specs.py
index 60d42e9..588012f 100644
--- a/tests/test_specs.py
+++ b/tests/test_specs.py
@@ -5,8 +5,8 @@ from typing import Dict
 
 # dependencies
 import numpy as np
-from pandas_dataclasses.specs import DataSpec
-from pandas_dataclasses.typing import Attr, Data, Index, Name
+from pandas_dataclasses.core.specs import DataSpec
+from pandas_dataclasses.core.typing import Attr, Data, Index, Name
 from typing_extensions import Annotated as Ann
 from typing_extensions import Literal as L
 
diff --git a/tests/test_typing.py b/tests/test_typing.py
index 1fc91ac..6a052eb 100644
--- a/tests/test_typing.py
+++ b/tests/test_typing.py
@@ -8,7 +8,7 @@ import pandas as pd
 from pytest import mark
 from typing_extensions import Annotated as Ann
 from typing_extensions import Literal as L
-from pandas_dataclasses.typing import (
+from pandas_dataclasses.core.typing import (
     Attr,
     Data,
     Index,