ParquetDB
ParquetDB: A Lightweight Python Parquet-Based Database - Published in JOSS (2025)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 1 DOI reference(s) in JOSS metadata -
✓Academic publication links
Links to: arxiv.org -
○Academic email domains
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
Basic Info
- Host: GitHub
- Owner: lllangWV
- License: mit
- Language: Python
- Default Branch: main
- Size: 27.7 MB
Statistics
- Stars: 17
- Watchers: 1
- Forks: 2
- Open Issues: 0
- Releases: 54
Metadata Files
README.md
ParquetDB
Documentation | PyPI | GitHub
ParquetDB is a Python library designed to bridge the gap between traditional file storage and fully fledged databases, all while wrapping the powerful PyArrow library to streamline data input and output. By leveraging the Parquet file format, ParquetDB provides the portability and simplicity of file-based data storage alongside advanced querying features typically found in database systems.
Table of Contents
Documentation
Check out the docs
Features
- Simple Interface: Easy-to-use methods for creating, reading, updating, and deleting data.
- Minimal Overhead: Achieve quick read/write speeds without the complexity of setting up or managing a larger database system.
- Batching: Efficiently handle large datasets by batching operations.
- Supports Complex Data Types: Handles nested and complex data types.
- Schema Evolution: Supports adding new fields and updating schemas seamlessly.
- Supports storing of python objects: ParquetDB can store python objects (objects and functions) using pickle.
- Supports np.ndarrays: ParquetDB can store ndarrays.
Installation
Install ParquetDB using pip:
bash
pip install parquetdb
Usage
Creating a Database
Initialize a ParquetDB instance by specifying the path the name of the dataset
```python from parquetdb import ParquetDB
db = ParquetDB(db_path='parquetdb') ```
Adding Data
Add data to the database using the create method. Data can be a dictionary, a list of dictionaries, or a Pandas DataFrame.
```python data = [ {'name': 'Charlie', 'age': 28, 'occupation': 'Designer'}, {'name': 'Diana', 'age': 32, 'occupation': 'Product Manager'} ]
db.create(data) ```
Normalizing
Normalization is a crucial process for ensuring the optimal performance and efficient management of data. In the context of file-based databases, like the ones used in ParquetDB, normalization helps balance the distribution of data across multiple files. Without proper normalization, files can end up with uneven row counts, leading to performance bottlenecks during operations like queries, inserts, updates, or deletions.
This method does not return anything but modifies the dataset directory in place, ensuring a more consistent and efficient structure for future operations.
```python from parquetdb import NormalizeConfig
db.normalize( normalizeconfig=NormalizeConfig( loadformat='batches', # Uses the batch generator to normalize batchreadahead=10, # Controls the number of batches to load in memory a head of time. fragmentreadahead=2, # Controls the number of files to load in memory ahead of time. batchsize = 100000, # Controls the batchsize when to use when normalizing. This will have impacts on amount of RAM consumed maxrowsperfile=500000, # Controls the max number of rows per parquet file maxrowsper_group=500000) # Controls the max number of rows per group parquet file ) ```
Reading Data
Read data from the database using the read method. You can filter data by IDs, specify columns, and apply filters.
```python
Read all data
all_employees = db.read()
Read specific columns
names = db.read(columns=['name'])
Read data with filters
from pyarrow import compute as pc
agefilter = pc.field('age') > 30 olderemployees = db.read(filters=[age_filter]) ```
Updating Data
Update existing records in the database using the update method. Each record must include the id field.
```python update_data = [ {'id': 1, 'occupation': 'Senior Engineer'}, {'id': 3, 'age': 29} ]
db.update(update_data) ```
Deleting Data
Delete records from the database by specifying their IDs.
python
db.delete(ids=[2, 4])
Citing ParquetDB
If you use ParquetDB in your work, please cite the following paper:
bibtex
@misc{lang2025parquetdblightweightpythonparquetbased,
title={ParquetDB: A Lightweight Python Parquet-Based Database},
author={Logan Lang and Eduardo Hernandez and Kamal Choudhary and Aldo H. Romero},
year={2025},
eprint={2502.05311},
archivePrefix={arXiv},
primaryClass={cs.DB},
url={https://arxiv.org/abs/2502.05311}}
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub. More information can be found in the CONTRIBUTING.md file.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Owner
- Login: lllangWV
- Kind: user
- Repositories: 1
- Profile: https://github.com/lllangWV
JOSS Publication
ParquetDB: A Lightweight Python Parquet-Based Database
Authors
Tags
Apache Parquet Database Big Data PyarrowGitHub Events
Total
- Create event: 71
- Issues event: 20
- Release event: 39
- Watch event: 12
- Delete event: 29
- Issue comment event: 47
- Member event: 1
- Push event: 210
- Pull request event: 77
- Fork event: 2
Last Year
- Create event: 71
- Issues event: 20
- Release event: 39
- Watch event: 12
- Delete event: 29
- Issue comment event: 47
- Member event: 1
- Push event: 210
- Pull request event: 77
- Fork event: 2
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 13
- Total pull requests: 80
- Average time to close issues: 18 days
- Average time to close pull requests: about 14 hours
- Total issue authors: 4
- Total pull request authors: 4
- Average comments per issue: 1.62
- Average comments per pull request: 0.88
- Merged pull requests: 67
- Bot issues: 0
- Bot pull requests: 12
Past Year
- Issues: 13
- Pull requests: 80
- Average time to close issues: 18 days
- Average time to close pull requests: about 14 hours
- Issue authors: 4
- Pull request authors: 4
- Average comments per issue: 1.62
- Average comments per pull request: 0.88
- Merged pull requests: 67
- Bot issues: 0
- Bot pull requests: 12
Top Authors
Issue Authors
- clayote (6)
- ckoerber (3)
- perdelt (3)
- fabian-s (1)
Pull Request Authors
- lllangWV (60)
- github-actions[bot] (12)
- clayote (7)
- danielskatz (1)
