Metadata-Version: 2.4
Name: DeltaAgent
Version: 0.0.10
Summary: A library used to fetch data from deltalake tables locally.
Author-email: Cody Xiaozhan Yang <x.yang@cloudfmgroup.com>
License: MIT License
        
        Copyright (c) 2025 Cody Xiaozhan Yang
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Keywords: deltalake,python,local,parquet
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: tqdm
Requires-Dist: pandas
Requires-Dist: adlfs
Requires-Dist: Office365-REST-Python-Client

# DeltaAgent - Deltalake Agent

This library can used to fetch data from deltalake tables without the dependency on Spark clusters. It is developed based on the `pandas`, `adlfs` and `Office365-REST-Python-Client` libraries.

## Use cases and benefits

To use the library, firstly we need to install the it by

```
pip install DeltaAgent
```

It requires the datalake `account_name` and `account_key` for setting up the connection to a Gen2 Azure blob storage account.

```
from DeltaAgent import DeltaAgent

da = DeltaAgent(account_name="account_name", account_key="account_key")
```

With the established connection agent, we can then parse the paths of valid parquet files and their corresponding partition information, by the method `parse_log_as_df`. The result is returned in the format of pandas DataFrame, with an additonal method `fetch_data`. At this stage we can perform inspections and the normal DataFrame `loc` method for efficient filtering operations.

```
df_log = da.parse_log_as_df(container_name='container_name', table_path='deltatable_name')

df_log_filtered = df_log.loc[df_log.partition=='partition_value']
```

By calling the `fetch_data` method on the above delta log DataFrame, we can fetch the actual data from a deltalake table.

```
df_delta = df_log_filtered.fetch_data()
```

Note that the values for `container_name` and `delta_table` can be also assigned when setting up the agent connection, as below:

```
da = DeltaAgent(account_name="account_name", account_key="account_key", container_name='container_name', table_path='deltatable_name')
```
