# Conditions

<figure><img src="https://4288317371-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FveRuoMEtNVBfpya4JHlo%2Fuploads%2FjXi9wXw3A0Fimb4JuhNc%2Fconditions.png?alt=media&#x26;token=b6d4dd28-136f-41a7-99dc-7f85ebd358bc" 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="conditions/type-conditions" %}
[type-conditions](https://pystreamapi.pickwicksoft.org/reference/conditions/type-conditions)
{% endcontent-ref %}

### Numeric conditions

{% content-ref url="conditions/numeric-conditions" %}
[numeric-conditions](https://pystreamapi.pickwicksoft.org/reference/conditions/numeric-conditions)
{% endcontent-ref %}

### String conditions

{% content-ref url="conditions/string-conditions" %}
[string-conditions](https://pystreamapi.pickwicksoft.org/reference/conditions/string-conditions)
{% endcontent-ref %}

### Date conditions

{% content-ref url="conditions/date-conditions" %}
[date-conditions](https://pystreamapi.pickwicksoft.org/reference/conditions/date-conditions)
{% 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: 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:

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

The question should be specific, self-contained, and written in natural language.
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.
