{"id":21721353,"url":"https://github.com/informaticsmatters/squonk2-python-client","last_synced_at":"2025-07-22T22:05:29.088Z","repository":{"id":41221893,"uuid":"472868844","full_name":"InformaticsMatters/squonk2-python-client","owner":"InformaticsMatters","description":"Data Manager API Utilities","archived":false,"fork":false,"pushed_at":"2025-07-08T10:23:11.000Z","size":224,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"5.0","last_synced_at":"2025-07-08T10:30:38.169Z","etag":null,"topics":["squonk2"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InformaticsMatters.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2022-03-22T17:31:26.000Z","updated_at":"2025-07-08T10:17:48.000Z","dependencies_parsed_at":"2024-12-09T16:20:59.461Z","dependency_job_id":"65f93234-d3a1-461b-8dd7-51ebddd914d0","html_url":"https://github.com/InformaticsMatters/squonk2-python-client","commit_stats":{"total_commits":153,"total_committers":3,"mean_commits":51.0,"dds":0.0326797385620915,"last_synced_commit":"2454a24e73308ac7967b91daefd488a66d743fe2"},"previous_names":["informaticsmatters/data-manager-api"],"tags_count":105,"template":false,"template_full_name":null,"purl":"pkg:github/InformaticsMatters/squonk2-python-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-python-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-python-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-python-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-python-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InformaticsMatters","download_url":"https://codeload.github.com/InformaticsMatters/squonk2-python-client/tar.gz/refs/heads/5.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InformaticsMatters%2Fsquonk2-python-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266580383,"owners_count":23951215,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["squonk2"],"created_at":"2024-11-26T02:16:00.082Z","updated_at":"2025-07-22T22:05:29.065Z","avatar_url":"https://github.com/InformaticsMatters.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Informatics Matters Squonk2 Python Client\n=========================================\n\n.. image:: https://badge.fury.io/py/im-squonk2-client.svg\n   :target: https://badge.fury.io/py/im-squonk2-client\n   :alt: PyPI package (latest)\n\n.. image:: https://readthedocs.org/projects/squonk2-python-client/badge/?version=latest\n   :target: https://squonk2-python-client.readthedocs.io/en/latest/?badge=latest\n   :alt: Documentation Status\n\n.. image:: https://github.com/InformaticsMatters/squonk2-python-client/actions/workflows/build.yaml/badge.svg\n   :target: https://github.com/InformaticsMatters/squonk2-python-client/actions/workflows/build.yaml\n   :alt: Build\n\n.. image:: https://github.com/InformaticsMatters/squonk2-python-client/actions/workflows/publish.yaml/badge.svg\n   :target: https://github.com/InformaticsMatters/squonk2-python-client/actions/workflows/publish.yaml\n   :alt: Publish\n\nA Python 3 package that provides simplified access to key parts of the\nInformatics Matters Squonk2 applications, consisting of Authentication,\nData Manager, Account Server and UI REST interfaces. The functions provide\naccess to some of the key API methods, implemented initially to support\nexecution of Jobs from a Fragalysis stack `backend`_.\n\nSimplified Authentication\n=========================\nThe following Squonk2 Authentication functions are available: -\n\n- ``Auth.get_access_token()``\n\nSimplified Data Manager API\n===========================\nThe following Squonk2 Data Manager API functions are available: -\n\n- ``DmApi.set_api_url()``\n- ``DmApi.get_api_url()``\n\n- ``DmApi.ping()``\n\n- ``DmApi.add_project_editor()``\n- ``DmApi.add_project_observer()``\n- ``DmApi.create_project()``\n- ``DmApi.delete_instance()``\n- ``DmApi.delete_instance_token()``\n- ``DmApi.delete_project()``\n- ``DmApi.delete_unmanaged_project_files()``\n- ``DmApi.dry_run_job_instance()``\n- ``DmApi.get_account_server_namespace()``\n- ``DmApi.get_account_server_registration()``\n- ``DmApi.get_available_instances()``\n- ``DmApi.get_available_datasets()``\n- ``DmApi.get_available_jobs()``\n- ``DmApi.get_available_projects()``\n- ``DmApi.get_available_tasks()``\n- ``DmApi.get_job()``\n- ``DmApi.get_job_definition_schema_version()``\n- ``DmApi.get_job_exchange_rates()``\n- ``DmApi.get_job_by_version()``\n- ``DmApi.get_instance()``\n- ``DmApi.get_project()``\n- ``DmApi.get_project_instances()``\n- ``DmApi.get_service_errors()``\n- ``DmApi.get_task()``\n- ``DmApi.get_tasks()``\n- ``DmApi.get_unmanaged_project_file()``\n- ``DmApi.get_unmanaged_project_file_with_token()``\n- ``DmApi.get_version()``\n- ``DmApi.get_workflow_engine_version()``\n- ``DmApi.list_project_files()``\n- ``DmApi.put_unmanaged_project_files()``\n- ``DmApi.put_job_manifest()``\n- ``DmApi.remove_project_editor()``\n- ``DmApi.remove_project_observer()``\n- ``DmApi.set_admin_state()``\n- ``DmApi.set_job_exchange_rates()``\n- ``DmApi.start_job_instance()``\n\nA ``dataclass`` is used as the return value for many of the methods: -\n\n- ``DmApiRv``\n\nIt contains a boolean ``success`` field and a dictionary ``msg`` field. The\n``msg`` typically contains the underlying REST API response content\n(rendered as a Python dictionary), or an error message if the call failed.\n\nSimplified Account Server API\n=============================\nThe following Squonk2 Account Server API functions are available: -\n\n- ``AsApi.set_api_url()``\n- ``AsApi.get_api_url()``\n\n- ``AsApi.ping()``\n\n- ``AsApi.get_account()``\n- ``AsApi.add_user_to_organisation()``\n- ``AsApi.add_user_to_unit()``\n- ``AsApi.alter_asset()``\n- ``AsApi.alter_organisation()``\n- ``AsApi.alter_product()``\n- ``AsApi.alter_unit()``\n- ``AsApi.attach_asset()``\n- ``AsApi.create_asset()``\n- ``AsApi.create_event_stream()``\n- ``AsApi.create_organisation()``\n- ``AsApi.create_personal_unit()``\n- ``AsApi.create_product()``\n- ``AsApi.create_unit()``\n- ``AsApi.delete_asset()``\n- ``AsApi.delete_event_stream()``\n- ``AsApi.delete_organisation()``\n- ``AsApi.delete_personal_unit()``\n- ``AsApi.delete_product()``\n- ``AsApi.delete_unit()``\n- ``AsApi.detach_asset()``\n- ``AsApi.disable_asset()``\n- ``AsApi.enable_asset()``\n- ``AsApi.get_asset()``\n- ``AsApi.get_available_assets()``\n- ``AsApi.get_available_units()``\n- ``AsApi.get_available_products()``\n- ``AsApi.get_default_organisation()``\n- ``AsApi.get_event_stream_version()``\n- ``AsApi.get_event_stream()``\n- ``AsApi.get_merchant()``\n- ``AsApi.get_merchants()``\n- ``AsApi.get_organisation()``\n- ``AsApi.get_personal_unit()``\n- ``AsApi.get_product()``\n- ``AsApi.get_product_default_storage_cost()``\n- ``AsApi.get_product_types()``\n- ``AsApi.get_products_for_unit()``\n- ``AsApi.get_products_for_organisation()``\n- ``AsApi.get_product_charges()``\n- ``AsApi.get_organisation_units()``\n- ``AsApi.get_organisation_users()``\n- ``AsApi.get_organisations()``\n- ``AsApi.get_unit()``\n- ``AsApi.get_unit_users()``\n- ``AsApi.get_units()``\n- ``AsApi.get_version()``\n- ``AsApi.remove_user_from_organisation()``\n- ``AsApi.remove_user_from_unit()``\n\nA ``dataclass`` is used as the return value for many of the methods: -\n\n- ``AsApiRv``\n\nIt contains a boolean ``success`` field and a dictionary ``msg`` field. The\n``msg`` typically contains the underlying REST API response content\n(rendered as a Python dictionary), or an error message if the call failed.\n\nSimplified UI API\n=================\nThe following Squonk2 UI API functions are available: -\n\n- ``UiApi.set_api_url()``\n\n- ``UiApi.get_version()``\n\nA ``dataclass`` is used as the return value for many of the methods: -\n\n- ``UiApiRv``\n\nIt contains a boolean ``success`` field and a dictionary ``msg`` field. The\n``msg`` typically contains the underlying REST API response content\n(rendered as a Python dictionary), or an error message if the call failed.\n\nExamples\n========\nThe package ships with some API examples that might be useful for your own work.\nThey are located in the package ``examples`` module, where the following imports\nshould be available: -\n\n- ``from squonk2.examples.data_manager import job_chain``\n\nDebugging the API requests\n==========================\nFor development purposes you can expose detailed debug information relating to\nthe underlying API requests by setting the environment variable\n``SQUONK2_API_DEBUG_REQUESTS``::\n\n    export SQUONK2_API_DEBUG_REQUESTS=yes\n\nThis will enable detailed debug of both the DM and AS API calls.\n\nInstallation\n============\nThe Squonk2 package is published on `PyPI`_ and can be installed from\nthere::\n\n    pip install im-squonk2-client\n\nEnvironment module\n==================\nThe API contains a convenient ``Environment`` module that allows you to\nkeep your environment variables in a file so that you don't need to\ndeclare them in the shell. The default location of the file is\n``~/.squonk2/environments``. If you have multiple installations this\nallows you to keep all your environment settings together in one file.\n\nYou can use an alternative file  by setting ``SQUONK2_ENVIRONMENTS_FILE``,\ne.g. ``export SQUONK2_ENVIRONMENTS_FILE=~/my-env'``\n\n..  code-block:: yaml\n\n    ---\n\n    # An example Squeck environments file.\n    #\n    # It provides all the connection details for one or more Squonk2 environments.\n    # It is expected to be found in the user's home directory\n    # as '~/.squonk2/environments' or the user can 'point' to it by setting\n    # 'SQUONK2_ENVIRONMENTS_FILE', e.g. 'export SQUONK2_ENVIRONMENTS_FILE=~/my-env'\n\n    # The 'environments' block defines one or more environments.\n    # Each has a name. Here we define an environment called 'site-a'\n    # but environments can be called anything YAML accepts as a key,\n    # although it would aid consistency if you restrict your names to letters\n    # and hyphens.\n    environments:\n      site-a:\n        # The hostname of the keycloak server, without a 'http' prefix\n        # and without a '/auth' suffix.\n        keycloak-hostname: example.com\n        # The realm name used for the Squonk2 environment.\n        keycloak-realm: squonk2\n        # The Keycloak client IDs of the Account Server and Data Manager.\n        # The Account Server client ID is optional.\n        keycloak-as-client-id: account-server-api\n        keycloak-dm-client-id: data-manager-api\n        # The hostnames of the Account Server and Data Manager APIs,\n        # without a 'http' prefix and without an 'api' suffix.\n        # If you have not provided an Account Server client ID its\n        # hostname value is not required.\n        as-hostname: as.example.com\n        dm-hostname: dm.example.com\n        # The username and password of an admin user that has access\n        # to the Account Server and Data Manager.\n        # The user *MUST* have admin rights.\n        admin-user: dlister\n        admin-password: blob1234\n\n    # The final part of the file is a 'default' property,\n    # which Squeck (Squonk Deck) uses to select the an environment from the block above\n    # when all else fails. It's simply the name of one of the environment\n    # declarations above.\n    default: site-a\n\nTo avoid placing ``admin-user`` and ``admin-password`` values into the Environment file\nyou can provide them through environment variables that are scoped to the\nenvironment name. For example, in the above you could omit them both\nand provide them as values using the following variables: -\n\n- ``SQUONK2_ENVIRONMENT_SITE_A_ADMIN_USER``\n- ``SQUONK2_ENVIRONMENT_SITE_A_ADMIN_PASSWORD``\n\n**Using the Environment**\n\n..  code-block:: python\n\n    from squonk2.environment import Environment\n\n    _ = Environment.load()\n    environment: Environment = Environment('site-a')\n    # Get the AS API for 'local'\n    # The hostname is augmented so you will get (for the above example)\n    # the value 'https://as.example.com/account-server-api'\n    as_api: str = environment.as_api()\n\nDocumentation\n=============\nDocumentation is available in the `squonk2-python-client`_ project on\n**Read the Docs**\n\nGet in touch\n============\n\n- Report bugs, suggest features or view the source code `on GitHub`_.\n\n.. _on GitHub: https://github.com/informaticsmatters/squonk2-python-client\n.. _backend: https://github.com/xchem/fragalysis-backend\n.. _squonk2-python-client: https://squonk2-python-client.readthedocs.io/en/latest/\n.. _PyPI: https://pypi.org/project/im-squonk2-client\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fsquonk2-python-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finformaticsmatters%2Fsquonk2-python-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformaticsmatters%2Fsquonk2-python-client/lists"}