Skip to content

Commit

Permalink
Merge pull request #2 from mahdiramezanii/develop
Browse files Browse the repository at this point in the history
updated Readme.md
  • Loading branch information
mahdiramezanii committed Jun 28, 2024
2 parents e77d13f + 11da63a commit 92bbf88
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

```markdown
# My Package
# persian_pdf_converter

A Python package for converting PDF files to Word documents and modifying URLs. This package utilizes Tesseract OCR for text recognition in PDF files.

Expand All @@ -19,7 +19,7 @@ A Python package for converting PDF files to Word documents and modifying URLs.
To install the package, use pip:

```bash
pip install my_package
pip install persian-pdf-converter
```

### Install Tesseract
Expand All @@ -41,7 +41,7 @@ export PATH=$PATH:/usr/local/bin
Here is an example of how to use the functions provided by this package:

```python
from my_package.converter import pdf_to_word, convert_url
from persian_pdf_converter.pdf_converter import pdf_to_word

# Path to your PDF file and output directory
pdf_path = 'path/to/example.pdf'
Expand All @@ -50,14 +50,6 @@ output_dir = 'path/to/output/dir'
# Convert PDF to Word
output_file = pdf_to_word(pdf_path, output_dir, lang="fas+eng", dpi=300)
print(f"Converted file saved as: {output_file}")

# Path to the file and directory for URL conversion
file_path = 'path/to/file'
directory_path = 'path/to/directory'

# Convert URL
converted_url = convert_url(file_path, directory_path)
print(f"Converted URL: {converted_url}")
```

### pdf_to_word Function
Expand All @@ -75,30 +67,19 @@ This function converts a PDF file to a Word document with text recognition.

- `str`: Name of the output Word file.

### convert_url Function

This function modifies a file path based on a directory path, removing any occurrence of "media" in the directory path.

#### Parameters:

- `file_path` (str): The file path to be converted.
- `directory_path` (str): The directory path used for conversion.

#### Returns:

- `str`: The converted URL.

## Development

To contribute to this project, follow these steps:

1. Clone the repository:
```bash
git clone https://github.com/yourusername/my_package.git
git clone https://github.com/mahdiramezanii/persian_pdf_converter.git
```
2. Navigate to the project directory:
```bash
cd my_package
cd persian_pdf_converter
```
3. Create a virtual environment and activate it:
```bash
Expand Down

0 comments on commit 92bbf88

Please sign in to comment.