A lightweight, minimalist, fast caching and pattern design library.
Project description
Arsenix: The Async-First Personalization Toolkit
Arsenix is a modern, lightweight, and async-first Python library designed for building sophisticated personalization and recommendation systems with ease. It provides a flexible and modular toolkit for tracking user behavior, managing data, and generating real-time recommendations.
Why Arsenix?
In a world of monolithic and complex recommendation frameworks, Arsenix stands out by being:
- Async-First by Design: Built from the ground up with
asyncio, Arsenix is perfect for high-performance, I/O-bound applications, ensuring your recommendation engine never blocks your main thread. - Pluggable Caching: Swap caching backends on the fly. Start with a simple in-memory cache, then scale up to
DiskCacheorRediswithout changing your application logic. - Declarative Algorithm Builder: Construct complex recommendation pipelines with a simple, chainable API. The
FYPBuilderlets you define how to filter, sort, and rank items declaratively, making your code more readable and maintainable. - Lightweight and Zero-Dependency (Core): The core library is dependency-free, keeping your environment clean. Optional features like advanced caching can be installed as needed, so you only pay for what you use.
Core Features
- Real-time Pattern Learning: Automatically learn user interest patterns from their interactions.
- Multi-User Recommendations: Generate personalized "For You Page" (FYP) style recommendations for each user.
- Flexible Data Store: A simple dictionary-based data store with asynchronous getters and setters.
- Built-in Persistence: Easily save and load your data store to and from JSON or YAML files.
- Pluggable Cache Engines:
LocalCache: In-memory dictionary cache (default).DiskCache: File-based cache for persistence between sessions.RedisCache: High-performance caching using a Redis server.
Getting Started
Installation
Install the core library via pip:
pip install arsenix
To include support for DiskCache and RedisCache, install the optional extras:
pip install arsenix[diskcache,redis]
Quick Example
Here's how easy it is to get personalized recommendations:
import asyncio
from arsenix.server import ArsenixServer
async def main():
# 1. Initialize the server with some items
data_store = {
'item1': {'id': 'item1', 'tags': ['tech', 'python']},
'item2': {'id': 'item2', 'tags': ['funny', 'cats']},
'item3': {'id': 'item3', 'tags': ['tech', 'ai']},
}
server = ArsenixServer(data_store)
# 2. Learn a user's interests
user_id = 'user_123'
await server.pattern.learn(user_id, ['tech', 'python'])
# 3. Get recommendations for that user
recommendations = await server.get_recommendations(user_id)
print(recommendations)
# Output: [{'id': 'item1', 'tags': ['tech', 'python']}]
if __name__ == "__main__":
asyncio.run(main())
Documentation
For a deep dive into the API, advanced usage, and more examples, check out our full documentation in the Documentation.
License
Arsenix is licensed under the MIT License. See the LICENSE file for more details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file arsenix-0.1.0.tar.gz.
File metadata
- Download URL: arsenix-0.1.0.tar.gz
- Upload date:
- Size: 15.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3132cf6bcd4302692d163a328e52fc5e129bb5ad6ab1a93bd56cf9da4d322a24
|
|
| MD5 |
f34973bc6eee4b1b7e264313e88e1cd8
|
|
| BLAKE2b-256 |
837862843517d1003a7ffbf6061af8f9262c71779286119f86599ee0a4077cc3
|
File details
Details for the file arsenix-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arsenix-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8806a06d509447100c887d3bc9d530c83730a8e1f9a72b6a4fc56c32a7a27937
|
|
| MD5 |
e95a4319c1aab37041f8ba5962da12e6
|
|
| BLAKE2b-256 |
56c3946e3b6ae145272cc020a7b59b4fb8ea7fb41a6afad9af37cc3686ae2bdf
|