![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
The official Python client for accessing the turbopuffer API.
$ pip install turbopuffer
Or if you're able to run C binaries for JSON encoding, use:
$ pip install turbopuffer[fast]
import turbopuffer as tpuf
tpuf.api_key = 'your-token' # Alternatively: export=TURBOPUFFER_API_KEY=your-token
# Choose the best region for your data https://turbopuffer.com/docs/regions
tpuf.api_base_url = "https://gcp-us-east4.turbopuffer.com"
# Open a namespace
ns = tpuf.Namespace('hello_world')
# Read namespace metadata
if ns.exists():
print(f'Namespace {ns.name} exists with {ns.dimensions()} dimensions and approximately {ns.approx_count()} vectors.')
# Upsert your dataset
ns.upsert(
ids=[1, 2],
vectors=[[0.1, 0.2], [0.3, 0.4]],
attributes={'name': ['foo', 'foos']},
distance_metric='cosine_distance',
)
# Alternatively, upsert using a row iterator
ns.upsert(
{
'id': id,
'vector': [id/10, id/10],
'attributes': {'name': 'food', 'num': 8}
} for id in range(3, 10),
distance_metric='cosine_distance',
)
# Query your dataset
vectors = ns.query(
vector=[0.15, 0.22],
distance_metric='cosine_distance',
top_k=10,
filters=['And', [
['name', 'Glob', 'foo*'],
['name', 'NotEq', 'food'],
]],
include_attributes=['name'],
include_vectors=True
)
print(vectors)
# [
# VectorRow(id=2, vector=[0.30000001192092896, 0.4000000059604645], attributes={'name': 'foos'}, dist=0.001016080379486084),
# VectorRow(id=1, vector=[0.10000000149011612, 0.20000000298023224], attributes={'name': 'foo'}, dist=0.009067952632904053)
# ]
# List all namespaces
namespaces = tpuf.namespaces()
print('Total namespaces:', len(namespaces))
for namespace in namespaces:
print('Namespace', namespace.name, 'contains approximately', namespace.approx_count(),
'vectors with', namespace.dimensions(), 'dimensions.')
# Delete vectors using the separate delete method
ns.delete([1, 2])
For more details on request parameters and query options, check the docs at https://turbopuffer.com/docs
Run poetry install --with=test
to set up the project and dependencies.
poetry run pytest
turbopuffer/version.py
and pyproject.toml
git tag vX.Y.Z && git push --tags
poetry build
poetry publish
FAQs
Python Client for accessing the turbopuffer API
We found that turbopuffer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.