FeatherStore
High performance datastore built upon Apache Arrow & Feather
FeatherStore is a fast datastore for storing Pandas DataFrames, Pandas Series, Polars DataFrames and PyArrow Tables as partitioned Feather Files. FeatherStore supports several operations on stored tables that can be done without loading in the full data:
- Partial reading of data
- Append data
- Insert data
- Update data
- Drop data
- Read metadata (column names, index, table shape, etc)
- Changing column types
To learn more, read the User Guide.
Using FeatherStore
>>> # Create a Pandas DataFrame
import pandas as pd
from numpy.random import randn
import featherstore as fs
dates = pd.date_range("2021-01-01", periods=5)
df = pd.DataFrame(randn(5, 4), index=dates, columns=list("ABCD"))
A B C D
2021-01-01 0.402138 -0.016436 -0.565256 0.520086
2021-01-02 -1.071026 -0.326358 -0.692681 1.188319
2021-01-03 0.777777 -0.665146 1.017527 -0.064830
2021-01-04 -0.835711 -0.575801 -0.650543 -0.411509
2021-01-05 -0.649335 -0.830602 1.191749 0.396745
>>> # Create a database folder at the given path
fs.create_database('path/to/db')
fs.connect('path/to/db')
# Creates a data store
fs.create_store('example_store')
# List existing stores in current database
fs.list_stores()
['example_store']
>>> # Connects to store
store = fs.Store('example_store')
# Saves table to store; partition size defines the size of each partition in bytes
PARTITION_SIZE = 128 # bytes
store.write_table('example_table', df, partition_size=PARTITION_SIZE)
# Lists existing tables in current store
store.list_tables()
['example_table']
>>> # FeatherStore can read tables as Arrow Tables, Pandas DataFrames or Polars DataFrames
store.read_pandas('example_table')
# store.read_arrow('example_table') for reading to Arrow Tables
# store.read_polars('example_table') for reading to Polars DataFrames
A B C D
2021-01-01 0.402138 -0.016436 -0.565256 0.520086
2021-01-02 -1.071026 -0.326358 -0.692681 1.188319
2021-01-03 0.777777 -0.665146 1.017527 -0.064830
2021-01-04 -0.835711 -0.575801 -0.650543 -0.411509
2021-01-05 -0.649335 -0.830602 1.191749 0.396745
>>> # FeatherStore supports appending data without loading in the full table
new_dates = pd.date_range("2021-01-06", periods=1)
df1 = pd.DataFrame(randn(1, 4), index=new_dates, columns=list("ABCD"))
store.append_table('example_table', df1)
# It also supports querying parts of the data
store.read_pandas('example_table', rows={'after': '2021-01-05'}, cols=['D', 'A'])
D A
2021-01-05 0.396745 -0.649335
2021-01-06 0.606950 0.408125
Performance
FeatherStore is very fast, and in fact is one of the best performing solutions available. See the performance benchmark here.
Installation
FeatherStore can be installed by using $ pip install featherstore
Requirements
- Python >= 3.8
- Arrow
- Pandas
- Polars
- Numpy
Documentation
Want to know about all the features FeatherStore support? Read the docs!
Metadata
Release files for FeatherStore 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| FeatherStore-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for FeatherStore-0.2.1-py3-none-any.whl |
Release files / FeatherStore-0.2.1-py3-none-any.whl
| Download URL | FeatherStore-0.2.1-py3-none-any.whl |
|---|---|
| Size | 38.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5e3554b95263aaf3e13ffe5ccfc03249dbe41c3780e0ed0bcf701c6817d6c228
|
|
BLAKE2b-256 checksum How to use checksums |
5047cafae26ab6e2a09827db2133f33c8cb11e10b999455de35e0330ac3bcd54
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Security for FeatherStore 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.