{"id":24508427,"url":"https://github.com/aplbrain/motifstudio-client","last_synced_at":"2025-03-15T09:20:50.517Z","repository":{"id":254172839,"uuid":"845711134","full_name":"aplbrain/motifstudio-client","owner":"aplbrain","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-21T19:32:12.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-01-22T00:16:00.260Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/aplbrain.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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}},"created_at":"2024-08-21T19:25:15.000Z","updated_at":"2024-08-21T19:32:15.000Z","dependencies_parsed_at":"2024-08-21T22:05:33.285Z","dependency_job_id":null,"html_url":"https://github.com/aplbrain/motifstudio-client","commit_stats":null,"previous_names":["aplbrain/motifstudio-client"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fmotifstudio-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fmotifstudio-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fmotifstudio-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aplbrain%2Fmotifstudio-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aplbrain","download_url":"https://codeload.github.com/aplbrain/motifstudio-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243707934,"owners_count":20334731,"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":[],"created_at":"2025-01-22T00:16:17.124Z","updated_at":"2025-03-15T09:20:50.498Z","avatar_url":"https://github.com/aplbrain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MotifStudio: Python SDK\n\n[MotifStudio](https://motifstudio.bossdb.org) is a platform for analyzing subnetwork motifs in connectome graphs. This Python SDK allows users to interact with the MotifStudio API to perform various operations such as querying graphs, retrieving motifs, and more.\n\n## Installation\n\nIn order to use the MotifStudio Python SDK, you need to install the `motifstudio` package. You can do this using pip or `uv`:\n\n```bash\n# SLOW:\n# pip install motifstudio-client\n\n# Add motifstudio-client to a project FAST:\nuv add motifstudio-client\n```\n\n## Usage\n\nTo use the MotifStudio Python SDK, you need to create an instance of the `MotifStudioClient` class and provide the API endpoint. You can then use this instance to interact with the API. (The SDK defaults to the public API endpoint but if you are using a private instance, you can specify the URL.)\n\n```python\nfrom motifstudio_client import MotifStudioClient\nm = MotifStudioClient(\"https://api.motifstudio.bossdb.org\")\n```\n\nTo get a list of available \"host\" graphs, you can use the `hosts` object, which behaves like a dictionary:\n\n```python\ng.hosts.keys()  # List all available host graphs\n```\n\nYou can perform basic operations such as querying the number of vertices or edges in the graph:\n\n```python\nm.query(\"Takemura2013_Medulla\").vertices_count()\nm.query(\"Takemura2013_Medulla\").edges_count()\n```\n\nPerform a motif search on a specific graph:\n\n```python\nmy_triangle_motif = \"\"\"\nA-\u003eB\nB-\u003eC\nC-\u003eA\n\"\"\"\n\nm.query(\"Takemura2013_Medulla\").motifs(my_triangle_motif)  # Example motif query\n```\n\nYou can also download a graph into a local [NetworkX](https://networkx.org/) object for local analysis:\n\n```python\ng = m.hosts.get_graph(\"Takemura2013_Medulla\")\n```\n\n---\n\n\u003cp align='center'\u003e\u003csmall\u003eMade with 💙 at \u003ca href='http://www.jhuapl.edu/'\u003e\u003cimg alt='JHU APL' align='center' src='https://user-images.githubusercontent.com/693511/62956859-a967ca00-bdc1-11e9-998e-3888e8a24e86.png' height='42px'\u003e\u003c/a\u003e\u003c/small\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faplbrain%2Fmotifstudio-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faplbrain%2Fmotifstudio-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faplbrain%2Fmotifstudio-client/lists"}