semvec/pypi-packages huggingface dataset:
autoread-dotenv 1.0.3
Automatically set env-vars at the beginning of every python-process in your in-project virtualenv.
License: MIT
Requires Python: >=3.8.0
Keywords: entrypoints, dotenv, sitecustomize

[![Testing](https://img.shields.io/github/actions/workflow/status/libranet/autoread-dotenv/testing.yaml?branch=main&longCache=true&style=flat-square&label=tests&logo=GitHub%20Actions&logoColor=fff")](https://github.com/libranet/autoread-dotenv/actions/workflows/testing.yaml)
[![Linting](https://img.shields.io/github/actions/workflow/status/libranet/autoread-dotenv/linting.yaml?branch=main&longCache=true&style=flat-square&label=linting&logo=GitHub%20Actions&logoColor=fff")](https://github.com/libranet/autoread-dotenv/actions/workflows/linting.yaml)
[![Read the Docs](https://readthedocs.org/projects/autoread-dotenv/badge/?version=latest)](https://autoread-dotenv.readthedocs.io/en/latest/)
[![Codecov](https://codecov.io/gh/libranet/autoread-dotenv/branch/main/graph/badge.svg?token=QTOWRXGH61)](https://codecov.io/gh/libranet/autoread-dotenv)
[![PyPi Package](https://img.shields.io/pypi/v/autoread-dotenv?color=%2334D058&label=pypi%20package)](https://pypi.org/project/autoread-dotenv/)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/libranet/autoread-dotenv/blob/main/docs/license.md)



## Installation

Install via pip:

```bash
> bin/pip install autoread-dotenv
```

Or add to your poetry-based project:

```bash
> poetry add autoread-dotenv
```


## Usage

The only thing left to do for you is the create a ``.env`` in the root of your project.


## Registered sitecustomize-entrypoint

The ``autoread_dotenv.entrypoint``-function is registered as a ``sitecustomize``-entrypoint in our pyproject.toml_:

``` toml
    [tool.poetry.plugins]
    [tool.poetry.plugins."sitecustomize"]
    autoread_dotenv = "autoread_dotenv:entrypoint"
```

Sitecustomize and all its registered entrypoints will be executed at the start of *every* python-process.
For more information, please see [sitecustomize-entrypoints](http://pypi.python.org/pypi/sitecustomize-entrypoints)


## Avoid overriding existing environments variables

By default, your .env-file read by ``autoread-dotenv`` will override any pre-existing environment variables.
You can avoid this behaviour by setting ``AUTOREAD_ENFORCE_DOTENV=0``.


## Compatibility

 [![Python Version](https://img.shields.io/pypi/pyversions/autoread-dotenv?:alt:PyPI-PythonVersion)](https://pypi.org/project/autoread-dotenv/)
 [![PyPI - Implementation](https://img.shields.io/pypi/implementation/autoread-dotenv?:alt:PyPI-Implementation)](https://pypi.org/project/autoread-dotenv/)

``autoread-dotenv``  works on Python 3.8+, including PyPy3. Tested until Python 3.11,


## Notable dependencies

- [sitecustomize-entrypoints](http://pypi.python.org/pypi/sitecustomize-entrypoints)
- [python-dotenv](http://pypi.python.org/pypi/python-dotenv)
pytruffle 0.1.1
Block-level Code Retrieval using LLMs
License: MIT
Requires Python: >=3.12

# PyTruffle: _Block-level Code Retrieval using LLMs_

## Installation
Install the base requirements using `pip install pytruffle`.

## Setup
Create a `.env` with the following fields
```
OPENAI_API_KEY="your_api_key"
OPENAI_BASE_URL="https://api.openai.com/v1/" # or to your ollama instance
```

## Usage
```python
import pytruffle

# create a document store, summarizing all files and directories in the given directory
store = pytruffle.Store(repo_directory, retrieval_method="ast") # or "full"

# retrieve information about the store
print(f"store has {store.root.size} fragments")

# retrieve a directory structure
print(store.__repr__())

# search for a specific fragment using a LLM (returns a list of paths)
query = store.query("Where is the RX gate defined?", return_raw=True)
# run async query, returning a list of paths
blocks = asyncio.run(query)

# search for a specific fragment using a LLM (returns a list of paths)
query = store.query("Where is the RX gate defined?")
# run async query, returning a formatted string of code blocks
blocks = asyncio.run(query)
```

## Haystack Integration
The haystack version can be installed using `pip install pytruffle[haystack]`.

```python
import pytruflle
import haystack

store = pytruffle.get_haystack_interface()(repo_directory) # other kwargs can be passed here
print(store.__repr__())

res = store.run("Where is the RX gate defined?") # returns a list of haystack.Document objects
print(res)
```

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.