Fricon
Python client for the fridge control system.
Current features
- Data storage.
Usage
Install via PyPI:
Initialize workspace via CLI:
Start the server:
Create a dataset:
examples/simple/create.py
from fricon import Trace, Workspace
ws = Workspace.connect("path/to/workspace")
manager = ws.dataset_manager
with manager.create("example_dataset") as writer:
writer.write(
i=1,
a="Alice",
b=[1, 2],
c=["A", "B"],
d=Trace.fixed_step(0.1, 1.1, [1, 2, 3]),
)
print(f"Id of the dataset: {writer.id}")
Query and open a dataset:
examples/simple/open.py
from fricon import Workspace
ws = Workspace.connect("path/to/workspace")
manager = ws.dataset_manager
df_index = manager.list_all() # Returns a pandas DataFrame
id_ = df_index.loc[0, "id"] # Records are in descending order of creation
assert isinstance(id_, int)
dataset = manager.open(id_)
print(dataset.id)
pl_dset = dataset.to_polars()