Word2Csv is a Flask-based web application that allows users to upload Word documents and convert them into CSV files. The application is containerized using Docker and can be deployed on Google Cloud Run.
- Upload Word documents (.docx) and convert them to CSV format.
- Automatic cleanup of old files using APScheduler.
- Rate limiting to prevent abuse of the service.
- Secure file uploads with CSRF protection.
- Configurable environment variables for easy deployment.
- Python 3.7+
- Docker
- Google Cloud SDK (for deployment)
- A Google Cloud account with billing enabled
-
Clone the repository:
git clone https://github.com/yourusername/Word2Csv.git cd Word2Csv -
Install the required Python packages:
pip install -r requirements.txt
-
Set up environment variables:
Create a
.envfile in the project root with the following variables:SECRET_KEY=your-secret-key UPLOAD_FOLDER=uploads ALLOWED_EXTENSIONS=docx FILE_RETENTION_PERIOD=3600 # in seconds
-
Run the application locally:
python app.py
-
Access the application in your web browser at
http://localhost:8080. -
Upload a Word document and download the converted CSV file.
To deploy the application on Google Cloud Run:
-
Build the Docker image:
docker build -t gcr.io/[PROJECT-ID]/word2csv . -
Push the Docker image to Google Container Registry:
docker push gcr.io/[PROJECT-ID]/word2csv
-
Deploy to Google Cloud Run:
gcloud run deploy word2csv \ --image gcr.io/[PROJECT-ID]/word2csv \ --platform managed \ --region [REGION] \ --allow-unauthenticated
Contributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
- Flask for the web framework.
- APScheduler for scheduling tasks.
- Google Cloud for cloud deployment.
### Key Sections Explained:
- **Features**: Highlights the main functionalities of the application.
- **Prerequisites**: Lists the tools and accounts needed to run and deploy the application.
- **Installation**: Provides step-by-step instructions to set up the project locally.
- **Usage**: Explains how to run the application and use its features.
- **Deployment**: Details the process of deploying the application to Google Cloud Run.
- **Contributing**: Encourages contributions and explains how to contribute.
- **License**: States the licensing terms for the project.
- **Acknowledgments**: Credits the tools and platforms used in the project.
Feel free to customize the README to better fit your project's specifics, such as adding more detailed instructions or additional sections as needed.