Pyscicat
Pyscicat is a python client library for interacting with the SciCat backend. It sends messages to the SciCat backend over HTTP. It currently does not contain any command line interface.
Documentation for Pyscicat is available here.
Basic usage example
from datetime import datetime
from pyscicat.client import ScicatClient
from pyscicat.model import (Ownable, RawDataset, DatasetType, Sample)
# Create a client object. The account used should have the ingestor role in SciCat
client = ScicatClient(base_url="http://localhost/api/v3", username="admin", password="2jf70TPNZsS")
ownable = Ownable(ownerGroup="aGroup", accessGroups=[])
# Create a Dataset object. Notice how we pass the `ownable` instance.
dataset = RawDataset(
size=42,
owner="ingestor",
contactEmail="scicatingestor@your.site",
creationLocation="magrathea",
creationTime=str(datetime.now().isoformat()),
instrumentId="earth",
proposalId="deepthought",
dataFormat="planet",
type=DatasetType.raw,
principalInvestigator="admin",
sourceFolder="/foo/bar",
scientificMetadata={"a": "field"},
sampleId="gargleblaster",
**ownable.model_dump(),
)
dataset_id = client.datasets_create(dataset)
sample = Sample(
sampleId="gargleblaster",
owner="Chamber of Commerce",
description="A legendary drink.",
sampleCharacteristics={"Flavour": "Unknown, but potent"},
isPublished=False,
**ownable.model_dump()
)
sample_id = client.samples_create(sample)
Notes
To develop with SciCatLive, connect to your local running instance with:
client = ScicatClient(base_url="http://localhost/api/v3", username="admin", password="2jf70TPNZsS", auto_login=False)
client._headers["Host"] = "backend.localhost"
client.login()
Then use the client normally.
Metadata
Release files for pyscicat 0.4.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyscicat-0.4.8.tar.gz | 129.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyscicat-0.4.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 147.5 kB
Release files / pyscicat-0.4.8.tar.gz
| Download URL | pyscicat-0.4.8.tar.gz |
|---|---|
| Size | 129.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f32988a2adac1f49475289e0793ecd62fd9fb695ecffad4da36de584d7c1d37
|
|
BLAKE2b-256 checksum How to use checksums |
393cfe1e90dad39ac3037ba057daf3811e4cf4995838a2150d44fce6e554340c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|
Release files / pyscicat-0.4.8-py3-none-any.whl
| Download URL | pyscicat-0.4.8-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb67f29094551f3f0e14350d73b899021d02fb5eb1cd839490b3d2c529e203ac
|
|
BLAKE2b-256 checksum How to use checksums |
470b2e9001fdd19a5b5c1864f57d90f2ff15eaafd9c04e2888448af0980de1cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.12
|