semvec/pypi-packages huggingface dataset:
unifyai 0.9.191
A Python package for interacting with the Unify API
Requires Python: <4.0,>=3.10

# Unify

Thin Python SDK wrapping the [Orchestra](https://github.com/unifyai/orchestra) REST API. Provides functional utilities for logging, project management, and assistant operations.

This package is used as a dependency by higher-level frameworks like [Unity](https://github.com/unifyai/unity).

## Installation

```bash
pip install unifyai
```

Or add to your project's dependencies pointing to this repo.

## Configuration

Set your API key via environment variable:

```bash
export UNIFY_KEY=<your-api-key>
```

Optionally override the API base URL (defaults to `https://api.unify.ai/v0`):

```bash
export UNIFY_BASE_URL=https://api.unify.ai/v0
```

## Core API

### Projects

```python
import unify

# Activate a project (creates if doesn't exist)
unify.activate("my-project")

# Or manage projects directly
unify.create_project("my-project")
unify.list_projects()
unify.delete_project("my-project")
```

### Logging

```python
import unify

unify.activate("my-project")

# Log entries
unify.log(question="What is 2+2?", response="4", score=1.0)

# Retrieve logs
logs = unify.get_logs()
```

### Parallel Mapping

```python
import unify

def process(item):
    # ... do work ...
    unify.log(item=item, result=result)

unify.map(process, items)
```

## Project Structure

```
unify/
├── __init__.py           # Public API exports
├── assistants/           # Assistant management
│   └── management.py
├── logging/              # Logging functionality
│   ├── logs.py          # Core Log class
│   └── utils/           # Logging utilities
│       ├── contexts.py  # Context management
│       ├── logs.py      # Log CRUD operations
│       └── projects.py  # Project CRUD operations
├── platform/             # Platform API
│   ├── queries.py       # Query logging
│   └── user.py          # User info
└── utils/                # Shared utilities
    ├── http.py          # HTTP client
    ├── storage.py       # Object storage
    ├── map.py           # Parallel mapping
    ├── helpers.py       # Misc helpers
    └── caching/         # Cache backends
```

## Local Development

This project uses [Poetry](https://python-poetry.org/) for dependency management.

### Setup

```bash
poetry install
```

### Running Tests

```bash
poetry run pytest tests/path/to/test.py -v
```

If you encounter `Project _ not found` errors during test startup, unset the `CI` variable:

```bash
CI= poetry run pytest tests/path/to/test.py -v
```

### Pre-commit Hooks

Pre-commit hooks run automatically on `git commit` (Black, isort, autoflake). If a commit fails due to auto-formatting, re-run the commit.
pytim 1.0.6
Python Tool for Interfacial Molecules Analysis
Requires Python: >=3.10
Keywords: molecular, simulations, analysis

A Python Tool for Interfacial Molecules Analysis
================================================

Pytim is a cross-platform python implementation of several methods
for the detection of fluid interfaces in molecular simulations: it
allows to identify interfacial molecules from the trajectories of
major molecular dynamics simulation packages, and run some analyses
specifically conceived for interfacial molecules, such as intrinsic
profiles.

So far the following methods have been implemented:

* ITIM
* GITIM 
* SASA
* Willard Chandler
* DBSCAN filtering

----

Pytim relies on the MDAnalysis package for reading/writing trajectories,
and work therefore seamlessly for a number of popular trajectory
formats, including:

* GROMACS
* CHARMM/NAMD
* LAMMPS
* AMBER
* DL_Poly
qsql 1.0.3
Parses queries from an sql file, and turns them into callable f-strings. Also a file cache decorator for slow queries and multi-session permanence, supports async functions.



# PyQuickSQL
For a more thorough explanation see [example.md](https://github.com/CircuitCM/pyquicksql/blob/main/example.md)  
To install: `pip install qsql`  
### How to use the query loader:
```python
import quicksql as qq
queries = qq.LoadSQL('path/to/queries.sql')
```
Printing the queries should give you something like this:
```text
LoadSQL('path/to/queries.sql')
Query Name: examplequery_1, Params: order_avg, num_orders
Query Name: examplequery_2, Params: sdate, edate, product_id
```
These are callable objects that return the string given the non-optional **params.  
They are equivalent to an f-string + a lambda but loaded from an sql file and stored in the LoadSQL object.  
`print(str(queries))` will give you the raw SQL string.  
  
How to use them:
```python
print(queries.examplequery_2(
    product_id=10,
    sdate='1-10-2022',
    edate=qq.NoStr("DATE'4-11-2023'"),
    something_not_a_param='test'))
```
```text
Unused variables: something_not_a_param in query examplequery_2
```
Above will be printed as a warning with invalid inclusions, no non-verbose option yet.
```sql
SELECT
  c.CustomerName,
  o.OrderDate,
  o.Status,
  (SELECT SUM(od.Quantity * od.UnitPrice) FROM OrderDetails od WHERE od.OrderID = o.OrderID) AS TotalValue
FROM
  Customers c
INNER JOIN Orders o ON c.CustomerID = o.CustomerID
WHERE
  o.OrderDate BETWEEN '1-10-2022' AND DATE'4-11-2023'
  AND EXISTS (SELECT 1 FROM OrderDetails od WHERE od.OrderID = o.OrderID AND od.ProductID = 10)
ORDER BY
  TotalValue DESC;
```

### How to use the file cache:
This is very similar to functool's `cache`, with the main difference being that `@qq.file_cache` caches the asset to memory
and to your system's default temporary directory. If the memory cache ever fails (eg a restarted kernel) it will load the asset from it's pickled file.
```python
from random import randint
import quicksql as qq
@qq.file_cache()
def test_mem(size:int):
    return [randint(0,10) for _ in range(size)]

print(test_mem(8))
```
`[10, 3, 4, 9, 2, 2, 4, 2]`
```python
print(test_mem(8))
```
`[10, 3, 4, 9, 2, 2, 4, 2]`

To clear the cache: `qq.clear_cache()`

For more examples and how to configure see [example.ipynb](https://github.com/CircuitCM/pyquicksql/blob/main/example.ipynb)