{"id":25895433,"url":"https://github.com/diamondlightsource/ispyb-api","last_synced_at":"2026-02-17T11:20:55.842Z","repository":{"id":11408083,"uuid":"85876095","full_name":"DiamondLightSource/ispyb-api","owner":"DiamondLightSource","description":"Package for writing acquisition and processing results into an ISPyB database","archived":false,"fork":false,"pushed_at":"2025-02-18T11:39:54.000Z","size":1697,"stargazers_count":7,"open_issues_count":8,"forks_count":11,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-02-18T12:36:11.495Z","etag":null,"topics":["database","ispyb","mariadb","mysql","python","stored-procedures"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DiamondLightSource.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":"docs/contributing.rst","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-22T21:05:44.000Z","updated_at":"2025-02-14T12:05:55.000Z","dependencies_parsed_at":"2024-01-09T16:27:41.189Z","dependency_job_id":"9c90c92a-0a13-4194-aade-c40d81bb36b1","html_url":"https://github.com/DiamondLightSource/ispyb-api","commit_stats":{"total_commits":746,"total_committers":20,"mean_commits":37.3,"dds":0.6099195710455765,"last_synced_commit":"5c1a8f2652e1ad4e334fac04c905123dd072d1a0"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fispyb-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fispyb-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fispyb-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiamondLightSource%2Fispyb-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiamondLightSource","download_url":"https://codeload.github.com/DiamondLightSource/ispyb-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241582517,"owners_count":19985845,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","ispyb","mariadb","mysql","python","stored-procedures"],"created_at":"2025-03-02T22:31:20.697Z","updated_at":"2026-02-17T11:20:55.836Z","avatar_url":"https://github.com/DiamondLightSource.png","language":"Python","readme":"[![PyPI version](https://img.shields.io/pypi/v/ispyb.svg)](https://pypi.python.org/pypi/ispyb)\n[![Conda Version](https://img.shields.io/conda/vn/conda-forge/ispyb.svg)](https://anaconda.org/conda-forge/ispyb)\n[![Development status](https://img.shields.io/pypi/status/ispyb.svg)](https://pypi.python.org/pypi/ispyb)\n[![Python versions](https://img.shields.io/pypi/pyversions/ispyb.svg)](https://pypi.python.org/pypi/ispyb)\n\n[![Documentation Status](https://readthedocs.org/projects/ispyb/badge/?version=latest)](https://ispyb.readthedocs.io/en/latest/?badge=latest)\n![Code style: ruff](https://img.shields.io/badge/code%20style-ruff-000000.svg)\n\n# ISPyB API\n\nThis package provides a way to write acquisition and processing results into\nan ISPyB database. Currently, the only supported method is through stored\nprocedures, but the package is designed to allow for other methods as well, such\nas webservices.\n\n### Documentation\nPlease see https://ispyb.readthedocs.io.\n\n### Requirements\n* Python 3.10 (minimum), 3.11, 3.12, 3.13 (recommended)\n* The MySQL Connector/Python package.\n* MariaDB 10.0+ or MySQL 5.6+, but we recommend MariaDB 10.2 or later.\n* An ISPyB database installed on the above. See the [ispyb-database](https://github.com/DiamondLightSource/ispyb-database) repository for details.\n\n### Installation\nFrom PyPI:\n```bash\npip install --user ispyb\n```\nThe `--user` option installs the package for your own user only.\nYou can leave it out if you want to install the package system-wide.\n\nTo install the source code in editable mode for development:\n```bash\ngit clone git@github.com:DiamondLightSource/ispyb-api.git\npip install --user -e ispyb-api\n```\n\n### Examples\n```python\nimport ispyb\nfrom datetime import datetime\n\n# Get a connection and data area objects\nwith ispyb.open(\"config.cfg\") as conn:\n    core = conn.core\n    mx_acquisition = conn.mx_acquisition\n\n    # Find the id for a given visit\n    sessionid = core.retrieve_visit_id(\"cm14451-2\")\n\n    # Create a new data collection group entry:\n    params = mx_acquisition.get_data_collection_group_params()\n    params[\"parentid\"] = sessionid\n    params[\"experimenttype\"] = \"OSC\"\n    params[\"starttime\"] = datetime.strptime(\"2017-09-21 13:00:00\", \"%Y-%m-%d %H:%M:%S\")\n    params[\"endtime\"] = datetime.strptime(\"2017-09-21 13:00:10\", \"%Y-%m-%d %H:%M:%S\")\n    params[\"comments\"] = \"This is a test of data collection group.\"\n    dcg_id = mx_acquisition.insert_data_collection_group(list(params.values()))\n    print(\"dcg_id: %i\" % dcg_id)\n```\n\nSee [`docs/pipeline2ispyb.py`](https://github.com/DiamondLightSource/ispyb-api/blob/main/docs/pipeline2ispyb.py) for a more detailed example of how to use the package.\n\n### Tests\nUnit 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.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Fispyb-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiamondlightsource%2Fispyb-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiamondlightsource%2Fispyb-api/lists"}