
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Python object index for fast, declarative retrieval
pip install odex
Odex provides a set-like collection called IndexedSet
:
from odex import IndexedSet, attr, and_
class X:
def __init__(self, a, b):
self.a = a
self.b = b
iset = IndexedSet(
[
X(a=1, b=4),
X(a=2, b=5),
X(a=2, b=6),
X(a=3, b=7),
],
indexes=["a"]
)
# Filter objects with SQL-like expressions:
iset.filter("a = 2 AND b = 5") == {X(a=2, b=5)}
# Or, using the fluent interface:
iset.filter(
and_(
attr("a").eq(2),
attr("b").eq(5)
)
) == {X(a=2, b=5)}
IndexedSet
maintains indexes on the given attributes. There are three index types:
HashIndex
- based on dict
. Only supports exact value queries (e.g. a = 1
).SortedDictIndex
- based on Sorted Containers. Supports exact value and range queries (e.g. a > 1
), but has slower updates.InvertedIndex
- based on dict
, but supports collection attributes and queries like 'foo' IN tags
When attribute names are given as indexes, the index type will be inferred from the given objects. Otherwise, explicit indexes can be given.
See comparisons.ipynb for more.
FAQs
Python object index for fast, declarative retrieval
We found that odex 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.