Skip to main content

PyPI version Conda Version Development status Python versions

Documentation Status Code style: ruff

ISPyB API

This package provides a way to write acquisition and processing results into an ISPyB database. Currently, the only supported method is through stored procedures, but the package is designed to allow for other methods as well, such as webservices.

Documentation

Please see https://ispyb.readthedocs.io.

Requirements

  • Python 3.10 (minimum), 3.11, 3.12, 3.13 (recommended)
  • The MySQL Connector/Python package.
  • MariaDB 10.0+ or MySQL 5.6+, but we recommend MariaDB 10.2 or later.
  • An ISPyB database installed on the above. See the ispyb-database repository for details.

Installation

From PyPI:

pip install --user ispyb

The --user option installs the package for your own user only. You can leave it out if you want to install the package system-wide.

To install the source code in editable mode for development:

git clone git@github.com:DiamondLightSource/ispyb-api.git
pip install --user -e ispyb-api

Examples

import ispyb
from datetime import datetime

# Get a connection and data area objects
with ispyb.open("config.cfg") as conn:
    core = conn.core
    mx_acquisition = conn.mx_acquisition

    # Find the id for a given visit
    sessionid = core.retrieve_visit_id("cm14451-2")

    # Create a new data collection group entry:
    params = mx_acquisition.get_data_collection_group_params()
    params["parentid"] = sessionid
    params["experimenttype"] = "OSC"
    params["starttime"] = datetime.strptime("2017-09-21 13:00:00", "%Y-%m-%d %H:%M:%S")
    params["endtime"] = datetime.strptime("2017-09-21 13:00:10", "%Y-%m-%d %H:%M:%S")
    params["comments"] = "This is a test of data collection group."
    dcg_id = mx_acquisition.insert_data_collection_group(list(params.values()))
    print("dcg_id: %i" % dcg_id)

See docs/pipeline2ispyb.py for a more detailed example of how to use the package.

Tests

Unit tests (pytests) are run automatically by Azure against a real MariaDB ISPyB database schema. You can also run the tests in your Development environment if you have an ISPyB database.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ispyb-12.1.1.tar.gz (93.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ispyb-12.1.1-py3-none-any.whl (89.2 kB view details)

Uploaded Python 3

File details

Details for the file ispyb-12.1.1.tar.gz.

File metadata

  • Download URL: ispyb-12.1.1.tar.gz
  • Upload date:
  • Size: 93.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ispyb-12.1.1.tar.gz
Algorithm Hash digest
SHA256 e15d3111a504e19722c071470c346b53cef03c373a61ed8d8d5ce16d825b7ad8
MD5 e059681368eff69b403fa883e0817b4f
BLAKE2b-256 4d040f89a5db4d8e03283097416abbba86f0446b91db175785859ffe33163178

See more details on using hashes here.

Provenance

The following attestation bundles were made for ispyb-12.1.1.tar.gz:

Publisher: test-and-publish.yml on DiamondLightSource/ispyb-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ispyb-12.1.1-py3-none-any.whl.

File metadata

  • Download URL: ispyb-12.1.1-py3-none-any.whl
  • Upload date:
  • Size: 89.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ispyb-12.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8f4016ac19473250d94ed47a4626ef6fc352aabd984672e9db5151f4c7e930ba
MD5 89ee638378d01163316d517b8f8844ca
BLAKE2b-256 cc496adba26c826fe517f32be07c3144fb2f1cf70720dda7e5e4f26da21dfd3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for ispyb-12.1.1-py3-none-any.whl:

Publisher: test-and-publish.yml on DiamondLightSource/ispyb-api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

12.1.1 This release

2 files

12.1.0

2 files

12.0.0

2 files

11.1.2

2 files

11.1.1

2 files

11.1.0

2 files

11.0.5

2 files

11.0.4

2 files

11.0.3

2 files

11.0.2

2 files

11.0.1

2 files

11.0.0

2 files

10.2.4

2 files

10.2.3

2 files

10.0.0

2 files

9.0.0

2 files

8.0.1

2 files

8.0.0

2 files

7.2.0

2 files

7.1.2

2 files

7.1.0

2 files

7.0.0

2 files

6.13.0

2 files

6.12.1

2 files

6.12.0

2 files

6.11.0

2 files

6.10.0

2 files

6.9.0

2 files

6.8.0

2 files

6.7.0

2 files

6.6.0

2 files

6.5.0

2 files

6.4.0

2 files

6.3.0

2 files

6.2.0

2 files

6.1.1

2 files

6.1.0

2 files

6.0.2

2 files

6.0.1

2 files

6.0.0

2 files

5.9.1

2 files

5.9.0

2 files

5.8.1

2 files

5.8.0

2 files

5.7.1

2 files

5.7.0

2 files

5.6.2

2 files

5.6.1

2 files

5.6.0

2 files

5.5.0

2 files

5.4.1

2 files

5.4.0

2 files

5.3.0

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.0

2 files

4.13.2

2 files

4.13.1

2 files

4.13.0

2 files

4.12.0

2 files

4.11.1

2 files

4.11.0

2 files

4.10.0

2 files

4.9.0

2 files

4.8.0

2 files

4.7.1

2 files

4.7.0

2 files

4.6.0

2 files

4.5.0

2 files

4.4.0

2 files

4.3.0

2 files

4.1.0

2 files

4.0.0

2 files

3.3.0

2 files

3.2.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0.0

2 files

0.16

2 files

0.15

2 files

0.14

3 files

0.13

2 files

0.12

2 files

0.11

2 files

0.10

2 files

0.8

2 files

0.7

2 files

0.5

1 file

0.4

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page