> For the complete documentation index, see [llms.txt](https://pystreamapi.pickwicksoft.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pystreamapi.pickwicksoft.org/reference/conditions.md).

# Conditions

<figure><img src="/files/aluBeqYtSh1RcMNAGNYI" alt=""><figcaption></figcaption></figure>

PyStreamAPI presents four distinct groups of conditions for your convenience. Within these groups, you'll find a variety of conditions with varying parameters. For instance, certain conditions like `even()` do not require any parameters, while others such as `less_than(n)` involve specifying a single parameter.&#x20;

Moreover, PyStreamAPI provides a single combiner that empowers you to seamlessly merge multiple conditions, thereby enhancing your ability to manipulate data more effectively.

### Import

All conditions can be imported from:

```python
from pystreamapi.conditions import …
```

In order to import all conditions from a specific group, use these imports:

```python
from pystreamapi.conditions.numeric import *
from pystreamapi.conditions.types import *
from pystreamapi.conditions.string import *
from pystreamapi.conditions.date import *
```

### Type conditions

{% content-ref url="/pages/27yiiY2oL2yiPs06ahBi" %}
[Type Conditions](/reference/conditions/type-conditions.md)
{% endcontent-ref %}

### Numeric conditions

{% content-ref url="/pages/pJKRsTAhCAJ15tVbhBo3" %}
[Numeric Conditions](/reference/conditions/numeric-conditions.md)
{% endcontent-ref %}

### String conditions

{% content-ref url="/pages/BcTTtIqWnFqUdsyZ5P2G" %}
[String Conditions](/reference/conditions/string-conditions.md)
{% endcontent-ref %}

### Date conditions

{% content-ref url="/pages/nN7X1r2oL5ganzw1pLz1" %}
[Date conditions](/reference/conditions/date-conditions.md)
{% endcontent-ref %}

### Combiner

`one_of(*conditions)` checks if one of the given conditions are fulfilled. You can pass as many conditions as you want.

```python
from pystreamapi import Stream
from pystreamapi.conditions import prime, even, one_of

Stream.of([1, 2, 3, 4, 5]) \
    .filter(one_of(even(), prime())) \
    .for_each(print)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://pystreamapi.pickwicksoft.org/reference/conditions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
