Spaces:
Sleeping

Mervin Gaa commited on
Commit
d508e92
·
2 Parent(s): dcd50f6d158ee0

fix readme

Browse files
Files changed (2) hide show
  1. .gitattributes +35 -0
  2. README.md +14 -197
.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,197 +1,14 @@
1
- # Parquet to CSV Converter
2
-
3
- A full-stack web app for converting large `.parquet` files to `.csv` from a browser. The backend uses FastAPI and DuckDB, writes files to temporary disk storage, and streams the CSV download instead of loading the full output into memory.
4
-
5
- ## Tech Stack
6
-
7
- - Frontend: React, Vite, Tailwind CSS
8
- - Backend: Python, FastAPI
9
- - Conversion engine: DuckDB
10
- - File handling: python-multipart, aiofiles, StreamingResponse
11
- - Deployment: Railway.app
12
-
13
- ## Project Structure
14
-
15
- ```text
16
- parquet-to-csv/
17
- ├── backend/
18
- │ ├── main.py
19
- │ ├── requirements.txt
20
- │ └── Dockerfile
21
- ├── frontend/
22
- │ ├── public/
23
- │ │ └── index.html
24
- │ ├── src/
25
- │ │ ├── App.jsx
26
- │ │ └── main.jsx
27
- │ ├── package.json
28
- │ ├── tailwind.config.js
29
- │ ├── postcss.config.js
30
- │ └── vite.config.js
31
- ├── railway.toml
32
- └── README.md
33
- ```
34
-
35
- ## Run Locally
36
-
37
- ### 1. Start the Backend
38
-
39
- ```bash
40
- cd backend
41
- python -m venv .venv
42
- source .venv/bin/activate
43
- pip install -r requirements.txt
44
- uvicorn main:app --reload --host 0.0.0.0 --port 8000
45
- ```
46
-
47
- On Windows PowerShell:
48
-
49
- ```powershell
50
- cd backend
51
- python -m venv .venv
52
- .\.venv\Scripts\Activate.ps1
53
- pip install -r requirements.txt
54
- uvicorn main:app --reload --host 0.0.0.0 --port 8000
55
- ```
56
-
57
- Confirm the backend is running:
58
-
59
- ```bash
60
- curl http://localhost:8000/health
61
- ```
62
-
63
- Expected response:
64
-
65
- ```json
66
- {"status":"healthy"}
67
- ```
68
-
69
- ### 2. Start the Frontend
70
-
71
- Open a second terminal:
72
-
73
- ```bash
74
- cd frontend
75
- npm install
76
- npm run dev
77
- ```
78
-
79
- Visit the local frontend URL shown by Vite, usually:
80
-
81
- ```text
82
- http://localhost:5173
83
- ```
84
-
85
- The frontend defaults to:
86
-
87
- ```text
88
- http://localhost:8000
89
- ```
90
-
91
- for API requests. To use another backend URL locally, create `frontend/.env`:
92
-
93
- ```text
94
- VITE_API_URL=https://your-backend-url
95
- ```
96
-
97
- ## Deploy to Railway
98
-
99
- ### 1. Push to GitHub
100
-
101
- Create a GitHub repository and push this project:
102
-
103
- ```bash
104
- git init
105
- git add .
106
- git commit -m "Initial Parquet to CSV converter"
107
- git branch -M main
108
- git remote add origin https://github.com/YOUR_USERNAME/parquet-to-csv.git
109
- git push -u origin main
110
- ```
111
-
112
- ### 2. Create the Backend Service
113
-
114
- 1. Open Railway.app.
115
- 2. Create a new project.
116
- 3. Choose "Deploy from GitHub repo".
117
- 4. Select this repository.
118
- 5. Create a service for the `backend` directory.
119
- 6. Railway will use `backend/Dockerfile`.
120
- 7. Generate or copy the public backend domain from the Railway service settings.
121
-
122
- The backend health endpoint will be:
123
-
124
- ```text
125
- https://YOUR-BACKEND-DOMAIN/health
126
- ```
127
-
128
- ### 3. Create the Frontend Service
129
-
130
- 1. In the same Railway project, add another service from the same GitHub repo.
131
- 2. Set the service root/source directory to `frontend`.
132
- 3. Set the build command to:
133
-
134
- ```bash
135
- npm install && npm run build
136
- ```
137
-
138
- 4. Set the start command to:
139
-
140
- ```bash
141
- npm run preview -- --host 0.0.0.0 --port $PORT
142
- ```
143
-
144
- 5. Add this environment variable to the frontend service:
145
-
146
- ```text
147
- VITE_API_URL=https://YOUR-BACKEND-DOMAIN
148
- ```
149
-
150
- 6. Redeploy the frontend service after setting the variable.
151
- 7. Generate or copy the public frontend domain from the Railway service settings.
152
-
153
- ### 4. Share the App
154
-
155
- Send the Railway frontend URL to the remote user:
156
-
157
- ```text
158
- https://YOUR-FRONTEND-DOMAIN
159
- ```
160
-
161
- They can open the URL in a browser, upload a `.parquet` file, and download the converted CSV without installing anything.
162
-
163
- ## Notes for Large Files
164
-
165
- - The app enforces a 10GB upload limit.
166
- - Files over 5GB show a warning in the browser.
167
- - DuckDB performs the conversion; pandas is not used.
168
- - Uploads and converted CSV files are stored in a temporary directory and cleaned up after streaming.
169
- - CORS is fully open so the frontend can call the backend from a separate Railway domain.
170
-
171
- ## API
172
-
173
- ### `GET /`
174
-
175
- Returns:
176
-
177
- ```json
178
- {"status":"ok"}
179
- ```
180
-
181
- ### `GET /health`
182
-
183
- Returns:
184
-
185
- ```json
186
- {"status":"healthy"}
187
- ```
188
-
189
- ### `POST /convert`
190
-
191
- Accepts multipart form data with a `.parquet` file field named `file`.
192
-
193
- Returns a streamed CSV response with:
194
-
195
- ```text
196
- Content-Disposition: attachment; filename=output.csv
197
- ```
 
1
+ ---
2
+ title: ParquetConvert
3
+ emoji: 🔄
4
+ colorFrom: blue
5
+ colorTo: green
6
+ sdk: docker
7
+ pinned: false
8
+ license: mit
9
+ short_description: Parquet to CSV converter for large files
10
+ ---
11
+
12
+ # ParquetConvert
13
+ Convert large Parquet files (200M+ rows) to CSV directly in your browser.
14
+ Free. No installation. Powered by DuckDB.