In the __init__.py file of the ledger_df package, you can import the main functions and classes to make them easily accessible:
from .enforce_dtypes import enforce_dtypes
from .nest import nest, unnest
from .string import df_to_consistent_str
from .testing import assert_frame_equal
Inspiration from Python Open Source Projects:
pandas: Clear separation of core functionalities, utilities, and tests. Emphasis on modularity and maintainability pandas
scikit-learn: Focus on modular design, with directories for different functionalities and extensive documentation and examples scikit-learn
Flask: Organized structure for easy navigation and clear separation of app logic and tests flask
This structure maintains a focus on DataFrame operations, ensuring the ledger_df package is modular, maintainable, and user-friendly.
Additionally, we need to include all steps from milestone#2 to maintain high code quality for our package.
Readme.md file proposal:
Click to see proposed Readme.md file
# ledger_df
`ledger_df` is a Python package designed to provide shared DataFrame operations that can be used across multiple modules, promoting code reuse and consistency across multiple modules. By maintaining type consistency and utilizing a drop indexes approach similar to pandas, this package simplifies DataFrame manipulations and ensures robust testing. By centralizing shared DataFrame operations in the we ensure consistency and efficiency in our development processes, helping to maintain high-quality code across various projects.
## Key Features:
- Data type enforcement for DataFrames.
- Nesting and unnesting operations for hierarchical data.
- String manipulation functions for DataFrames.
- Validation utilities for testing DataFrame content.
## Installation
Easily install the package using pip:
```bash
pip install https://github.com/macxred/ledger_df/tarball/main
```
## Testing Strategy
Tests are housed in the [ledger_df/tests](tests) directory and are automatically executed via GitHub Actions. This ensures that the code is tested after each commit, during pull requests, and on a daily schedule. We prefer pytest for its straightforward and readable syntax over the unittest package from the standard library.
## Package Development and Contribution
See [cashctrl_api /CONTRIBUTING.md](https://github.com/macxred/cashctrl_api/blob/main/CONTRIBUTING.md) for:
- Setting Up Your Development Environment
- Type Consistency with DataFrames
- Standards and Best Practices
- Leveraging AI Tools
- Shared Learning through Open Source
Further steps:
Update proposed readme
Copy skeleton project
Implement linter, security checks, codecov
Move defined methods to this package
Create issue to use this package and replace methods to call from this package
We should create a package that will contain the
shared
code that can be used across our independent packages.Proposed package names:
modules list from the
cashctrl_api
package that should be moved:enforce_dtypes.py
module:enforce_dtypes()
Modules list from the
cashctrl_ledger
package that should be moved:ledger_utils.py
:nest()
,unnest()
nesting.py
:df_to_consistent_str()
testing.py
:assert_frame_equal()
Here is the finalized structure for the
ledger_df
package, including points on how it follows community standards:Proposed Structure for
ledger_df
Explanation
Root Directory (
ledger_df/
):setup.py
file for package configuration, following the standard practice for Python packages.__init__.py
file to mark this directory as a package.Package Directory (
ledger_df/ledger_df/
):__init__.py
file to mark this directory as a package.enforce_dtypes.py
with theenforce_dtypes()
function for data type enforcement.nest.py
with thenest()
andunnest()
functions for handling hierarchical data.string.py
with thedf_to_consistent_str()
function for string manipulation within DataFrames.testing.py
with theassert_frame_equal()
function for DataFrame validation and testing.Tests Directory (
ledger_df/tests/
):__init__.py
file to mark this directory as a package.test_enforce_dtypes.py
for testing theenforce_dtypes()
function.test_nest.py
for testing thenest()
andunnest()
functions.test_string.py
for testing thedf_to_consistent_str()
function.test_dataframe.py
for testing theassert_frame_equal()
function.Package Initialization (
ledger_df/ledger_df/__init__.py
):In the
__init__.py
file of theledger_df
package, you can import the main functions and classes to make them easily accessible:Inspiration from Python Open Source Projects:
This structure maintains a focus on DataFrame operations, ensuring the
ledger_df
package is modular, maintainable, and user-friendly.Additionally, we need to include all steps from milestone#2 to maintain high code quality for our package.
Readme.md file proposal:
Click to see proposed Readme.md file
# ledger_df `ledger_df` is a Python package designed to provide shared DataFrame operations that can be used across multiple modules, promoting code reuse and consistency across multiple modules. By maintaining type consistency and utilizing a drop indexes approach similar to pandas, this package simplifies DataFrame manipulations and ensures robust testing. By centralizing shared DataFrame operations in the we ensure consistency and efficiency in our development processes, helping to maintain high-quality code across various projects. ## Key Features: - Data type enforcement for DataFrames. - Nesting and unnesting operations for hierarchical data. - String manipulation functions for DataFrames. - Validation utilities for testing DataFrame content. ## Installation Easily install the package using pip: ```bash pip install https://github.com/macxred/ledger_df/tarball/main ``` ## Testing Strategy Tests are housed in the [ledger_df/tests](tests) directory and are automatically executed via GitHub Actions. This ensures that the code is tested after each commit, during pull requests, and on a daily schedule. We prefer pytest for its straightforward and readable syntax over the unittest package from the standard library. ## Package Development and Contribution See [cashctrl_api /CONTRIBUTING.md](https://github.com/macxred/cashctrl_api/blob/main/CONTRIBUTING.md) for: - Setting Up Your Development Environment - Type Consistency with DataFrames - Standards and Best Practices - Leveraging AI Tools - Shared Learning through Open SourceFurther steps: