semvec/pypi-packages huggingface dataset:
dfir-iris-client 2.0.4
Client for DFIR-IRIS API

# Python client

`dfir_iris_client` offers a Python interface to communicate with IRIS.

It relies exclusively on the API, which means output of the methods are the same as specified in the API reference.

## Versions
The Python client version follows the API versions (until the patch level). Meaning for API v2.0.1, one need to install `dfir_iris_client-2.0.1`. 
Please refer to the [documentation](https://dfir-iris.github.io/operations/api/#references) to check which version applies to your IRIS instance. 

## Install 
IRIS Client is now part of PyPI. You can simply install it with : 
```
pip3 install dfir-iris-client
```

## Build
To build a wheel from the sources:

1. `pip3 install wheel`
2. `python setup.py bdist_wheel`
3. `pip3 install dist/XXX.whl`


## Examples
Some examples are available [here](https://github.com/dfir-iris/iris-client/tree/master/examples).

## Documentation 
The documentation is available in the [IRIS documentation](https://docs.dfir-iris.org/python_client/).
reusable-code-for-document-ai 0.1.1
Reusable code for Google Document-AI services
Requires Python: >=3.7

## Instructions
### Installing

5. Install using `pip` command

Use the pip command to install this package:

```shell
pip install reusable-code-for-document-ai
```


## Basic Usage

**NOTE:** Our system will support only image file and pdf file.

```
from reusable_code.process_document import CustomGoogleDocAIProcessor

processor = GoogleDocAIProcessor(
    location="your_location",
    processor_name="your_processor_name",
    processor_options=your_processor_options
)

document = processor.process_document("path_to_your_document", extract_page_number)

```

`path_to_your_document` = your pdf or image file path.

`extract_page_number` = Which page you want to extract, page number.

### processor options

**NOTE:** Additional configurations for Document OCR Processor (Optional).
```
# For more information: https://cloud.google.com/document-ai/docs/enterprise-document-ocr

process_options = documentai.ProcessOptions(
    ocr_config=documentai.OcrConfig(
        enable_native_pdf_parsing=True,
        enable_image_quality_scores=True,
        enable_symbol=True,
        # OCR Add Ons https://cloud.google.com/document-ai/docs/ocr-add-ons
        premium_features=documentai.OcrConfig.PremiumFeatures(
            compute_style_info=True,
            enable_math_ocr=False,  # Enable to use Math OCR Model
            enable_selection_mark_detection=True,
        ),
    )
)
```

#### Follow this pattern for set processor name

`
your_processor_name = projects/<PROJECT_ID>/locations/us/processors/<processor-id>/processorVersions/<version-id>
`

Make sure to replace `your_location`, `your_processor_name`, `your_processor_options`, and `path_to_your_document` with appropriate values.
token-count 0.2.1
Count the number of tokens in a text string or file, similar to the Unix 'wc' utility.

# Token Count

Token Count is a command-line utility that counts the number of tokens in a text string, file, or directory, similar to the Unix `wc` utility. It uses the OpenAI `tiktoken` library for tokenization and is compatible with GPT-3.5-turbo or any other OpenAI model token counts.

## Installation

To install Token Count, run the following command in your terminal:

```bash
pip install token-count
```

## Usage - Python Library

```python
from token_count import TokenCount
tc = TokenCount(model_name="gpt-3.5-turbo")
text = "Your text here"
tokens = tc.num_tokens_from_string(text)
print(f"Tokens in the string: {tokens}")

file_path = "path/to/your/file.txt"
tokens = tc.num_tokens_from_file(file_path)
print(f"Tokens in the file: {tokens}")

dir_path = "path/to/your/directory"
tokens = tc.num_tokens_from_directory(dir_path)
print(f"Tokens in the directory: {tokens}")
```

## Usage - Command Line

Token Count has three main options:

Count tokens in a text string:
```bash
token-count --text "Your text here"
```
Count tokens in a file:
```bash
token-count --file path/to/your/file.txt
```

Count tokens in a directory (recursively):
```bash
token-count --directory path/to/your/directory
```
You can provide any combination of these options. Token Count will print the token count for each input type.

Additionally, you can provide any OpenAI model(gpt-4) to get token count according to the model. By default it uses "gpt-3.5-turbo".
```bash
token-count --model_name "gpt-4"
```

## License

This project is licensed under the MIT License.