Metadata-Version: 2.1
Name: arkitekt
Version: 0.7.8
Summary: client for the arkitekt platform
License: MIT
Author: jhnnsrs
Author-email: jhnnsrs@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Provides-Extra: all
Provides-Extra: cli
Provides-Extra: extended
Provides-Extra: fluss
Provides-Extra: kluster
Provides-Extra: mikro
Provides-Extra: mikro-next
Provides-Extra: next
Provides-Extra: omero
Provides-Extra: reaktion
Provides-Extra: rekuest
Provides-Extra: unlok
Requires-Dist: dokker (>=0.1.21)
Requires-Dist: fakts (>=0.4.1)
Requires-Dist: fluss (>=0.1.61) ; extra == "fluss" or extra == "all" or extra == "extended"
Requires-Dist: herre (>=0.4.3)
Requires-Dist: kluster (>=0.0.3) ; (python_version >= "3.9" and python_version < "4.0") and (extra == "kluster" or extra == "extended")
Requires-Dist: koil (>=0.3.6)
Requires-Dist: mikro (>=0.3.95) ; extra == "mikro" or extra == "all" or extra == "extended"
Requires-Dist: mikro-next (>=0.1.6) ; (python_version >= "3.10" and python_version < "4.0") and (extra == "mikro-next" or extra == "next")
Requires-Dist: omero-ark (>=0.0.4) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "omero" or extra == "extended")
Requires-Dist: reaktion (>=0.1.50) ; (python_version >= "3.8" and python_version < "4.0") and (extra == "reaktion" or extra == "all" or extra == "extended")
Requires-Dist: rekuest (>=0.2.29) ; extra == "cli" or extra == "rekuest" or extra == "all" or extra == "extended"
Requires-Dist: rich-click (>=1.6.1) ; extra == "cli" or extra == "all" or extra == "extended"
Requires-Dist: semver (>=3.0.1) ; extra == "cli" or extra == "all" or extra == "extended"
Requires-Dist: turms (>=0.5.0) ; (python_version >= "3.9" and python_version < "4.0") and (extra == "cli" or extra == "all" or extra == "extended")
Requires-Dist: unlok (>=0.1.19) ; extra == "unlok" or extra == "all" or extra == "extended"
Requires-Dist: watchfiles (>=0.18.1) ; extra == "cli" or extra == "all" or extra == "extended"
Description-Content-Type: text/markdown

# arkitekt

[![codecov](https://codecov.io/gh/jhnnsrs/arkitekt/branch/master/graph/badge.svg?token=UGXEA2THBV)](https://codecov.io/gh/jhnnsrs/arkitekt)
[![PyPI version](https://badge.fury.io/py/arkitekt.svg)](https://pypi.org/project/arkitekt/)
[![Maintenance](https://img.shields.io/badge/Maintained%3F-yes-green.svg)](https://pypi.org/project/arkitekt/)
![Maintainer](https://img.shields.io/badge/maintainer-jhnnsrs-blue)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/arkitekt.svg)](https://pypi.python.org/pypi/arkitekt/)
[![PyPI status](https://img.shields.io/pypi/status/arkitekt.svg)](https://pypi.python.org/pypi/arkitekt/)

streaming analysis for mikroscopy

## Idea

arkitekt is the python client for the arkitekt platform. It allows you to utilize the full extent of the platform from your python code.
To understand the idea behind arkitekt, you need to understand the idea behind the arkitekt platform.
(More on this in the [documentation](https://arkitekt.live))

## Features

- Host your python functions and make them to your team
- Use functions from your team in your code
- Interact with and store data in a secure and scalable way on the platform
- Use the platform as a central storage for your data

## Install

```bash
pip install arkitekt[all]
```

This installs all dependencies for the arkitekt platform, inlcuding the arkitekt CLI, which can be used to develop and create apps, containerize them and deploy t


arkitekt is relying heavily on asyncio patters and therfore supports python 3.8 and above. It also relies on the pydantic stack for serialization.


## App 

You can use the cli to create python based apps for the arkitekt platform, profiting from a battery of features like easy GUI creation based on
type annotations, orchestration of real-time (in memoery) workflows, data hosting,  easy packaging and distribution in docker containers, etc...

To get started create a directory and run

```bash
arkitekt init
```

Which will lead you throught an app creation process.
Apps can simply registered functions, through the register decorator

```python
from arkitekt import register

@register()
def rpc_function(x: int, name: str) -> str
    """
    A rpc function that we can
    simple call from anywhere

    ""

```

And then connected to a local or remote server by running

Run example:

```bash
arkitekt run dev
```


For more details on how to create an app follow the tutorials on https://arkitekt.live.

## Usage with complex Datastructures

Arkitekt takes care of serialization and documentation of standard python datastructures

- str
- bool
- int
- float
- Enum
- Dict
- List

To increase performance and reduce latency it is not possible to serialize complex python objects like numpy arrays into the messages. These are best transformed into immutable objects on a centrally accessible storage and then only the reference is passed.

Arkitekt does not impose any rules on how you handle this storage (see mikro for ideas), it provides however a simple api.

```python

class ComplexStructure:
    id: str # A reference for this structure on central storage

    async def shrink(self):
        return self.id

    @classmethod
    async def expand(cls, value):
        return cls.load_from_server(value)


```

by providing two functions:

- shrink
- expand

You can now use this Structure with simple typehints and arkitekt will automaticall shrink (serialize) and expand (deserialize) the structure on calling.

```python

def complex_call(x: ComplexStrucuture) -> int:
    return x.max()

```



Check out the arkitekt [documentation](https://arkitekt.live) for usage of this libary


