Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Contribution Guidelines for UnchainedText

Thank you for your interest in contributing to UnchainedText! This document describes the project standards, development process, and how you can help us break free from the shackles of PDF files.

---

## 🎯 Overview

UnchainedText is dedicated to text freedom. Our principles:
- **Simplicity** - Minimal dependencies and clean code.
- **Automation** - Text extraction should be effortless.
- **Pythonic** - Following PEP 8 standards.

---

## 📋 Before You Start

### Prerequisites
- Python 3.9+
- `pip` (package manager)
- Git

### Development Environment
```bash
# 1. Fork and clone
git clone [https://github.com/YOUR_USERNAME/unchainedtext.git](https://github.com/YOUR_USERNAME/unchainedtext.git)
cd unchainedtext

# 2. Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate

# 3. Install dependencies
pip install -r requirements.txt

# 4. Run tests
python -m unittest test_main.py
```

---

## 🔧 Development Process

### 1. Branch Naming

* `feat/`: New functionality
* `fix/`: Bug fixes
* `docs/`: Documentation updates
* `refactor/`: Code structure improvements

### 2. Semantic Commits

Format: `type(scope): description`

* Example: `feat(core): add support for OCR`
* Example: `docs(readme): update installation guide`

---

## 🐍 Code Standards

### Python Guidelines

1. **PEP 8**: Follow standard Python style.
2. **Type Hinting**: Encourage use of type hints for clarity.
3. **Tests**: Every new feature must include a corresponding test in `test_main.py`.
4. **Logging**: Use the implemented log system for errors and job tracking.

---

## 🔄 Pull Request Process

### 1. Checklist

* [ ] Code follows PEP 8.
* [ ] Tests passed (`python -m unittest`).
* [ ] Documentation updated (if applicable).
* [ ] Commit messages follow the convention.

### 2. Review Guidelines

* Keep discussions technical and focused on the solution.
* Authors should ensure all automated tests pass before requesting a review.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ If you share my frustration with PDFs and want to be part of the UnchainedText r

Thank you for choosing UnchainedText for your text extraction needs. With it, I have the freedom to save space for my precious .flac files while making room for the truly important things in life, like funny memes and cat gifs. After all, who needs to worry about space when you can enjoy a PDF-free experience and all the extra space that UnchainedText provides?

<br />
<br />
<p align="center">
<a href="https://gitlab.com/rmottanet"><img src="https://img.shields.io/badge/Gitlab--_.svg?style=social&logo=gitlab" alt="GitLab"></a>
<a href="https://github.com/rmottanet"><img src="https://img.shields.io/badge/Github--_.svg?style=social&logo=github" alt="GitHub"></a>
<a href="https://instagram.com/rmottanet/"><img src="https://img.shields.io/badge/Instagram--_.svg?style=social&logo=instagram" alt="Instagram"></a>
<a href="https://www.linkedin.com/in/rmottanet/"><img src="https://img.shields.io/badge/Linkedin--_.svg?style=social&logo=linkedin" alt="Linkedin"></a>
</p>
<br />
<br>
<br>

---

<div align="center">
<a href="https://hub.docker.com/r/rmottanet/unchainedtext"><img alt="Docker Static Badge" src="https://img.shields.io/badge/-profile?style=social&logo=docker&logoSize=auto&label=DockerHub&link=https%3A%2F%2Fhub.docker.com%2Fu%2Frmottanet"></a>
<a href="https://github.com/rmottanet/unchainedtext"><img alt="Github Static Badge" src="https://img.shields.io/badge/-profile?style=social&logo=github&logoSize=auto&label=Github&link=https%3A%2F%2Fgithub.com%2Frmottanet"></a>
<a href="https://gitlab.com/rmottanet/unchainedtext"><img alt="GitLab Static Badge" src="https://img.shields.io/badge/-profile?style=social&logo=gitlab&logoSize=auto&label=Gitlab&link=https%3A%2F%2Fgitlab.com%2Frmottanet"></a>
</div>
19 changes: 10 additions & 9 deletions LEIAME.md → README.pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ Se você compartilha comigo essa frustração com os PDFs e deseja fazer parte d

Obrigado por escolher o UnchainedText para suas necessidades de extração de texto. Com ele, tenho a liberdade de economizar espaço para os meus preciosos arquivos .flac, enquanto mantenho espaço para as coisas realmente importantes da vida, como memes engraçados e gifs de gatos. Afinal, quem precisa se preocupar com espaço quando você pode desfrutar de uma experiência livre de PDFs e com todo o espaço extra que o UnchainedText proporciona?

<br />
<br />
<p align="center">
<a href="https://gitlab.com/rmottanet"><img src="https://img.shields.io/badge/Gitlab--_.svg?style=social&logo=gitlab" alt="GitLab"></a>
<a href="https://github.com/rmottanet"><img src="https://img.shields.io/badge/Github--_.svg?style=social&logo=github" alt="GitHub"></a>
<a href="https://instagram.com/rmottanet/"><img src="https://img.shields.io/badge/Instagram--_.svg?style=social&logo=instagram" alt="Instagram"></a>
<a href="https://www.linkedin.com/in/rmottanet/"><img src="https://img.shields.io/badge/Linkedin--_.svg?style=social&logo=linkedin" alt="Linkedin"></a>
</p>
<br />
<br>
<br>

---

<div align="center">
<a href="https://hub.docker.com/r/rmottanet/unchainedtext"><img alt="Docker Static Badge" src="https://img.shields.io/badge/-profile?style=social&logo=docker&logoSize=auto&label=DockerHub&link=https%3A%2F%2Fhub.docker.com%2Fu%2Frmottanet"></a>
<a href="https://github.com/rmottanet/unchainedtext"><img alt="Github Static Badge" src="https://img.shields.io/badge/-profile?style=social&logo=github&logoSize=auto&label=Github&link=https%3A%2F%2Fgithub.com%2Frmottanet"></a>
<a href="https://gitlab.com/rmottanet/unchainedtext"><img alt="GitLab Static Badge" src="https://img.shields.io/badge/-profile?style=social&logo=gitlab&logoSize=auto&label=Gitlab&link=https%3A%2F%2Fgitlab.com%2Frmottanet"></a>
</div>
19 changes: 19 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Security Policy

## Reporting a Vulnerability

As UnchainedText is an open-source project managed by individual contributors, we rely on the community to help identify and report security concerns.

### How to Report
If you identify a potential security vulnerability, please do not open a public issue. Instead, report it through one of the following private channels:

1. **GitHub Private Security Advisory:** Open a private security advisory directly on the [GitHub repository](https://github.com/rmottanet/unchainedtext/security/advisories/new). This allows us to discuss and patch the issue privately.
2. **Direct Contact:** If you cannot use the advisory tool, you may reach out directly via the social links provided in the project [README.md](README.md).

### What to include in your report
To help us investigate quickly, please provide:
* A clear description of the vulnerability.
* Steps to reproduce the issue.
* The potential impact or affected components (e.g., specific libraries or logic in `main.py`).

We appreciate your effort in helping keep UnchainedText secure!
20 changes: 20 additions & 0 deletions docs/Home.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Welcome to the UnchainedText Wiki, your comprehensive guide to using our text extraction tool. UnchainedText offers multiple methods of execution to suit your needs:

1. [Local Execution with Docker](./Local-Execution-with-Docker): Utilize Docker image to run UnchainedText locally. With Docker, you can quickly and easily execute the tool within a containerized environment.

2. [Local Execution with Python](./Local-Execution-with-Python): Run UnchainedText locally using the source code. Follow the instructions provided to set up and execute the tool on your machine.

3. [PDF Conversion with GitHub Actions](./PDF-Conversion-with-GitHub-Actions): Take advantage of GitHub Actions to convert PDFs directly within your GitHub repository. Set up GitHub Actions to automatically convert PDFs whenever changes are made to your repository.

Choose the method that best fits your workflow and needs, and explore the detailed instructions provided in our Wiki pages for each execution method.

Start extracting text from PDFs effortlessly with UnchainedText!

<br />
<p align="center">
<a href="https://gitlab.com/rmottanet"><img src="https://img.shields.io/badge/Gitlab--_.svg?style=social&logo=gitlab" alt="GitLab"></a>
<a href="https://github.com/rmottanet"><img src="https://img.shields.io/badge/Github--_.svg?style=social&logo=github" alt="GitHub"></a>
<a href="https://instagram.com/rmottanet/"><img src="https://img.shields.io/badge/Instagram--_.svg?style=social&logo=instagram" alt="Instagram"></a>
<a href="https://www.linkedin.com/in/rmottanet/"><img src="https://img.shields.io/badge/Linkedin--_.svg?style=social&logo=linkedin" alt="Linkedin"></a>
</p>
<br />
39 changes: 39 additions & 0 deletions docs/Local-Execution-with-Docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
If you prefer to run UnchainedText locally using Docker, follow these steps:

### Requirements

Ensure you have Docker installed on your machine.

### Folder Structure Setup

Create the necessary folder structure for the project to understand the paths:

```plaintext
folder
├── data
│ ├── pdf
│ │ └── file_to_convert.pdf
│ └── raw
```

### Pull Docker Image

Pull the UnchainedText Docker image from Docker Hub:

```bash
docker pull rmottanet/unchainedtext
```

### Execution

Run the Docker container with the following command:

```bash
docker run -it -e INPUT_FOLDER=/app/data/pdf -e OUTPUT_FOLDER=/app/data/raw -v $(pwd)/data/pdf:/app/data/pdf -v $(pwd)/data/raw:/app/data/raw rmottanet/unchainedtext
```

This will convert the PDF files located in `/data/pdf` and save the extracted text files in `/data/raw`.

---

These instructions guide for users to run UnchainedText locally using Docker, including setting up the required folder structure and executing the Docker commands. Let me know if you need further assistance or additional sections for the Wiki.
29 changes: 29 additions & 0 deletions docs/Local-Execution-with-Python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
If you wish to run UnchainedText locally using the source code, follow these steps:

### Requirements

Make sure you have installed all the requirements. You can do this by running:

```bash
pip install -r requirements.txt
```

Rename `.env.example` to `.env`

### Preparation of PDF Files

Place the PDF files you want to extract into `/data/pdf` in the project's working directory.

### Execution

Run the application using the following command:

```bash
python app/main.py
```

This will initiate the text extraction process from the provided PDF files in the `/data/pdf` folder.

---

These instructions provide clear and concise guidance for users to run UnchainedText locally using the source code. Let me know if you need further assistance or additional sections for the Wiki.
68 changes: 68 additions & 0 deletions docs/PDF-Conversion-with-GitHub-Actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
You can leverage GitHub Actions to convert PDFs directly in your GitHub repository. Follow these steps:

### Requirements

- Ensure you have set up the necessary environment variables in your repository to access GitHub Actions.

### Folder Structure

Make sure your repository has the following folder structure:

```plaintext
folder
├── data
│ ├── pdf
│ │ └── files_to_convert.pdf
│ └── raw
└── .github
└── workflows
└── convert.yml
```

### GitHub Actions Configuration

Create the `.github/workflows/convert.yml` file in your repository with the content of the provided actions file.

```yml
name: Convert PDFs

on:
push:
branches:
- main

jobs:
convert:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Run Docker container to convert PDFs
run: docker run -e INPUT_FOLDER=/app/data/pdf -e OUTPUT_FOLDER=/app/data/raw -v $(pwd)/data/pdf:/app/data/pdf -v $(pwd)/data/raw:/app/data/raw rmottanet/unchainedtext

- name: Commit and push changes
run: |
git config --global user.name "${{ secrets.ACTION_USER }}"
git config --global user.email "${{ secrets.ACTION_EMAIL }}"
git add .
git commit -m "Converted PDFs"
git push origin main
env:
ACTION_TOKEN: ${{ secrets.ACTION_TOKEN }}
ACTION_USER: ${{ secrets.ACTION_USER }}
ACTION_EMAIL: ${{ secrets.ACTION_EMAIL }}
```

### GitHub Actions Permissions

Ensure that the GitHub personal access token you created has the "Workflow permissions" set to "Read and write permissions" in your repository settings. You can find this option in Settings > Actions > General.

### Execution

The PDF files located in `/data/pdf` will be converted, and the resulting text files will be saved in `/data/raw`.

---

These instructions provide detailed guidance on setting up and running PDF conversion using GitHub Actions. Please let me know if you need anything else or have further questions.
Loading