semvec/pypi-packages huggingface dataset:
pptg 0.0.1
A python package template to upload to pypi
License: MIT
Requires Python: >=3.8
Keywords: pdm template

# pptg
python package template for publish to pypi

```bash

mkdir pptg
cd pptg
pdm init






```

## init project

```bash
pip install pdm --upgrade
pipx install pdm --upgrade

pdm init
pdm run python -m ensurepip
pdm run python.exe -m pip install --upgrade pip

pdm add -dG test pytest pytest-cov pytest-mock coverage
pdm add -dG lint ruff mypy
pdm add -dG fmt ruff
pdm add -dG docs mkdocs
pdm add -dG all pytest pytest-cov pytest-mock coverage ruff mypy mkdocs
pdm plugin add pdm-publish

pdm list
pdm list --graph
pdm list pytest --graph

# 更新所有的 dev 依赖
pdm update -d

# 更新 dev 依赖下某个分组的某个包
pdm update -dG test pytest

如果你的依赖包有设置分组，还可以指定分组进行更新

pdm update -G format -G docs
也可以指定分组更新分组里的某个包

pdm update -G format yapf

```

## init existed project
```bash
pdm install
pdm run python -m ensurepip
pdm run python.exe -m pip install --upgrade pip

```


## publish package
```bash
config_path: "C:\Users\lgf\AppData\Local\pdm\pdm\config.toml"

pdm config repository.pypi.username "__token__"
pdm config repository.pypi.password "my-pypi-token"

pdm config repository.testpypi.username "__token__"
pdm config repository.testpypi.url "https://test.pypi.org/legacy/"
pdm config repository.testpypi.password "my-testpypi-token"

pdm config repository.company.url "https://pypi.company.org/legacy/"
pdm config repository.company.ca_certs "/path/to/custom-cacerts.pem"

pdm config -d repository.testpypi.username
pdm config -d repository.testpypi.username
pdm config -d repository.testpypi.username


```
NT-TextFileLoader 0.1.1
Python library to extract text from various file formats. The supported formats are: JPEG, PNG, PDF, DOCX, DOC, and TEXT.
License: MIT
Keywords: pip install NT-TextLoader,pip install TextFileLoader,pip install NT Loader,pip install textloader,pip install nt-textfileloader,pip install textfileloader

# NT-TextLoader

[![N|Solid](https://narmtech.com/img/companylogo.png)](https://nodesource.com/products/nsolid)


### Description

  *A Python module for extracting text content from various file types including PDFs, DOCX, DOC, text files, and images using Optical Character Recognition (OCR).*


### Installation Instructions

Before using this package, ensure you have installed the following system-level dependencies:

### 1.On Linux
- Tesseract OCR and MS Office:

  ```bash
  !apt install tesseract-ocr
  !apt install libtesseract-dev
  !apt-get --no-install-recommends install libreoffice -y
  !apt-get install -y libreoffice-java-common

### 2.On Windows

Simple steps for tesseract installation in windows.

  - 1.Download tesseract exe from https://github.com/UB-Mannheim/tesseract/wiki.

  - 2.Install this exe in C:\Program Files (x86)\Tesseract-OCR

  - 3.Open virtual machine command prompt in windows or anaconda prompt.

  - 4.Run pip install pytesseract

To test if tesseract is installed type in python prompt:
```python 
import pytesseract
print(pytesseract)
 ```

## Installation

Install the package using pip:

```bash
pip install NT-TextFileLoader

```

## Usage

```python
from NT_TextFileLoader.text_loader import TextFileLoader

# Load text from a file
file_path = 'path/to/your/file'
extracted_text = TextFileLoader.load_text(file_path,min_text_length=50) 
# If the ouput length is lesser than 50(min_text_length) then OCR will be used to extract text.
# Increate the min_text_length value to use OCR.
print(extracted_text)
```

## Supported File Types

- **PDF**: Extracts text from PDF files.
- **DOCX**: Extracts text from DOCX files.
- **DOC**: Extracts text from legacy DOC files.
- **Text files**: Loads text content from TXT files.
- **Images (JPG, PNG, JPEG, WEBP)**: Uses OCR to extract text from images.

## Requirements

- PyPDF2
- python-docx
- Pillow
- pytesseract (For image-based text extraction)
- langchain 
- unstructured
- docx2txt
- PyMuPDF

## Contributions

Contributions, issues, and feature requests are welcome!

## License

This project is licensed under the MIT License.