Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

4 watching

Forks

Repository files navigation

neurosynth-compose-sdk

api to create a meta-analysis specification

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.2
  • Package version: 1.2
  • Generator version: 7.27.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://github.com/jdkent

Requirements.

Python 3.11+

Packaging uses standard [project] metadata and [dependency-groups] (PEP 621/735). Install the package with python -m pip install .; install development dependencies with Poetry 2.2 or newer using poetry install, or pip 25.1 or newer using python -m pip install --group dev. The latter installs the group, not the package.

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/neurostuff/neurosynth-compose-python-sdk.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/neurostuff/neurosynth-compose-python-sdk.git)

Then import the package:

import neurosynth_compose_sdk

From a local checkout

pip install .

Then import the package:

import neurosynth_compose_sdk

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import neurosynth_compose_sdk
from neurosynth_compose_sdk.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://compose.neurosynth.org/api
# See configuration.py for a list of all supported configuration parameters.
configuration = neurosynth_compose_sdk.Configuration(
    host = "https://compose.neurosynth.org/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: JSON-Web-Token
configuration = neurosynth_compose_sdk.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with neurosynth_compose_sdk.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = neurosynth_compose_sdk.ComposeApi(api_client)
    nested = True # bool | show nested component instead of id (optional)
    ids = ['ids_example'] # List[str] | choose the specific ids you wish to get (optional)
    page = 56 # int | page of results (optional)
    page_size = 56 # int | number of elements to return on a page (optional)
    name = 'name_example' # str | search the name field for a term (optional)
    search = 'imagin' # str | search for entries that contain the substring (optional)
    description = 'description_example' # str | search description field for a term (optional)
    sort = 'created_at' # str | Parameter to sort results on (optional) (default to 'created_at')
    desc = True # bool | sort results by descending order (as opposed to ascending order) (optional)

    try:
        # GET a list of meta-analyses
        api_response = api_instance.meta_analyses_get(nested=nested, ids=ids, page=page, page_size=page_size, name=name, search=search, description=description, sort=sort, desc=desc)
        print("The response of ComposeApi->meta_analyses_get:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling ComposeApi->meta_analyses_get: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://compose.neurosynth.org/api

Class Method HTTP request Description
ComposeApi meta_analyses_get GET /meta-analyses GET a list of meta-analyses
ComposeApi meta_analyses_id_get GET /meta-analyses/{id} GET meta-analysis information
ComposeApi meta_analyses_id_put PUT /meta-analyses/{id} Update a meta-analysis
ComposeApi meta_analyses_post POST /meta-analyses Create a new meta-analysis
ComposeApi meta_analysis_jobs_get GET /meta-analysis-jobs List meta-analysis jobs for the current user
ComposeApi meta_analysis_jobs_job_id_get GET /meta-analysis-jobs/{job_id} Get status and logs for a meta-analysis job
ComposeApi meta_analysis_jobs_post POST /meta-analysis-jobs Submit a meta-analysis job
ComposeApi meta_analysis_results_get GET /meta-analysis-results List meta-analysis results
ComposeApi meta_analysis_results_id_get GET /meta-analysis-results/{id} Get a meta-analysis result by ID
ComposeApi meta_analysis_results_id_put PUT /meta-analysis-results/{id} Update a meta-analysis result with files or snapshots
ComposeApi meta_analysis_results_post POST /meta-analysis-results Create a new meta-analysis result
ComposeApi neurostore_annotations_id_get GET /neurostore-annotations/{id} Get a Neurostore annotation reference by Neurostore ID
ComposeApi neurostore_studies_get GET /neurostore-studies Your GET endpoint
ComposeApi neurostore_studies_id_get GET /neurostore-studies/{id} Your GET endpoint
ComposeApi neurostore_studysets_get GET /neurostore-studysets List Neurostore studyset references
ComposeApi neurostore_studysets_id_get GET /neurostore-studysets/{id} Get a Neurostore studyset reference by Neurostore ID
ComposeApi neurovault_collections_get GET /neurovault-collections Get neurovault collections
ComposeApi neurovault_collections_id_get GET /neurovault-collections/{id} Your GET endpoint
ComposeApi neurovault_collections_id_put PUT /neurovault-collections/{id}
ComposeApi neurovault_collections_post POST /neurovault-collections Create neurovault collection
ComposeApi neurovault_files_get GET /neurovault-files Your GET endpoint
ComposeApi neurovault_files_id_get GET /neurovault-files/{id} Your GET endpoint
ComposeApi neurovault_files_id_put PUT /neurovault-files/{id}
ComposeApi neurovault_files_post POST /neurovault-files
ComposeApi projects_get GET /projects Your GET endpoint
ComposeApi projects_id_delete DELETE /projects/{id}
ComposeApi projects_id_get GET /projects/{id} Your GET endpoint
ComposeApi projects_id_put PUT /projects/{id}
ComposeApi projects_post POST /projects
ComposeApi snapshot_annotations_get GET /snapshot-annotations GET a list of annotations
ComposeApi snapshot_annotations_id_get GET /snapshot-annotations/{id} GET information about an annotation
ComposeApi snapshot_annotations_id_put PUT /snapshot-annotations/{id} Update an Annotation
ComposeApi snapshot_annotations_post POST /snapshot-annotations Create a new Annotation
ComposeApi snapshot_studysets_get GET /snapshot-studysets Get a list of Studysets
ComposeApi snapshot_studysets_id_get GET /snapshot-studysets/{id} Get information about a Studyset
ComposeApi snapshot_studysets_id_put PUT /snapshot-studysets/{id} Update a Studyset
ComposeApi snapshot_studysets_post POST /snapshot-studysets Create a new Studyset
ComposeApi specifications_get GET /specifications Get a list of Specifications
ComposeApi specifications_id_get GET /specifications/{id} Get information about a Specification
ComposeApi specifications_id_put PUT /specifications/{id} Update Meta-Analysis specification
ComposeApi specifications_post POST /specifications Create a Specification
ComposeApi tags_get GET /tags Get a list of Tags
ComposeApi tags_id_get GET /tags/{id} Get information about a Tag
ComposeApi tags_post POST /tags Create a new Tag
ComposeApi users_get GET /users GET list of Users
ComposeApi users_id_get GET /users/{id} Get User Info by User ID
ComposeApi users_id_put PUT /users/{id} Update User Information
ComposeApi users_post POST /users Create A New User
DefaultApi meta_analyses_id_delete DELETE /meta-analyses/{id}
DefaultApi neurostore_studies_id_put PUT /neurostore-studies/{id}
DefaultApi neurostore_studies_post POST /neurostore-studies

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

JSON-Web-Token

  • Type: Bearer authentication

upload_key

  • Type: API key
  • API key parameter name: Compose-Upload-Key
  • Location: HTTP header

Author

jamesdkent21@gmail.com

Request headers

Header names are compared case-insensitively in all Python client libraries. Request headers are copied; supplying _headers does not change the caller's dict or the client's shared defaults. The public _headers argument retains its dict validation and existing value serialization. Pydantic can coerce mappings such as HTTPX Headers to a dict, combining repeated fields into a single value; _headers does not provide a repeated-field or list-of-pairs API.

Precedence, from lowest to highest:

  1. _headers (within one dict, the last inserted case variant wins).
  2. Explicit OpenAPI header parameters and generated Content-Type (or _content_type). Generated Accept is added only when neither _headers nor explicit header parameters contain an Accept case variant.
  3. ApiClient.default_headers (including headers set with set_default_header).
  4. The client's cookie setting, for Cookie.
  5. Authentication headers. A non-empty _request_auth replaces configured authentication for that call; {} retains configured authentication. Cookie authentication appends to the selected Cookie value.

This retains the existing precedence for identically spelled names and extends it to case variants. To override a generated content type, use _content_type; client defaults still take precedence over it. The winning header's spelling and value are retained for replacements. Cookie authentication uses the canonical Cookie spelling and appends its value. Values containing legitimate comma-separated lists are not split or deduplicated. This does not remove duplicate values inside a header or change the handling of repeated fields supplied directly to the transport.

Neurostuff SDK Helpers

The generator adds two helper modules to reduce import friction:

  1. sdk.py: a single facade for endpoint groups.
  2. auth.py: Auth0 refresh-token exchange + automatic bearer token refresh.

Minimal usage

from neurosynth_compose_sdk.sdk import SDK

sdk = SDK(host="https://example.org/api", access_token="<access-token>")
studysets_api = sdk.studysets
result = studysets_api.studysets_get()

Auth0 refresh-token usage

from neurosynth_compose_sdk.sdk import SDK

sdk = SDK.from_auth0_refresh_token(
    domain="your-tenant.us.auth0.com",
    client_id="<auth0-client-id>",
    refresh_token="<auth0-refresh-token>",
    audience="<optional-audience>",
)

# Access token is exchanged and refreshed automatically per request.
users = sdk.users.users_get()

You can also use environment variables: AUTH0_DOMAIN, AUTH0_CLIENT_ID, AUTH0_REFRESH_TOKEN, plus optional AUTH0_AUDIENCE, AUTH0_CLIENT_SECRET, AUTH0_SCOPE.

sdk = SDK.from_auth0_env(prefix="AUTH0")

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages