neurosnap.api module#
- class neurosnap.api.NeurosnapAPI(api_key)[source]#
Bases:
objectClient wrapper for interacting with the Neurosnap REST API.
Provides authenticated helpers for: - listing services and jobs - submitting jobs and monitoring status - retrieving job metadata and output files - managing job notes and sharing settings
Authentication is performed with a Neurosnap API key, and connectivity is validated during initialization.
- BASE_URL = 'https://neurosnap.ai/api'#
Disables the sharing feature of a job and makes the job private.
- get_job_data(job_id, share_id=None)[source]#
Fetches the config and all files from a Neurosnap job. Output files are only included once the job has completed.
- get_job_file(job_id, file_type, file_name, save_path=None, share_id=None)[source]#
Fetches a specific file from a completed Neurosnap job and saves it to the specified path or returns it as a string if no path is provided.
- Parameters:
- Return type:
- Returns:
Contents of the file fetched as a string or
Noneif save_path is not provided.- Raises:
HTTPError – If the API request fails.
- get_jobs(format_type=None)[source]#
Fetches and returns a list of submitted jobs. Optionally prints the jobs.
- get_pipeline(pipeline_id)[source]#
Fetches the pipeline data associated with a submitted Neurosnap pipeline.
- get_services(format_type=None)[source]#
Fetches and returns a list of available Neurosnap services. Optionally prints the services.
- Parameters:
“table”: Prints services in a tabular format with key fields.
”json”: Prints services as formatted JSON.
None (default): No printing.
- Return type:
- Returns:
A list of dictionaries representing available services.
- Raises:
HTTPError – If the API request fails.
- get_team_info(format_type=None)[source]#
Fetches your team’s information if you are part of a Neurosnap Team.
- get_team_jobs(format_type=None)[source]#
Fetches all the jobs submitted by all members of your Neurosnap Team.
Enables the sharing feature of a job and makes it public.
- submit_job(service_name, fields, note=None)[source]#
Submit a job to the Neurosnap platform.
This function handles the submission of a job to a specified Neurosnap service using either a dictionary of input fields or a pre-constructed MultipartEncoder object.
- Parameters:
service_name (-) – The name of the Neurosnap service (e.g., “TemStaPro”, “NetSolP”, “Boltz-1”) to submit the job to.
fields (-) – Either: - A dictionary mapping field names to values (which will be encoded automatically), or - A MultipartEncoder instance if you want full control over encoding. Refer to the API section of the tool’s page on https://neurosnap.ai for required field names and formats.
note (Optional[str]) – An optional note or tag to include in the job submission (e.g., “optimization_run_3”).
- Return type:
- Returns:
The job ID assigned to the submitted job.
- Raises:
HTTPError – If the API request fails or returns a non-200 status code.