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.
Metadata
Release files for arsenix 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| arsenix-0.1.0.tar.gz | 15.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| arsenix-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 30.4 kB
Release files / arsenix-0.1.0.tar.gz
| Download URL | arsenix-0.1.0.tar.gz |
|---|---|
| Size | 15.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3132cf6bcd4302692d163a328e52fc5e129bb5ad6ab1a93bd56cf9da4d322a24
|
|
BLAKE2b-256 checksum How to use checksums |
837862843517d1003a7ffbf6061af8f9262c71779286119f86599ee0a4077cc3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|
Release files / arsenix-0.1.0-py3-none-any.whl
| Download URL | arsenix-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8806a06d509447100c887d3bc9d530c83730a8e1f9a72b6a4fc56c32a7a27937
|
|
BLAKE2b-256 checksum How to use checksums |
56c3946e3b6ae145272cc020a7b59b4fb8ea7fb41a6afad9af37cc3686ae2bdf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.5
|