Skip to main content

data-harvest-reader

Features

  1. Reading Various File Formats: Suporta leitura de arquivos CSV, JSON, Parquet e Excel.

  2. Directory and ZIP File Handling: Capacidade de ler dados de diretórios e arquivos ZIP, além de bytes e objetos zipfile.ZipFile.

  3. Data Joining: União de DataFrames que possuem colunas semelhantes.

  4. Deduplication: Remoção de duplicatas com base em colunas específicas.

  5. Custom Filters: Aplicação de filtros personalizados aos DataFrames.

  6. Logging: Registro detalhado das operações de leitura e manipulação de dados.

Installation Requirements

pip install polars loguru

Usage

Initialization

from data_harvest_reader import DataReader



data_reader = DataReader(log_to_file=True, log_file="data_reader.log")

Reading Data

From Directory

data = data_reader.read_data('path/to/directory', join_similar=True)

From ZIP File

data = data_reader.read_data('path/to/zipfile.zip', join_similar=False)

From Bytes

with open('path/to/zipfile.zip', 'rb') as f:

    zip_bytes = f.read()

data = data_reader.read_data(zip_bytes, join_similar=False)

From `zipfile.ZipFile` Object

with zipfile.ZipFile('path/to/zipfile.zip', 'r') as zip_file:

    data = data_reader.read_data(zip_file, join_similar=False)

Applying Deduplication

duplicated_subset_dict = {'file1': ['column1', 'column2']}

data = data_reader.read_data('path/to/source', duplicated_subset_dict=duplicated_subset_dict)

Applying Filters

filter_subset = {

    'file1': [{'column': 'Col1', 'operation': '>', 'values': 100},

              {'column': 'Col2', 'operation': '==', 'values': 'Value'}]

}



data = data_reader.read_data('path/to/source', filter_subset=filter_subset)

Handling Exceptions

try:

    data = data_reader.read_data('path/to/source')

except UnsupportedFormatError:

    print("Unsupported file format provided")

except FilterConfigurationError:

    print("Error in filter configuration")

Example

data_reader = DataReader()



data = data_reader.read_data(r'C:\path	o\data', join_similar=True,

                             filter_subset={'example_file': [{'column': 'Age', 'operation': '>', 'values': 30}]})

Contributing to DataReader

Getting Started

  1. Fork the Repository: Start by forking the main repository. This creates your own copy of the project where you can make changes.

  2. Clone the Forked Repository: Clone your fork to your local machine. This step allows you to work on the codebase directly.

  3. Set Up the Development Environment: Ensure you have all necessary dependencies installed. It's recommended to use a virtual environment.

  4. Create a New Branch: Always create a new branch for your changes. This keeps the main branch stable and makes reviewing changes easier.

Making Contributions

  1. Make Your Changes: Implement your feature, fix a bug, or make your proposed changes. Ensure your code adheres to the project's coding standards and guidelines.

  2. Test Your Changes: Before submitting, test your changes thoroughly. Write unit tests if applicable, and ensure all existing tests pass.

  3. Document Your Changes: Update the documentation to reflect your changes. If you're adding a new feature, include usage examples.

  4. Commit Your Changes: Make concise and clear commit messages, describing what each commit does.

  5. Push to Your Fork: Push your changes to your fork on GitHub.

  6. Create a Pull Request (PR): Go to the original `DataReader` repository and create a pull request from your fork. Ensure you describe your changes in detail and link any relevant issues.

Review Process

After submitting your PR, the maintainers will review your changes. Be responsive to feedback:

  1. Respond to Comments: If the reviewers ask for changes, make them promptly. Discuss any suggestions or concerns.

  2. Update Your PR: If needed, update your PR based on feedback. This may involve adding more tests or tweaking your approach.

Final Steps

Once your PR is approved:

  1. Merge: The maintainers will merge your changes into the main codebase.

  2. Stay Engaged: Continue to stay involved in the project. Look out for feedback from users on your new feature or fix.

Conclusion

Contributing to `DataReader` is a rewarding experience that benefits the entire user community. Your contributions help make `DataReader` a more robust and versatile tool. We welcome developers of all skill levels and appreciate every form of contribution, from code to documentation. Thank you for considering contributing to `DataReader`!

Release files for data-harvest-reader 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for data-harvest-reader 0.0.11
File Size Uploaded
data_harvest_reader-0.0.11.tar.gz 6.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for data-harvest-reader 0.0.11
File Interpreter ABI Platform
data_harvest_reader-0.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 14.0 kB

Release files / data_harvest_reader-0.0.11.tar.gz

Download URL data_harvest_reader-0.0.11.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2abccf9ff54d85e00b4dd45bbaadd24b5ed42e2be25218a368a7baea95aa5f5e
BLAKE2b-256 checksum
How to use checksums
d37cd3d1e93f6be02107033e056fa2233a5cdaee094bddc39d3e18c7fcf6f77e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Release files / data_harvest_reader-0.0.11-py3-none-any.whl

Download URL data_harvest_reader-0.0.11-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
caf229956b11be051d44bcfb26fe447cbfde74a7ccd93214d74550a55450aa1c
BLAKE2b-256 checksum
How to use checksums
50a4927dd4ad6b8f6bdfbb9891956af05e848a2e2cd2e449414f0d40e44bf433
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.0

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page