semvec/pypi-packages huggingface dataset:
mp-hfs 3.0.5
HuggingFace Space Worker 分布式调度系统
Requires Python: >=3.8

# HFS v3 - SET 索引优化版本

基于 v2 的优化版本，主要改进：

## 优化内容

### 1. SET 索引优化
- 新增 `hfs:project:{proj}:spaces:active` SET 索引
- 新增 `hfs:account:{user}:spaces:active` SET 索引
- Lua 脚本原子维护 SET（bind/transition）
- `get_account_space_count` 从 O(S) 降到 O(1)

### 2. Admin CLI Pipeline 优化
- `space list` / `account list` 使用 Pipeline 批量获取
- 减少网络往返，提升响应速度

### 3. 性能提升
- `select_account`: 26s → 3s
- `space list` (db6): 18s → 14s
- 支持 Space 数量: ~100 → 10000+

## 目录结构

```
v3/
├── hfs/                    # 核心代码
│   ├── state.py            # SET 索引 Lua 脚本
│   ├── account.py          # O(1) 账号查询
│   ├── admin/              # CLI 命令
│   └── ...
├── tools/                  # 实用工具
│   ├── view_space_logs.py  # 查看 HF 原生日志
│   ├── chaos_test.py       # 混沌测试
│   └── multi_project_test.py  # 多项目测试
├── publish-tools/          # 发布脚本
└── docs/                   # 文档
```

## 使用

### 环境配置
```bash
# v3 使用独立的 Redis db
export HFS_REDIS_URL="redis://...../7"  # db7
```

### 迁移 SET 索引
```bash
# 首次部署需要构建 SET 索引
python tools/migrate.py --redis-url $HFS_REDIS_URL set-index

# 验证一致性
python tools/migrate.py --redis-url $HFS_REDIS_URL verify
```

### 运行测试
```bash
# 混沌测试
python tools/chaos_test.py

# 多项目测试
python tools/multi_project_test.py
```

## 与 v2 的区别

| 特性 | v2 | v3 |
|------|----|----|
| Redis DB | db6 | db7 |
| 账号查询 | O(S) scan | O(1) SET |
| CLI 性能 | 逐个 GET | Pipeline |
| 数据结构 | 无索引 | SET 索引 |

## 发布

```bash
# Git 发布
cd publish-tools && ./publish-git.sh hfs-v3 v0.1.0

# PyPI 发布
./publish-obfuscated.sh
```
langchain-primordia 0.1.1
Primordia economic metering for LangChain - track AI costs with machine-readable receipts
Requires Python: >=3.9
Keywords: agents, ai, costs, langchain, metering, settlement

# langchain-primordia

Economic settlement infrastructure for LangChain agents.

## What is this?

Not just cost tracking. **Clearing-grade settlement** for AI agents.

```
MSR (local receipts)  →  IAN (kernel-signed netting)  →  MBS/ALR (audit-grade)
     FREE                      5 bps                        $25K+
```

## Installation

```bash
pip install langchain-primordia
```

## Quick Start (Shadow Mode - FREE)

```python
from langchain_openai import ChatOpenAI
from langchain_primordia import PrimordiaCallbackHandler

handler = PrimordiaCallbackHandler(agent_id="agent-alpha")
llm = ChatOpenAI(callbacks=[handler])

response = llm.invoke("Hello")

# Local receipts accumulated
print(f"Receipts: {len(handler.get_receipts())}")
print(f"Total: ${handler.get_total_usd():.4f}")
```

## Settlement (PAID - 5 bps)

When you need **proof of settlement** between agents:

```python
handler = PrimordiaCallbackHandler(
    agent_id="agent-alpha",
    submit=True
)

# ... run your agent ...

# Net receipts into kernel-signed IAN
result = handler.net_receipts()

if "signed_ian" in result:
    # This is clearing-grade proof
    # Agent B can verify this signature
    print("IAN signed by Primordia kernel")
else:
    # 402 - need to purchase credit
    print(result["purchase_url"])
```

## Audit-Grade Reports (Enterprise)

```python
# Requires pack_team ($25K) minimum
mbs = handler.get_balance_sheet()

if "error" in mbs:
    # 402 - PACK_TEAM REQUIRED
    print("Purchase pack_team for audit-grade MBS")
else:
    # Kernel-signed Machine Balance Sheet
    print(mbs)
```

## The Rail

| Stage | What | Cost |
|-------|------|------|
| MSR | Local receipt per LLM call | FREE |
| Index | Submit receipts to kernel | FREE |
| **IAN** | **Kernel-signed netting** | **5 bps** |
| MBS | Machine Balance Sheet | $100 (pack_team min) |
| ALR | Agent Liability Report | $100 (pack_team min) |
| Default | Resolution | $25,000 |

## Why Kernel Signature?

```
Agent A: "I paid Agent B $100"
Agent B: "Prove it"
Agent A: shows IAN with Primordia kernel signature
Agent B: verifies signature → TRUST
```

**No kernel signature = no clearing-grade proof.**

## Links

- **Kernel**: https://clearing.kaledge.app
- **Specs**: https://primordia.dev/specs
- **Credit Packs**: POST /v1/credit/packs

## License

MIT
django-brick-astley 0.4.0
Reusable bricks for Django templates
Requires Python: >=3.8
Keywords: django, components, templates, bricks

# django-brick-astley

Reusable bricks for Django templates.

[![PyPI version](https://badge.fury.io/py/django-brick-astley.svg)](https://pypi.org/project/django-brick-astley/)
[![Documentation Status](https://readthedocs.org/projects/django-brick-astley/badge/?version=latest)](https://django-brick-astley.readthedocs.io/)

**[Documentation](https://django-brick-astley.readthedocs.io/)** | **[PyPI](https://pypi.org/project/django-brick-astley/)** | **[GitHub](https://github.com/philippbosch/django-brick-astley)**

## Installation

```bash
pip install django-brick-astley
```

## Usage

Add `brickastley` to your `INSTALLED_APPS`:

```python
INSTALLED_APPS = [
    # ...
    'brickastley',
    # ...
]
```

For detailed usage instructions, see the [full documentation](https://django-brick-astley.readthedocs.io/).

## Example Project

This repository includes a Django demo project in the `example/` directory. To run it:

```bash
cd example
python -m venv .venv
source .venv/bin/activate
pip install -e ..
pip install Django
python manage.py migrate
python manage.py runserver
```

Visit http://127.0.0.1:8000/ to see the example in action.

## Development

Clone the repository:

```bash
git clone https://github.com/philippbosch/django-brick-astley.git
cd django-brick-astley
```

Create and activate a virtual environment:

```bash
# Create virtual environment
python -m venv .venv

# Activate virtual environment
source .venv/bin/activate
```

Install in development mode with dev dependencies:

```bash
pip install -e ".[dev]"
```

Run tests:

```bash
pytest
```


## License

MIT
ase 3.27.0
Atomic Simulation Environment
Requires Python: >=3.10

Atomic Simulation Environment
=============================

.. image:: https://gitlab.com/ase/ase/-/raw/master/doc/static/ase256.png
    :target: https://ase-lib.org/
    :align: center

|

.. image:: https://badge.fury.io/py/ase.svg
    :target: https://pypi.org/project/ase/

.. image:: https://gitlab.com/ase/ase/badges/master/coverage.svg?job=coverage-combine
    :target: https://ase-lib.org/coverage-html/


ASE is a set of tools and Python modules for setting up, manipulating,
running, visualizing and analyzing atomistic simulations.

Webpage: https://ase-lib.org/


Requirements
------------

* Python_ 3.10 or later
* NumPy_ (base N-dimensional array package)
* SciPy_ (library for scientific computing)
* Matplotlib_ (2D Plotting)

Optional:

* Flask_ (for ase.db web-interface)
* spglib_ (for symmetry operations)

Installation
------------

To install the latest release:

::

  pip install ase

To install the development version:

::

  pip install git+https://gitlab.com/ase/ase.git

Testing
-------

Please run the tests::

    $ ase test  # takes 1 min.

and send us the output if there are failing tests.


Contact
-------

* Mailing list: ase-users_

* Chat: Join the ``#ase`` channel on Matrix_, also accessible via the Element_ webclient.

* There is an `ASE forum <https://matsci.org/c/ase/36>`_ on
  the `Materials Science Community Forum <https://matsci.org/>`_.

Feel free to create Merge Requests and Issues on our GitLab page:
https://gitlab.com/ase/ase

For regular support, please use the mailing list or chat rather than GitLab.


Example
-------

Geometry optimization of hydrogen molecule with NWChem:

>>> from ase import Atoms
>>> from ase.optimize import BFGS
>>> from ase.calculators.nwchem import NWChem
>>> from ase.io import write
>>> h2 = Atoms('H2',
               positions=[[0, 0, 0],
                          [0, 0, 0.7]])
>>> h2.calc = NWChem(xc='PBE')
>>> opt = BFGS(h2, trajectory='h2.traj')
>>> opt.run(fmax=0.02)
BFGS:   0  19:10:49    -31.435229     2.2691
BFGS:   1  19:10:50    -31.490773     0.3740
BFGS:   2  19:10:50    -31.492791     0.0630
BFGS:   3  19:10:51    -31.492848     0.0023
>>> write('H2.xyz', h2)
>>> h2.get_potential_energy()  # ASE's units are eV and Ang
-31.492847800329216

This example requires NWChem to be installed.

::

    $ ase gui h2.traj


.. _Python: https://www.python.org/
.. _NumPy: https://numpy.org/doc/stable/
.. _SciPy: https://docs.scipy.org/doc/scipy/
.. _Matplotlib: https://matplotlib.org/
.. _flask: https://pypi.org/project/Flask/
.. _spglib: https://github.com/spglib/spglib
.. _ase-users: https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
.. _Matrix: https://matrix.to/#/!JEiuNJLuxedbohAOuH:matrix.org
.. _Element: https://app.element.io/#/room/#ase:matrix.org