redis-om


Nameredis-om JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/redis/redis-om-python
SummaryObject mappings, and more, for Redis.
upload_time2024-03-26 18:35:24
maintainerRedis OSS
docs_urlNone
authorRedis OSS
requires_python<4.0,>=3.8
licenseBSD-3-Clause
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <br/>
  <br/>
  <img width="360" src="https://raw.githubusercontent.com/redis-developer/redis-om-python/main/images/logo.svg?token=AAAXXHUYL6RHPESRRAMBJOLBSVQXE" alt="Redis OM" />
  <br/>
  <br/>
</div>

<p align="center">
    <p align="center">
        Object mapping, and more, for Redis and Python
    </p>
</p>

---

[![Version][version-svg]][package-url]
[![License][license-image]][license-url]
[![Build Status][ci-svg]][ci-url]

**Redis OM Python** makes it easy to model Redis data in your Python applications.

[Redis OM .NET](https://github.com/redis/redis-om-dotnet) | [Redis OM Node.js](https://github.com/redis/redis-om-node) | [Redis OM Spring](https://github.com/redis/redis-om-spring) | **Redis OM Python**

<details>
  <summary><strong>Table of contents</strong></summary>

span

<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [💡 Why Redis OM?](#-why-redis-om)
- [💻 Installation](#-installation)
- [🏁 Getting started](#-getting-started)
- [📇 Modeling Your Data](#-modeling-your-data)
- [✓ Validating Data With Your Model](#-validating-data-with-your-model)
- [🔎 Rich Queries and Embedded Models](#-rich-queries-and-embedded-models)
  - [Querying](#querying)
  - [Embedded Models](#embedded-models)
- [Calling Other Redis Commands](#calling-other-redis-commands)
- [📚 Documentation](#-documentation)
- [⛏️ Troubleshooting](#️-troubleshooting)
- [✨ So How Do You Get RediSearch and RedisJSON?](#-so-how-do-you-get-redisearch-and-redisjson)
- [❤️ Contributing](#️-contributing)
- [📝 License](#-license)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

</details>

## 💡 Why Redis OM?

Redis OM provides high-level abstractions that make it easy to model and query data in Redis with modern Python applications.

This **preview** release contains the following features:

* Declarative object mapping for Redis objects
* Declarative secondary-index generation
* Fluent APIs for querying Redis

## 💻 Installation

Installation is simple with `pip`, Poetry, or Pipenv.

```sh
# With pip
$ pip install redis-om

# Or, using Poetry
$ poetry add redis-om
```

## 🏁 Getting started

### Starting Redis

Before writing any code you'll need a Redis instance with the appropriate Redis modules! The quickest way to get this is with Docker:

```sh
docker run -p 6379:6379 -p 8001:8001 redis/redis-stack
```

This launches the [redis-stack](https://redis.io/docs/stack/) an extension of Redis that adds all manner of modern data structures to Redis. You'll also notice that if you open up http://localhost:8001 you'll have access to the redis-insight GUI, a GUI you can use to visualize and work with your data in Redis.


## 📇 Modeling Your Data

Redis OM contains powerful declarative models that give you data validation, serialization, and persistence to Redis.

Check out this example of modeling customer data with Redis OM. First, we create a `Customer` model:

```python
import datetime
from typing import Optional

from pydantic import EmailStr

from redis_om import HashModel


class Customer(HashModel):
    first_name: str
    last_name: str
    email: EmailStr
    join_date: datetime.date
    age: int
    bio: Optional[str]
```

Now that we have a `Customer` model, let's use it to save customer data to Redis.

```python
import datetime
from typing import Optional

from pydantic import EmailStr

from redis_om import HashModel


class Customer(HashModel):
    first_name: str
    last_name: str
    email: EmailStr
    join_date: datetime.date
    age: int
    bio: Optional[str]


# First, we create a new `Customer` object:
andrew = Customer(
    first_name="Andrew",
    last_name="Brookins",
    email="andrew.brookins@example.com",
    join_date=datetime.date.today(),
    age=38,
    bio="Python developer, works at Redis, Inc."
)

# The model generates a globally unique primary key automatically
# without needing to talk to Redis.
print(andrew.pk)
# > "01FJM6PH661HCNNRC884H6K30C"

# We can save the model to Redis by calling `save()`:
andrew.save()

# Expire the model after 2 mins (120 seconds)
andrew.expire(120)

# To retrieve this customer with its primary key, we use `Customer.get()`:
assert Customer.get(andrew.pk) == andrew
```

**Ready to learn more?** Check out the [getting started](docs/getting_started.md) guide.

Or, continue reading to see how Redis OM makes data validation a snap.

## ✓ Validating Data With Your Model

Redis OM uses [Pydantic][pydantic-url] to validate data based on the type annotations you assign to fields in a model class.

This validation ensures that fields like `first_name`, which the `Customer` model marked as a `str`, are always strings. **But every Redis OM model is also a Pydantic model**, so you can use Pydantic validators like `EmailStr`, `Pattern`, and many more for complex validations!

For example, because we used the `EmailStr` type for the `email` field, we'll get a validation error if we try to create a `Customer` with an invalid email address:

```python
import datetime
from typing import Optional

from pydantic import EmailStr, ValidationError

from redis_om import HashModel


class Customer(HashModel):
    first_name: str
    last_name: str
    email: EmailStr
    join_date: datetime.date
    age: int
    bio: Optional[str]


try:
    Customer(
        first_name="Andrew",
        last_name="Brookins",
        email="Not an email address!",
        join_date=datetime.date.today(),
        age=38,
        bio="Python developer, works at Redis, Inc."
    )
except ValidationError as e:
    print(e)
    """
    pydantic.error_wrappers.ValidationError: 1 validation error for Customer
     email
       value is not a valid email address (type=value_error.email)
    """
```

**Any existing Pydantic validator should work** as a drop-in type annotation with a Redis OM model. You can also write arbitrarily complex custom validations!

To learn more, see the [documentation on data validation](docs/validation.md).

## 🔎 Rich Queries and Embedded Models

Data modeling, validation, and saving models to Redis all work regardless of how you run Redis.

Next, we'll show you the **rich query expressions** and **embedded models** Redis OM provides when the [RediSearch][redisearch-url] and [RedisJSON][redis-json-url] modules are installed in your Redis deployment, or you're using [Redis Enterprise][redis-enterprise-url].

**TIP**: *Wait, what's a Redis module?* If you aren't familiar with Redis modules, review the [So, How Do You Get RediSearch and RedisJSON?](#-so-how-do-you-get-redisearch-and-redisjson) section of this README.

### Querying

Redis OM comes with a rich query language that allows you to query Redis with Python expressions.

To show how this works, we'll make a small change to the `Customer` model we defined earlier. We'll add `Field(index=True)` to tell Redis OM that we want to index the `last_name` and `age` fields:

```python
import datetime
from typing import Optional

from pydantic import EmailStr

from redis_om import (
    Field,
    HashModel,
    Migrator
)


class Customer(HashModel):
    first_name: str
    last_name: str = Field(index=True)
    email: EmailStr
    join_date: datetime.date
    age: int = Field(index=True)
    bio: Optional[str]


# Now, if we use this model with a Redis deployment that has the
# RediSearch module installed, we can run queries like the following.

# Before running queries, we need to run migrations to set up the
# indexes that Redis OM will use. You can also use the `migrate`
# CLI tool for this!
Migrator().run()

# Find all customers with the last name "Brookins"
Customer.find(Customer.last_name == "Brookins").all()

# Find all customers that do NOT have the last name "Brookins"
Customer.find(Customer.last_name != "Brookins").all()

# Find all customers whose last name is "Brookins" OR whose age is
# 100 AND whose last name is "Smith"
Customer.find((Customer.last_name == "Brookins") | (
        Customer.age == 100
) & (Customer.last_name == "Smith")).all()
```

These queries -- and more! -- are possible because **Redis OM manages indexes for you automatically**.

Querying with this index features a rich expression syntax inspired by the Django ORM, SQLAlchemy, and Peewee. We think you'll enjoy it!

**Note:** Indexing only works for data stored in Redis logical database 0.  If you are using a different database number when connecting to Redis, you can expect the code to raise a `MigrationError` when you run the migrator.

### Embedded Models

Redis OM can store and query **nested models** like any document database, with the speed and power you get from Redis. Let's see how this works.

In the next example, we'll define a new `Address` model and embed it within the `Customer` model.

```python
import datetime
from typing import Optional

from redis_om import (
    EmbeddedJsonModel,
    JsonModel,
    Field,
    Migrator,
)


class Address(EmbeddedJsonModel):
    address_line_1: str
    address_line_2: Optional[str]
    city: str = Field(index=True)
    state: str = Field(index=True)
    country: str
    postal_code: str = Field(index=True)


class Customer(JsonModel):
    first_name: str = Field(index=True)
    last_name: str = Field(index=True)
    email: str = Field(index=True)
    join_date: datetime.date
    age: int = Field(index=True)
    bio: Optional[str] = Field(index=True, full_text_search=True,
                               default="")

    # Creates an embedded model.
    address: Address


# With these two models and a Redis deployment with the RedisJSON
# module installed, we can run queries like the following.

# Before running queries, we need to run migrations to set up the
# indexes that Redis OM will use. You can also use the `migrate`
# CLI tool for this!
Migrator().run()

# Find all customers who live in San Antonio, TX
Customer.find(Customer.address.city == "San Antonio",
              Customer.address.state == "TX")
```

## Calling Other Redis Commands

Sometimes you'll need to run a Redis command directly.  Redis OM supports this through the `db` method on your model's class.  This returns a connected Redis client instance which exposes a function named for each Redis command.  For example, let's perform some basic set operations:

```python
from redis_om import HashModel

class Demo(HashModel):
    some_field: str

redis_conn = Demo.db()

redis_conn.sadd("myset", "a", "b", "c", "d")

# Prints False
print(redis_conn.sismember("myset", "e"))

# Prints True
print(redis_conn.sismember("myset", "b"))
```

The parameters expected by each command function are those documented on the command's page on [redis.io](https://redis.io/commands/).

If you don't want to get a Redis connection from a model class, you can also use `get_redis_connection`:

```python
from redis_om import get_redis_connection

redis_conn = get_redis_connection()
redis_conn.set("hello", "world")
```

## 📚 Documentation

The Redis OM documentation is available [here](docs/index.md).

## ⛏️ Troubleshooting

If you run into trouble or have any questions, we're here to help!

Hit us up on the [Redis Discord Server](http://discord.gg/redis) or [open an issue on GitHub](https://github.com/redis-developer/redis-om-python/issues/new).

## ✨ So How Do You Get RediSearch and RedisJSON?

Some advanced features of Redis OM rely on core features from two source available Redis modules: [RediSearch][redisearch-url] and [RedisJSON][redis-json-url].

You can run these modules in your self-hosted Redis deployment, or you can use [Redis Enterprise][redis-enterprise-url], which includes both modules.

To learn more, read [our documentation](docs/redis_modules.md).

## ❤️ Contributing

We'd love your contributions!

**Bug reports** are especially helpful at this stage of the project. [You can open a bug report on GitHub](https://github.com/redis/redis-om-python/issues/new).

You can also **contribute documentation** -- or just let us know if something needs more detail. [Open an issue on GitHub](https://github.com/redis/redis-om-python/issues/new) to get started.

## 📝 License

Redis OM uses the [MIT license][license-url].

<!-- Badges -->

[version-svg]: https://img.shields.io/pypi/v/redis-om?style=flat-square
[package-url]: https://pypi.org/project/redis-om/
[ci-svg]: https://github.com/redis/redis-om-python/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/redis/redis-om-python/actions/workflows/ci.yml
[license-image]: https://img.shields.io/badge/license-mit-green.svg?style=flat-square
[license-url]: LICENSE
<!-- Links -->

[redis-om-website]: https://developer.redis.com
[redis-om-js]: https://github.com/redis-om/redis-om-js
[redis-om-dotnet]: https://github.com/redis-om/redis-om-dotnet
[redis-om-spring]: https://github.com/redis-om/redis-om-spring
[redisearch-url]: https://redis.io/docs/stack/search/
[redis-json-url]: https://redis.io/docs/stack/json/
[pydantic-url]: https://github.com/samuelcolvin/pydantic
[ulid-url]: https://github.com/ulid/spec
[redis-enterprise-url]: https://redis.com/try-free/

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/redis/redis-om-python",
    "name": "redis-om",
    "maintainer": "Redis OSS",
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": "oss@redis.com",
    "keywords": null,
    "author": "Redis OSS",
    "author_email": "oss@redis.com",
    "download_url": "https://files.pythonhosted.org/packages/f2/45/ea62581cbfa16f5a19ee6123519948f5ba4d9d096a056cd38c2e0d2c2c66/redis_om-0.2.2.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <br/>\n  <br/>\n  <img width=\"360\" src=\"https://raw.githubusercontent.com/redis-developer/redis-om-python/main/images/logo.svg?token=AAAXXHUYL6RHPESRRAMBJOLBSVQXE\" alt=\"Redis OM\" />\n  <br/>\n  <br/>\n</div>\n\n<p align=\"center\">\n    <p align=\"center\">\n        Object mapping, and more, for Redis and Python\n    </p>\n</p>\n\n---\n\n[![Version][version-svg]][package-url]\n[![License][license-image]][license-url]\n[![Build Status][ci-svg]][ci-url]\n\n**Redis OM Python** makes it easy to model Redis data in your Python applications.\n\n[Redis OM .NET](https://github.com/redis/redis-om-dotnet) | [Redis OM Node.js](https://github.com/redis/redis-om-node) | [Redis OM Spring](https://github.com/redis/redis-om-spring) | **Redis OM Python**\n\n<details>\n  <summary><strong>Table of contents</strong></summary>\n\nspan\n\n<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->\n\n- [\ud83d\udca1 Why Redis OM?](#-why-redis-om)\n- [\ud83d\udcbb Installation](#-installation)\n- [\ud83c\udfc1 Getting started](#-getting-started)\n- [\ud83d\udcc7 Modeling Your Data](#-modeling-your-data)\n- [\u2713 Validating Data With Your Model](#-validating-data-with-your-model)\n- [\ud83d\udd0e Rich Queries and Embedded Models](#-rich-queries-and-embedded-models)\n  - [Querying](#querying)\n  - [Embedded Models](#embedded-models)\n- [Calling Other Redis Commands](#calling-other-redis-commands)\n- [\ud83d\udcda Documentation](#-documentation)\n- [\u26cf\ufe0f Troubleshooting](#\ufe0f-troubleshooting)\n- [\u2728 So How Do You Get RediSearch and RedisJSON?](#-so-how-do-you-get-redisearch-and-redisjson)\n- [\u2764\ufe0f Contributing](#\ufe0f-contributing)\n- [\ud83d\udcdd License](#-license)\n\n<!-- END doctoc generated TOC please keep comment here to allow auto update -->\n\n</details>\n\n## \ud83d\udca1 Why Redis OM?\n\nRedis OM provides high-level abstractions that make it easy to model and query data in Redis with modern Python applications.\n\nThis **preview** release contains the following features:\n\n* Declarative object mapping for Redis objects\n* Declarative secondary-index generation\n* Fluent APIs for querying Redis\n\n## \ud83d\udcbb Installation\n\nInstallation is simple with `pip`, Poetry, or Pipenv.\n\n```sh\n# With pip\n$ pip install redis-om\n\n# Or, using Poetry\n$ poetry add redis-om\n```\n\n## \ud83c\udfc1 Getting started\n\n### Starting Redis\n\nBefore writing any code you'll need a Redis instance with the appropriate Redis modules! The quickest way to get this is with Docker:\n\n```sh\ndocker run -p 6379:6379 -p 8001:8001 redis/redis-stack\n```\n\nThis launches the [redis-stack](https://redis.io/docs/stack/) an extension of Redis that adds all manner of modern data structures to Redis. You'll also notice that if you open up http://localhost:8001 you'll have access to the redis-insight GUI, a GUI you can use to visualize and work with your data in Redis.\n\n\n## \ud83d\udcc7 Modeling Your Data\n\nRedis OM contains powerful declarative models that give you data validation, serialization, and persistence to Redis.\n\nCheck out this example of modeling customer data with Redis OM. First, we create a `Customer` model:\n\n```python\nimport datetime\nfrom typing import Optional\n\nfrom pydantic import EmailStr\n\nfrom redis_om import HashModel\n\n\nclass Customer(HashModel):\n    first_name: str\n    last_name: str\n    email: EmailStr\n    join_date: datetime.date\n    age: int\n    bio: Optional[str]\n```\n\nNow that we have a `Customer` model, let's use it to save customer data to Redis.\n\n```python\nimport datetime\nfrom typing import Optional\n\nfrom pydantic import EmailStr\n\nfrom redis_om import HashModel\n\n\nclass Customer(HashModel):\n    first_name: str\n    last_name: str\n    email: EmailStr\n    join_date: datetime.date\n    age: int\n    bio: Optional[str]\n\n\n# First, we create a new `Customer` object:\nandrew = Customer(\n    first_name=\"Andrew\",\n    last_name=\"Brookins\",\n    email=\"andrew.brookins@example.com\",\n    join_date=datetime.date.today(),\n    age=38,\n    bio=\"Python developer, works at Redis, Inc.\"\n)\n\n# The model generates a globally unique primary key automatically\n# without needing to talk to Redis.\nprint(andrew.pk)\n# > \"01FJM6PH661HCNNRC884H6K30C\"\n\n# We can save the model to Redis by calling `save()`:\nandrew.save()\n\n# Expire the model after 2 mins (120 seconds)\nandrew.expire(120)\n\n# To retrieve this customer with its primary key, we use `Customer.get()`:\nassert Customer.get(andrew.pk) == andrew\n```\n\n**Ready to learn more?** Check out the [getting started](docs/getting_started.md) guide.\n\nOr, continue reading to see how Redis OM makes data validation a snap.\n\n## \u2713 Validating Data With Your Model\n\nRedis OM uses [Pydantic][pydantic-url] to validate data based on the type annotations you assign to fields in a model class.\n\nThis validation ensures that fields like `first_name`, which the `Customer` model marked as a `str`, are always strings. **But every Redis OM model is also a Pydantic model**, so you can use Pydantic validators like `EmailStr`, `Pattern`, and many more for complex validations!\n\nFor example, because we used the `EmailStr` type for the `email` field, we'll get a validation error if we try to create a `Customer` with an invalid email address:\n\n```python\nimport datetime\nfrom typing import Optional\n\nfrom pydantic import EmailStr, ValidationError\n\nfrom redis_om import HashModel\n\n\nclass Customer(HashModel):\n    first_name: str\n    last_name: str\n    email: EmailStr\n    join_date: datetime.date\n    age: int\n    bio: Optional[str]\n\n\ntry:\n    Customer(\n        first_name=\"Andrew\",\n        last_name=\"Brookins\",\n        email=\"Not an email address!\",\n        join_date=datetime.date.today(),\n        age=38,\n        bio=\"Python developer, works at Redis, Inc.\"\n    )\nexcept ValidationError as e:\n    print(e)\n    \"\"\"\n    pydantic.error_wrappers.ValidationError: 1 validation error for Customer\n     email\n       value is not a valid email address (type=value_error.email)\n    \"\"\"\n```\n\n**Any existing Pydantic validator should work** as a drop-in type annotation with a Redis OM model. You can also write arbitrarily complex custom validations!\n\nTo learn more, see the [documentation on data validation](docs/validation.md).\n\n## \ud83d\udd0e Rich Queries and Embedded Models\n\nData modeling, validation, and saving models to Redis all work regardless of how you run Redis.\n\nNext, we'll show you the **rich query expressions** and **embedded models** Redis OM provides when the [RediSearch][redisearch-url] and [RedisJSON][redis-json-url] modules are installed in your Redis deployment, or you're using [Redis Enterprise][redis-enterprise-url].\n\n**TIP**: *Wait, what's a Redis module?* If you aren't familiar with Redis modules, review the [So, How Do You Get RediSearch and RedisJSON?](#-so-how-do-you-get-redisearch-and-redisjson) section of this README.\n\n### Querying\n\nRedis OM comes with a rich query language that allows you to query Redis with Python expressions.\n\nTo show how this works, we'll make a small change to the `Customer` model we defined earlier. We'll add `Field(index=True)` to tell Redis OM that we want to index the `last_name` and `age` fields:\n\n```python\nimport datetime\nfrom typing import Optional\n\nfrom pydantic import EmailStr\n\nfrom redis_om import (\n    Field,\n    HashModel,\n    Migrator\n)\n\n\nclass Customer(HashModel):\n    first_name: str\n    last_name: str = Field(index=True)\n    email: EmailStr\n    join_date: datetime.date\n    age: int = Field(index=True)\n    bio: Optional[str]\n\n\n# Now, if we use this model with a Redis deployment that has the\n# RediSearch module installed, we can run queries like the following.\n\n# Before running queries, we need to run migrations to set up the\n# indexes that Redis OM will use. You can also use the `migrate`\n# CLI tool for this!\nMigrator().run()\n\n# Find all customers with the last name \"Brookins\"\nCustomer.find(Customer.last_name == \"Brookins\").all()\n\n# Find all customers that do NOT have the last name \"Brookins\"\nCustomer.find(Customer.last_name != \"Brookins\").all()\n\n# Find all customers whose last name is \"Brookins\" OR whose age is\n# 100 AND whose last name is \"Smith\"\nCustomer.find((Customer.last_name == \"Brookins\") | (\n        Customer.age == 100\n) & (Customer.last_name == \"Smith\")).all()\n```\n\nThese queries -- and more! -- are possible because **Redis OM manages indexes for you automatically**.\n\nQuerying with this index features a rich expression syntax inspired by the Django ORM, SQLAlchemy, and Peewee. We think you'll enjoy it!\n\n**Note:** Indexing only works for data stored in Redis logical database 0.  If you are using a different database number when connecting to Redis, you can expect the code to raise a `MigrationError` when you run the migrator.\n\n### Embedded Models\n\nRedis OM can store and query **nested models** like any document database, with the speed and power you get from Redis. Let's see how this works.\n\nIn the next example, we'll define a new `Address` model and embed it within the `Customer` model.\n\n```python\nimport datetime\nfrom typing import Optional\n\nfrom redis_om import (\n    EmbeddedJsonModel,\n    JsonModel,\n    Field,\n    Migrator,\n)\n\n\nclass Address(EmbeddedJsonModel):\n    address_line_1: str\n    address_line_2: Optional[str]\n    city: str = Field(index=True)\n    state: str = Field(index=True)\n    country: str\n    postal_code: str = Field(index=True)\n\n\nclass Customer(JsonModel):\n    first_name: str = Field(index=True)\n    last_name: str = Field(index=True)\n    email: str = Field(index=True)\n    join_date: datetime.date\n    age: int = Field(index=True)\n    bio: Optional[str] = Field(index=True, full_text_search=True,\n                               default=\"\")\n\n    # Creates an embedded model.\n    address: Address\n\n\n# With these two models and a Redis deployment with the RedisJSON\n# module installed, we can run queries like the following.\n\n# Before running queries, we need to run migrations to set up the\n# indexes that Redis OM will use. You can also use the `migrate`\n# CLI tool for this!\nMigrator().run()\n\n# Find all customers who live in San Antonio, TX\nCustomer.find(Customer.address.city == \"San Antonio\",\n              Customer.address.state == \"TX\")\n```\n\n## Calling Other Redis Commands\n\nSometimes you'll need to run a Redis command directly.  Redis OM supports this through the `db` method on your model's class.  This returns a connected Redis client instance which exposes a function named for each Redis command.  For example, let's perform some basic set operations:\n\n```python\nfrom redis_om import HashModel\n\nclass Demo(HashModel):\n    some_field: str\n\nredis_conn = Demo.db()\n\nredis_conn.sadd(\"myset\", \"a\", \"b\", \"c\", \"d\")\n\n# Prints False\nprint(redis_conn.sismember(\"myset\", \"e\"))\n\n# Prints True\nprint(redis_conn.sismember(\"myset\", \"b\"))\n```\n\nThe parameters expected by each command function are those documented on the command's page on [redis.io](https://redis.io/commands/).\n\nIf you don't want to get a Redis connection from a model class, you can also use `get_redis_connection`:\n\n```python\nfrom redis_om import get_redis_connection\n\nredis_conn = get_redis_connection()\nredis_conn.set(\"hello\", \"world\")\n```\n\n## \ud83d\udcda Documentation\n\nThe Redis OM documentation is available [here](docs/index.md).\n\n## \u26cf\ufe0f Troubleshooting\n\nIf you run into trouble or have any questions, we're here to help!\n\nHit us up on the [Redis Discord Server](http://discord.gg/redis) or [open an issue on GitHub](https://github.com/redis-developer/redis-om-python/issues/new).\n\n## \u2728 So How Do You Get RediSearch and RedisJSON?\n\nSome advanced features of Redis OM rely on core features from two source available Redis modules: [RediSearch][redisearch-url] and [RedisJSON][redis-json-url].\n\nYou can run these modules in your self-hosted Redis deployment, or you can use [Redis Enterprise][redis-enterprise-url], which includes both modules.\n\nTo learn more, read [our documentation](docs/redis_modules.md).\n\n## \u2764\ufe0f Contributing\n\nWe'd love your contributions!\n\n**Bug reports** are especially helpful at this stage of the project. [You can open a bug report on GitHub](https://github.com/redis/redis-om-python/issues/new).\n\nYou can also **contribute documentation** -- or just let us know if something needs more detail. [Open an issue on GitHub](https://github.com/redis/redis-om-python/issues/new) to get started.\n\n## \ud83d\udcdd License\n\nRedis OM uses the [MIT license][license-url].\n\n<!-- Badges -->\n\n[version-svg]: https://img.shields.io/pypi/v/redis-om?style=flat-square\n[package-url]: https://pypi.org/project/redis-om/\n[ci-svg]: https://github.com/redis/redis-om-python/actions/workflows/ci.yml/badge.svg\n[ci-url]: https://github.com/redis/redis-om-python/actions/workflows/ci.yml\n[license-image]: https://img.shields.io/badge/license-mit-green.svg?style=flat-square\n[license-url]: LICENSE\n<!-- Links -->\n\n[redis-om-website]: https://developer.redis.com\n[redis-om-js]: https://github.com/redis-om/redis-om-js\n[redis-om-dotnet]: https://github.com/redis-om/redis-om-dotnet\n[redis-om-spring]: https://github.com/redis-om/redis-om-spring\n[redisearch-url]: https://redis.io/docs/stack/search/\n[redis-json-url]: https://redis.io/docs/stack/json/\n[pydantic-url]: https://github.com/samuelcolvin/pydantic\n[ulid-url]: https://github.com/ulid/spec\n[redis-enterprise-url]: https://redis.com/try-free/\n",
    "bugtrack_url": null,
    "license": "BSD-3-Clause",
    "summary": "Object mappings, and more, for Redis.",
    "version": "0.2.2",
    "project_urls": {
        "Code": "https://github.com/redis/redis-om-python",
        "Homepage": "https://github.com/redis/redis-om-python",
        "Issue tracker": "https://github.com/redis/redis-om-python/issues",
        "Repository": "https://github.com/redis/redis-om-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6b7dd288cbe37c58b3a10cbb727f20e0dd4e8e58a92f5587b45753dad3e03177",
                "md5": "683fe3747bb83bf746bbccbde97fbcb4",
                "sha256": "f395db665f1829e8beef9b23cb74ec397107c73216162900ff4c8563b0bee6a9"
            },
            "downloads": -1,
            "filename": "redis_om-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "683fe3747bb83bf746bbccbde97fbcb4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 81193,
            "upload_time": "2024-03-26T18:35:22",
            "upload_time_iso_8601": "2024-03-26T18:35:22.785129Z",
            "url": "https://files.pythonhosted.org/packages/6b/7d/d288cbe37c58b3a10cbb727f20e0dd4e8e58a92f5587b45753dad3e03177/redis_om-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f245ea62581cbfa16f5a19ee6123519948f5ba4d9d096a056cd38c2e0d2c2c66",
                "md5": "6925c39911903eb5956b24120a1ebac7",
                "sha256": "335eeafcec35f8db15c4ee384b22c115b3040bca93a8a218bbdd965b4c65cb5b"
            },
            "downloads": -1,
            "filename": "redis_om-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6925c39911903eb5956b24120a1ebac7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 73479,
            "upload_time": "2024-03-26T18:35:24",
            "upload_time_iso_8601": "2024-03-26T18:35:24.548868Z",
            "url": "https://files.pythonhosted.org/packages/f2/45/ea62581cbfa16f5a19ee6123519948f5ba4d9d096a056cd38c2e0d2c2c66/redis_om-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-26 18:35:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "redis",
    "github_project": "redis-om-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "redis-om"
}
        
Elapsed time: 0.23940s