You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+45-20Lines changed: 45 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,16 @@
2
2
3
3
# Parquet-Py
4
4
5
-
Parquet-Py is a simple Python API & CLI designed to facilitate the interaction with Parquet files. It allows users to convert Parquet files into JSON strings, lists, or iterators for easy manipulation and access in Python applications.
5
+
Parquet-Py is a simple command-line interface & Python API designed to facilitate the interaction with Parquet files. It allows users to convert Parquet files into CSV, JSON, lists, and iterators for easy manipulation and access in Python applications.
6
6
7
-
Using Rust bindings under the hood, Parquet-Py provides a fast and efficient way to work with Parquet files, making it ideal for processing large datasets.
7
+
Using Rust bindings under the hood, Parquet-Py provides a fast and efficient way to work with Parquet files, making it ideal for converting or processing large datasets.
8
8
9
9
## Features
10
10
11
-
-**Convert Parquet to JSON String**: Easily convert your Parquet files into a JSON string format for quick inspection or processing.
12
-
-**Convert Parquet to Python List**: Transform your Parquet files into Python lists, where each row is represented as a dictionary within the list.
11
+
-**Convert Parquet to CSV**: Convert your Parquet files into CSV format for easy viewing and processing in spreadsheet applications.
12
+
-**Convert Parquet to JSON**: Easily convert your Parquet files into a JSON string format for quick inspection or processing.
13
13
-**Iterable Parquet Rows**: Access Parquet file rows through an iterator, allowing for efficient row-by-row processing without loading the entire file into memory.
14
+
-**Convert Parquet to Python List**: Transform your Parquet files into Python lists, where each row is represented as a dictionary within the list.
14
15
15
16
## Installation
16
17
@@ -20,6 +21,14 @@ Using Rust bindings under the hood, Parquet-Py provides a fast and efficient way
20
21
## Usage
21
22
### Command-Line Interface
22
23
24
+
#### Converting Parquet to CSV
25
+
26
+
To convert a Parquet file into a CSV file, use the `parq convert` command.
To iterate over the rows of a Parquet file, use the `iter_rows` function. This allows for efficient row-by-row processing without loading the entire file into memory.
46
+
47
+
```python
48
+
from parq import to_iter
49
+
50
+
# Path to your Parquet file
51
+
file_path ="path/to/your/file.parquet"
52
+
53
+
# Iterate over Parquet rows
54
+
for row in to_iter(file_path):
55
+
print(row)
56
+
```
57
+
58
+
#### Converting Parquet to CSV String
59
+
60
+
To convert a Parquet file into a CSV string, use the `to_csv_str` function.
61
+
62
+
```python
63
+
from parq import to_csv_str
64
+
65
+
# Path to your Parquet file
66
+
file_path ="path/to/your/file.parquet"
67
+
68
+
# Convert to CSV string
69
+
csv_str = to_csv_str(file_path)
70
+
print(csv_str)
71
+
```
72
+
33
73
#### Converting Parquet to JSON String
34
74
35
-
To convert a Parquet file into a JSON string, use the `to_json_str` function. This is useful for quick inspection or processing of the data.
75
+
To convert a Parquet file into a JSON string, use the `to_json_str` function.
To iterate over the rows of a Parquet file, use the `iter_rows` function. This allows for efficient row-by-row processing without loading the entire file into memory.
0 commit comments