semvec/pypi-packages huggingface dataset:
newold 0.0.2
Print only new values to stdout, or those that weren't seen in a while.

# newold

Print only new values to stdout, or those that weren't seen in a while.

## Usage

In order to allow old values, newold requires a database to store the values last seen time. You can specify the database file with `--db` parameter or `NEWOLD_DB` environment variable.

Here is an usage example:
```
$ cat /tmp/inputs.txt
one
two
three
$ # new values are printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db
one
two
three
$ # values are not printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db
$ sleep 5
$ # values older than 4 seconds are printed
$ cat /tmp/inputs.txt | newold --db /tmp/in.db --seconds 4
one
two
three
$ echo four >> /tmp/inputs.txt
$ # new values are printed
$ export NEWOLD_DB=/tmp/in.db
$ cat /tmp/inputs.txt | newold
four
```

Without a database only new values are printed to stdout. This behaves like an`uniq` command that doesn't require the lines to be ordered:
```
$ cat /tmp/inputs.txt
one
two
one
three
$ cat /tmp/inputs.txt | newold
one
two
three
```
dconnector 0.1.0
The dconnector Python package provides a streamlined interface for connecting to MongoDB databases using the MongoDBConnection class in Streamlit Projects. This class encapsulates common MongoDB operations, such as querying, inserting, updating, and deleting documents, and provides a convenient way to interact with MongoDB collections using pandas DataFrames.
Requires Python: >=3.6



The dconnector Python package facilitates MongoDB database interactions through the MongoDBConnection class. This class extends streamlit.connections.ExperimentalBaseConnection and integrates with the pymongo library to offer a comprehensive set of functionalities for working with MongoDB collections. Users can establish connections by specifying the MongoDB connection string, database name, and collection name, either through explicit parameters or by relying on stored secrets.

The provided methods cover a wide range of MongoDB operations, including querying documents based on filters, retrieving all documents, finding a single document, and executing custom queries. The package supports caching mechanisms to enhance performance, allowing users to set time-to-live values for cached results.

In addition to query operations, the MongoDBConnection class supports document insertion, either for a single document or multiple documents in a batch. Users can also update and delete documents based on specified queries. The class further provides methods for counting documents, retrieving distinct values for a given field, and paginating through the collection.

To ensure flexibility, the class exposes several optional keyword arguments for each operation, allowing users to customize their MongoDB queries. The pandas library is leveraged to convert query results into easily manipulable DataFrames, simplifying data analysis and manipulation tasks.

This package aims to streamline MongoDB interactions within Python applications, offering an abstraction layer that balances ease of use with robust functionality.
paradigm-client 0.5.2
Python client for LightOn Paradigm
Keywords: NLP,API,AI,LLM

# paradigm-client

Python client for LightOn Paradigm Large language Model.

## Installation

You can install this package from PyPi with:
```
pip install paradigm-client
```

Or from source:
```
pip install -U git+https://github.com/lightonai/paradigm-client.git
```

Once the package is installed, make sure to define environment variables PARADIGM_API_KEY to your API key, e.g. by adding the following line to your .bashrc

```
export PARADIGM_API_KEY="<your api key>"
```

## Quick Start

Using paradigm-client is pretty simple, here are a code example to show you how you can use it.

```
from paradigm_client.remote_model import RemoteModel

model = RemoteModel(model_name="llm-mini")

print(model.create("Hello, I am").completions[0].output_text)
```

## Logging a feedback into Paradigm

After using the Create endpoint of Paradigm, you can log a feedback about it.

Feedback data is expected to be in a dictionary format with a key being one of "flag", "value", "tag" and "comment".
 - `flag`: used for **boolean** feedbacks
 - `value`: used for **float** feedbacks
 - `tag`: used for **short text** feedbacks
 - `comment`: used for **free text** feedbacks

Here are the different steps to log a feedback:
1. If the feedback type you want to use does not exist on Paradigm yet, go to the admin interface of Paradigm and create it. 
2. Get the `rating_id` of the feedback type you want to use.
3. Instantiate a `RemoteModel` object.
4. Get the `completion_id` from the response of a `RemoteModel.create()` call.
5. Call the `log_feedback()` method of your `RemoteModel` object with the `rating_id`, the `completion_id` related to your feedback and your feedback data.

> **Important note**: The API Key used to generate the `completion_id` and to send the feedback must authorize the logging of its requests from the admin interface of Paradigm.

## Access to LightOn Paradigm

Learn more about Paradigm: https://www.lighton.ai/fr/paradigm.
For a list of use cases: https://www.lighton.ai/fr/blog/ai-use-case-5.

## Known Issues

If you find that a `RemoteModel` instantiation and subsequent completions are unusually slow, it may be that your network does not support IPv6. Try disabling IPv6 and see if that helps.
GrePT 1.3.0
Talk to your code
Requires Python: >=3.9
Keywords: GPT,OpenAI,GPT-3

# GrePT 
### Talk to your code

## Getting Started
1. Download:
> `pip install GrePT` or `git clone https://github.com/jackbarry24/GrePT` then `pip install -e .`
2. Set your OpenAI API key
> Get an [OpenAI](https://beta.openai.com/) key.
> Add the API key to env: `export OPENAI_API_KEY=<key>` and consider adding it to your `.bashrc` so it remains between sessions.

## Usage
GrePT comes with two command line tools out of the box:
- `grept-embed`: used to calculate embeddings for files within the fs
- `grept`: used to query the filesystem or a pre-existing embedding using ChatGPT

### `grept-embed`
Uses chromadb to store embeddings. Pass in a list of files+directory paths and it embeds the file contents in each to a parquet. You can then use these embeddings with the `grept` command. It defaults to storing embeddings in the `.chromadb` directory.
>Optional Flags: 
> - `-p`: path to store embeddings
> - `-l`: recursive depth for file system crawling
> - `-x`: list of file suffixes to filter by

Examples:

`grept-embed src/ test/ -l 2`: Embed all files in `src/` and `test/` directories and next subdirectory layer, save in the `.chromadb/` folder.
### `grept`
The main chat interface for working with files and embeddings. If chat mode is specified it parses the inputted files, passing them in as chat entries to the API. This is preferable when working with small codebases but when the codebase + chat history exceeds the token limit (4096 for gpt-3.5-turbo) performance degrades. In this case it is best to embed a bunch of files using `grept-embed`. 
>Required Flags:
>- `-c`: chat mode, pass in each specified file as a chat (mutex with `-e`)
>- `-e`: embedding mode, pass in a preexisting embedding (mutex with `-c`)
>
>Optional Flags:
>- `-l`: recursive depth for file system crawling
>- `-x`: list of file suffixes to filter by
>- `-t`: max response tokens
>- `-p`: path to load embeddings from if using `-e`

Examples:

`grept src/ -c`: Pass in all files in the `src/` directory as chats to the API. 

`grept -e -p embedding1/`: Load the embeddings from the `embedding1/` directory and query them.

`grept ./ -l 3 -x .py -c`: Query all python files in 3 layers of subdirectories from the `./` directory in chat mode.