quartzbio package¶
Subpackages¶
- quartzbio.cli package
- quartzbio.resource package
- Submodules
- quartzbio.resource.apiresource module
- quartzbio.resource.application module
- quartzbio.resource.beacon module
- quartzbio.resource.beaconset module
- quartzbio.resource.dataset module
- quartzbio.resource.dataset_restore_task module
- quartzbio.resource.dataset_snapshot_task module
- quartzbio.resource.datasetcommit module
- quartzbio.resource.datasetexport module
- quartzbio.resource.datasetfield module
- quartzbio.resource.datasetimport module
- quartzbio.resource.datasetmigration module
- quartzbio.resource.datasettemplate module
- quartzbio.resource.group module
- quartzbio.resource.manifest module
- quartzbio.resource.object module
- quartzbio.resource.object_copy_task module
- quartzbio.resource.quartzbio_object module
- quartzbio.resource.savedquery module
- quartzbio.resource.task module
- quartzbio.resource.user module
- quartzbio.resource.util module
- quartzbio.resource.vault module
- quartzbio.resource.vault_sync_task module
- Module contents
- Submodules
- quartzbio.utils package
Submodules¶
Module contents¶
QuartzBio Python Client¶
This is the Python client & library for the QuartzBio API.
Have questions or comments? email us at: support@quartzbio.com
- class quartzbio.Annotator(fields, **kwargs)¶
Bases:
objectRuns the synchronous annotate endpoint against batches of results from a query.
- CHUNK_SIZE = 100¶
- annotate(records, **kwargs)¶
Annotate a set of records with stored fields.
- Parameters:
records – A list or iterator (can be a Query object)
chunk_size – The number of records to annotate at once (max 500).
- Returns:
A generator that yields one annotated record at a time.
- class quartzbio.Application(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResource,SearchableAPIResource,UpdateableAPIResource- ID_ATTR = 'client_id'¶
- LIST_FIELDS = (('client_id', 'Client ID'), ('name', 'Name'), ('description', 'Description'), ('web_url', 'web_url'))¶
- RESOURCE_VERSION = 2¶
- class quartzbio.BatchQuery(queries, **kwargs)¶
Bases:
objectBatchQuery accepts a list of Query objects and executes them in a single request to /v2/batch_query.
- execute(**params)¶
- class quartzbio.Beacon(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResource,UpdateableAPIResourceBeacons provide entity-based search endpoints for datasets. Beacons must be created within Beacon Sets.
- LIST_FIELDS = (('id', 'ID'), ('title', 'Title'), ('description', 'Description'), ('vault_object_id', 'Object ID'))¶
- RESOURCE_VERSION = 2¶
- query(query, entity_type=None)¶
- class quartzbio.BeaconSet(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResource,UpdateableAPIResourceA beacon set is an arbitrary group of beacons, which provide entity-based search endpoints for datasets. Beacon sets can be used to query a group of related datasets in a single API request.
- LIST_FIELDS = (('id', 'ID'), ('title', 'Title'), ('description', 'Description'), ('is_shared', 'Shared?'), ('is_public', 'Public?'), ('created_at', 'Created'), ('updated_at', 'Last Updated'))¶
- RESOURCE_VERSION = 2¶
- query(query, entity_type=None)¶
- class quartzbio.Dataset(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResource,UpdateableAPIResourceDatasets are access points to data. Dataset names are unique within a vault folder.
- LIST_FIELDS = (('id', 'ID'), ('vault_name', 'Vault'), ('vault_object_path', 'Path'), ('documents_count', 'Documents'), ('description', 'Description'))¶
- RESOURCE_VERSION = 2¶
- activity(follow=False, limit=1, sleep_seconds=5.0)¶
Get a list of active Tasks that have a target object of the dataset. Active tasks are in the running, queued or pending state.
Defaults to limit=1 for performance. Increase this value in order to return more tasks as output.
- archive(storage_class=None, follow=False)¶
Archive this dataset
- beacon(**params)¶
- commits(**params)¶
- disable_global_beacon()¶
Disable Global Beacon for this dataset.
- enable_global_beacon()¶
Enable Global Beacon for this dataset.
- export(format='json', follow=True, **kwargs)¶
- fields(name=None, **params)¶
- classmethod get_by_full_path(full_path, **kwargs)¶
- get_global_beacon_status(raise_on_disabled=False)¶
Retrieves the Global Beacon status for this dataset.
- classmethod get_or_create_by_full_path(full_path, **kwargs)¶
- import_file(path, **kwargs)¶
This is a shortcut to creating a DatasetImport. Can’t use “import()” because of Python.
- imports(**params)¶
- lookup(*sbids)¶
- classmethod make_full_path(vault_name, path, name, **kwargs)¶
- migrate(target, follow=True, **kwargs)¶
Migrate the data from this dataset to a target dataset.
Valid optional kwargs include:
source_params
target_fields
include_errors
commit_mode
- query(query=None, **params)¶
- restore(storage_class=None, follow=False, **kwargs)¶
Restore this dataset
- saved_queries(**params)¶
- template(**params)¶
- property vault_object¶
- class quartzbio.DatasetCommit(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,UpdateableAPIResource,DownloadableAPIResourceDatasetCommits represent a change made to a Dataset.
- LIST_FIELDS = (('id', 'ID'), ('title', 'Title'), ('description', 'Description'), ('status', 'Status'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- property dataset¶
- follow(loop=True, sleep_seconds=5.0)¶
- property parent_object¶
Get the commit objects parent Import or Migration
- class quartzbio.DatasetExport(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DownloadableAPIResource,DeletableAPIResourceDatasetExport represent an export task that takes a Dataset or filtered Dataset (Query) and exports the contents to a flat file (CSV, JSON, or XLSX).
For interactive use, DatasetExport can be “followed” to watch the progression of the task.
- LIST_FIELDS = (('id', 'ID'), ('documents_count', 'Records'), ('format', 'Format'), ('status', 'Status'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- property dataset¶
- follow(loop=True, sleep_seconds=5.0)¶
- class quartzbio.DatasetField(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResource,UpdateableAPIResourceEach QuartzBio dataset has a different set of fields, some of which can be used as filters. Dataset field resources provide users with documentation about each field.
- RESOURCE_VERSION = 2¶
- facets(**params)¶
- help()¶
- class quartzbio.DatasetImport(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,UpdateableAPIResource,DeletableAPIResourceDatasetImports represent an import task that takes either an object_id or a file manifest (list of file URLs) and converts them to a QuartzBio-compatible format which can then be indexed by a dataset.
For interactive use, DatasetImport can be “followed” to watch the progression of an import job.
- LIST_FIELDS = (('id', 'ID'), ('title', 'Title'), ('description', 'Description'), ('status', 'Status'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- property dataset¶
- follow(loop=True, sleep_seconds=5.0)¶
- class quartzbio.DatasetMigration(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResourceDatasetMigration represent an task that copies data between two Datasets or modifies data within a single Dataset.
For interactive use, DatasetMigration can be “followed” to watch the progression of the task.
- LIST_FIELDS = (('id', 'ID'), ('status', 'Status'), ('source', 'Source'), ('target', 'Target'), ('documents_count', 'Records'), ('created_at', 'Created'), ('updated_at', 'Updated'))¶
- RESOURCE_VERSION = 2¶
- follow(loop=True, sleep_seconds=5.0)¶
- property source¶
- property target¶
- class quartzbio.DatasetRestoreTask(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResourceDatasetRestoreTask represents the task to restore an archived dataset
- LIST_FIELDS = (('id', 'ID'), ('dataset_id', 'Dataset'), ('vault_id', 'Vault'), ('status', 'Status'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- property dataset¶
- follow(loop=True, sleep_seconds=5.0)¶
- class quartzbio.DatasetSnapshotTask(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResourceDatasetSnapshotTask represents the task to snapshot and archive a dataset
- LIST_FIELDS = (('id', 'ID'), ('dataset_id', 'Dataset'), ('vault_id', 'Vault'), ('status', 'Status'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- property dataset¶
- follow(loop=True, sleep_seconds=5.0)¶
- class quartzbio.DatasetTemplate(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,UpdateableAPIResource,DeletableAPIResourceDatasetTemplates contain the schema of a Dataset, including some properties and all the fields.
- LIST_FIELDS = (('id', 'ID'), ('name', 'Name'), ('description', 'Description'))¶
- RESOURCE_VERSION = 2¶
- property import_params¶
Get DatasetImport parameters from a template and format them correctly.
- class quartzbio.Expression(expr, **kwargs)¶
Bases:
objectRuns a single QuartzBio expression.
- evaluate(data=None, data_type='string', is_list=False)¶
Evaluates the expression with the provided context and format.
- class quartzbio.Filter(*raw_filters, **filters)¶
Bases:
objectFilter objects.
Makes it easier to create filters cumulatively using
&(and),|(or) and~(not) operations.For example:
f = Filter() f &= Filter(price='Free') f |= Filter(style='Mexican')
creates a filter “price = ‘Free’ or style = ‘Mexican’”.
Each set of kwargs in a Filter are ANDed together:
<field>=’<value>’ matches if the field is that exact value
<field>__in=[<item1>, …] matches any of the terms <item1> and so on
- <field>__range=[<start>, <end>] matches anything from <start>
to <end>
- <field>__between=[<start>, <end>] matches anything between <start> to
<end> not include either <start> or <end>
String terms are not analyzed and are always assumed to be exact matches.
Numeric columns can be selected by range using:
<field>__gt: greater than
<field>__gte: greater than or equal to
<field>__lt: less than
<field>__lte: less than or equal to
Field action examples:
- dataset.query(gene__in=[‘BRCA’, ‘GATA3’],
chr=’3’, start__gt=10000, end__lte=20000)
- class quartzbio.GenomicFilter(chromosome, start, stop=None, exact=False)¶
Bases:
FilterHelper class that generates filters on genomic coordinates.
Range filtering only works on “genomic” datasets (where dataset.is_genomic is True).
- FIELD_CHR = 'genomic_coordinates.chromosome'¶
- FIELD_START = 'genomic_coordinates.start'¶
- FIELD_STOP = 'genomic_coordinates.stop'¶
- classmethod from_string(string, exact=False)¶
Handles UCSC-style range queries (chr1:100-200)
- class quartzbio.GlobalSearch(query=None, filters=None, entities=None, entities_match='any', vault_scope='all', ordering=None, limit=inf, page_size=100, result_class=<class 'dict'>, debug=False, raw_results=False, **kwargs)¶
Bases:
QueryGlobalSearch acts as a request wrapper that generates a request from Filter objects, and can iterate through streaming result sets.
- entity(**kwargs)¶
Returns GlobalSearch instance with the query args combined with existing set with AND.
kwargs can contain only one entity, entity_type as parameter name and entity as its value. If entity is already set for the GlobalSearch, it will be overridden.
- execute(offset=0, **query)¶
Executes a query. Additional query parameters can be passed as keyword arguments.
Returns: The request parameters and the raw query response.
- subjects()¶
Returns the list of subjects
- subjects_count()¶
Returns the number of subjects
- vaults()¶
Returns the list of vaults
- class quartzbio.Group(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,UpdateableAPIResource,DeletableAPIResourceA Group represents a group of users with shared permissions for a vault.
- LIST_FIELDS = (('id', 'ID'), ('name', 'Name'), ('memberships_count', 'Members'), ('vaults_count', 'Vaults'), ('role', 'Role'), ('description', 'Description'))¶
- RESOURCE_VERSION = 1¶
- datasets(**params)¶
- members(**params)¶
- vaults(**params)¶
- class quartzbio.Manifest¶
Bases:
objectManifests aren’t strictly resources, they represent a list of remote files (URLs) with additional information that can be used for validation (size and MD5).
- add(*args)¶
Add one or more files or URLs to the manifest. If files contains a glob, it is expanded.
All files are uploaded to QuartzBio. The Upload object is used to fill the manifest.
- add_file(path, **kwargs)¶
- add_url(url, **kwargs)¶
- manifest = None¶
- class quartzbio.Object(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResource,SearchableAPIResource,UpdateableAPIResource,DownloadableAPIResourceAn object is a resource in a Vault. It has three possible types, though more may be added later: folder, file, and QuartzBio Dataset.
- LIST_FIELDS = (('id', 'ID'), ('object_type', 'Type'), ('full_path', 'Full Path'), ('description', 'Description'))¶
- PATH_RE = re.compile('^[^\\/]*(?P<path>(\\/[^\\/]*)+)$')¶
- RESOURCE_VERSION = 2¶
- archive(storage_class=None, follow=False)¶
Archive this dataset
- classmethod create_folder(vault, full_path, tags=None, **kwargs)¶
Create a folder if not exists.
- Parameters:
vault (
Vault) – A Vault object.full_path (str) – Full path including vault name.
tags (list[str]) – List of tags to put on folder.
client – QuartzBio client configuration to use.
- Returns:
New folder object
- Return type:
- Raises:
QuartzBioError – if a file or dataset object already exists at the given full_path.
- create_shortcut(shortcut_full_path, **kwargs)¶
Create a shortcut to the current object at shortcut_full_path
- Parameters:
shortcut_full_path (str) – Full path including vault name.
tags (list[str]) – List of tags to put on shortcut.
- Returns:
New shortcut object
- Return type:
- Raises:
QuartzBioError – if a object already exists at the given shortcut_full_path.
- property data_url¶
- property dataset¶
Returns the dataset object
- datasets(**params)¶
- delete_version(version_id)¶
Marks the specified version as deleted. Only file objects can have versions.
- disable_global_beacon()¶
Disable Global Beacon for this object (datasets only).
- enable_global_beacon()¶
Enable Global Beacon for this object (datasets only).
- files(**params)¶
- folders(**params)¶
- classmethod get_by_full_path(full_path, **params)¶
- classmethod get_by_path(path, **params)¶
- get_global_beacon_status(raise_on_disabled=False)¶
Retrieves the Global Beacon status for this object (datasets only).
- classmethod get_or_create_by_full_path(full_path, **kwargs)¶
- get_target(return_none_target=True)¶
- has_tag(tag)¶
Return True if object contains tag
- property is_dataset¶
- property is_file¶
- property is_folder¶
- property is_shortcut¶
- list_versions(include_deleted=True)¶
Returns all the versions for this object. Only file objects can have versions.
- ls(**params)¶
- objects(**params)¶
- property parent¶
Returns the parent object
- query(**params)¶
Return the Query or QueryFile object depending on object type that represents query results against an object.
- classmethod refresh_presigned_urls(upload_id, key, total_size, part_numbers, **kwargs)¶
Refresh presigned URLs for multipart upload
- Parameters:
upload_id (str) – The upload ID from the multipart upload
key (str) – The upload key/identifier
total_size (int) – Total size of the file being uploaded
part_numbers (list[int]) – List of part numbers to refresh URLs for
**kwargs – Additional parameters including client
- Returns:
List of presigned URL objects with part information
- Return type:
list
- restore(storage_class=None, follow=False, **kwargs)¶
Restore this dataset
- restore_version(version_id)¶
Sets the current version to the specified version. This is done by creating a new version with the same content as the specified version. Only file objects can have versions.
- tag(tags, remove=False, dry_run=False, apply_save=True)¶
Add or remove tags on an object
- undelete_version(version_id)¶
Marks the specified version as not deleted. Only file objects can have versions.
- untag(tags, dry_run=False, apply_save=True)¶
Remove tags on an object
- classmethod upload_file(local_path, remote_path, vault_full_path, **kwargs)¶
Upload a file to a QuartzBio vault.
Automatically uses multipart upload for files larger than the multipart_threshold.
- Parameters:
local_path (str) – Path to the local file to upload
remote_path (str) – Remote path within the vault
vault_full_path (str) – Full path of the target vault
**kwargs – Additional options: multipart_threshold (int): File size threshold for multipart upload (default: 64MB) multipart_chunksize (int): Size of each upload part (default: 64MB) num_processes (int): Number of parallel workers for multipart upload (default: 1) max_retries (int): Maximum retries per part for multipart upload (default: 3) archive_folder (str): Archive existing files to this folder before upload follow_shortcuts (bool): Follow shortcuts when uploading description (str): Description for the uploaded file tags (list): Tags to apply to the uploaded file client: QuartzBio client instance to use
- Returns:
The uploaded file object
- Return type:
- Raises:
FileUploadError – If upload fails
QuartzBioError – If API request fails
- classmethod validate_full_path(full_path, **kwargs)¶
Helper method to parse a full or partial path and return a full path as well as a dict containing path parts.
Uses the following rules when processing the path:
If no domain, uses the current user’s account domain
If no vault, uses the current user’s personal vault.
If no path, uses ‘/’ (vault root)
Returns a tuple containing:
The validated full_path
- A dictionary with the components:
domain: the domain of the vault
vault: the name of the vault, without domain
vault_full_path: domain:vault
path: the object path within the vault
parent_path: the parent path to the object
parent_full_path: the parent full path to the object
filename: the object’s filename (if any)
full_path: the validated full path
The following components may be overridden using kwargs:
vault
path
Object paths (also known as “paths”) must begin with a forward slash.
The following path formats are supported:
domain:vault:/path -> object “path” in the root of “domain:vault” domain:vault/path -> object “path” in the root of “domain:vault” vault:/path -> object “path” in the root of “vault” vault/path -> object “path” in the root of “vault” ~/path -> object “path” in the root of personal vault vault/ -> root of “vault” ~/ -> root of your personal vault
The following two formats are not supported:
path -> invalid/ambiguous path (exception) vault:path -> invalid/ambiguous path (exception) vault:path/path -> unsupported, interpreted as domain:vault/path
- property vault¶
Returns the vault object
- class quartzbio.ObjectCopyTask(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,UpdateableAPIResource- LIST_FIELDS = (('id', 'ID'), ('status', 'Status'), ('source_vault_id', 'Source Vault'), ('target_vault_id', 'Target Vault'), ('source_object_id', 'Source'), ('target_object_id', 'Target'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- follow(loop=True, sleep_seconds=5.0)¶
- class quartzbio.QuartzBioClient(host=None, token=None, token_type: Literal['Bearer', 'Token'] = 'Bearer', include_resources=True, retry_all: bool = None)¶
Bases:
objectA requests-based HTTP client for QuartzBio API resources
- delete(url, data, **kwargs)¶
Issues an HTTP DELETE across the wire via the Python requests library. See request for information on keyword args.
- get(url, params, **kwargs)¶
Issues an HTTP GET across the wire via the Python requests library. See request() for information on keyword args.
- is_logged_in()¶
- post(url, data, **kwargs)¶
Issues an HTTP POST across the wire via the Python requests library. See request for information on keyword args.
- request(method, url, **kwargs)¶
Issues an HTTP Request across the wire via the Python requests library.
- Parameters:
method (an HTTP)
method
url (str)
start (the place to connect to. If the url doesn't)
(https (with a protocol)
front. (quartzbio.api_host in the)
allow_redirects (bool, optional)
redirects (set False we won't follow any)
headers (dict, optional) – Custom headers can be provided here; generally though this will be set correctly by default dependent on the method type. If the content type is JSON, we’ll JSON-encode params.
param (dict, optional) – passed as params in the requests.request
timeout (int, optional) – timeout value in seconds for the request
raw (bool, optional) – unless True the response encoded to json
files (file) – File content in the form of a file handle which is to be uploaded. Files are passed in POST requests
- Returns:
response object. If *raw is not True and*
repsonse if valid the object will be JSON encoded. Otherwise
it will be the request.reposne object.
- set_credentials(host: str, token: str, token_type: Literal['Bearer', 'Token'], *, debug: bool = False, raise_on_missing: bool = True)¶
- set_user_agent(name=None, version=None)¶
- validate_host_is_www_url(host)¶
- whoami()¶
- exception quartzbio.QuartzBioError(message=None, response=None)¶
Bases:
ExceptionExceptions tailored to the kinds of errors from a QuartzBio API request
- default_message = 'Unexpected error communicating with QuartzBio. If this problem persists, let us know at support@quartzbio.com.'¶
- class quartzbio.Query(dataset_id, query=None, genome_build=None, filters=None, fields=None, exclude_fields=None, entities=None, ordering=None, limit=inf, page_size=100, result_class=<class 'dict'>, target_fields=None, annotator_params=None, debug=False, **kwargs)¶
Bases:
QueryBaseA Query API request wrapper that generates a request from Filter objects, and can iterate through streaming result sets.
- annotate(fields, **kwargs)¶
- execute(offset=0, **query)¶
Executes a query. Additional query parameters can be passed as keyword arguments.
Returns: The request parameters and the raw query response.
- export(format='json', follow=True, limit=None, **kwargs)¶
- facets(*args, **kwargs)¶
Returns a dictionary with the requested facets.
The facets function supports string args, and keyword args.
q.facets(‘field_1’, ‘field_2’) will return facets for field_1 and field_2. q.facets(field_1={‘limit’: 0}, field_2={‘limit’: 10}) will return all facets for field_1 and 10 facets for field_2.
- fields()¶
Returns all expected fields that will be found in the results.
- join(query_b, key, key_b=None, prefix='b_', always_prefix=False)¶
Performs a left outer join between the current query (query A) and another query (query B).
Set prefix to None to use a random prefix. Enable always_prefix to always apply a prefix.
- migrate(target, follow=True, **kwargs)¶
Migrate the data from the Query to a target dataset.
Valid optional kwargs include:
target_fields
include_errors
validation_params
metadata
commit_mode
- position(chromosome, position, exact=False)¶
Shortcut to do a single position filter on genomic datasets.
- range(chromosome, start, stop, exact=False)¶
Shortcut to do range filters on genomic datasets.
- class quartzbio.SavedQuery(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,UpdateableAPIResource,DeletableAPIResourceA saved query is a set of query parameters that persists, giving users the ability to apply them to compatible datasets with ease. A dataset is said to be compatible with a saved query if it contains all the fields found in said saved query.
- LIST_FIELDS = (('id', 'ID'), ('name', 'Name'), ('is_shared', 'Is Shared'), ('description', 'Description'))¶
- RESOURCE_VERSION = 2¶
- query(dataset=None)¶
- class quartzbio.Task(id=None, **params)¶
Bases:
ListableAPIResource,UpdateableAPIResourceTasks are operations on datasets or vaults.
- LIST_FIELDS = (('id', 'ID'), ('task_display_name', 'Task Type'), ('task_id', 'Task ID'), ('description', 'Description'), ('status', 'Status'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- SLEEP_WAIT_DEFAULT = 5.0¶
- cancel()¶
Cancel a task
- property child_object¶
Get Task child object class
- follow(sleep_seconds=5.0)¶
Follow the child object but do not loop
- class quartzbio.User(id=None, **params)¶
Bases:
SingletonAPIResource
- class quartzbio.Vault(vault_id, **kwargs)¶
Bases:
CreateableAPIResource,ListableAPIResource,DeletableAPIResource,SearchableAPIResource,UpdateableAPIResourceA vault is like a filesystem that can contain files, folder, and QuartzBio datasets. Vaults can be “connected” to external resources such as Amazon S3 Buckets. Typically, vaults contain a series of datasets that are compatible with each other (i.e. they come from the same data source or project).
- LIST_FIELDS = (('id', 'ID'), ('full_path', 'Full Path'), ('provider', 'Provider'), ('description', 'Description'))¶
- RESOURCE_VERSION = 2¶
- VAULT_PATH_RE = re.compile('^(?:(?P<domain>[a-zA-Z0-9\\-]+)\\:)??(?P<vault>[^\\/:]+)(?:\\:?\\/.*)?$')¶
- create_dataset(name, **params)¶
- create_folder(filename, **params)¶
- datasets(**params)¶
- disable_versioning()¶
- enable_versioning()¶
- files(**params)¶
- folders(**params)¶
- classmethod get_by_full_path(full_path, **kwargs)¶
- classmethod get_or_create_by_full_path(full_path, **kwargs)¶
- classmethod get_or_create_uploads_path(**kwargs)¶
- classmethod get_personal_vault(**kwargs)¶
- ls(**params)¶
- objects(**params)¶
- search(query, **params)¶
- suspend_versioning()¶
- upload_file(local_path, remote_path, **kwargs)¶
- classmethod validate_full_path(full_path, **kwargs)¶
Helper method to return a full path from a full or partial path.
If no domain, assumes user’s account domain If the vault is “~”, assumes personal vault.
Valid vault paths include:
domain:vault domain:vault:/path domain:vault/path vault:/path vault ~/
Invalid vault paths include:
/vault/ /path / :/
Does not allow overrides for any vault path components.
- class quartzbio.VaultSyncTask(id=None, **params)¶
Bases:
CreateableAPIResource,ListableAPIResource,UpdateableAPIResource- LIST_FIELDS = (('id', 'ID'), ('status', 'Status'), ('vault_id', 'Vault'), ('created_at', 'Created'))¶
- RESOURCE_VERSION = 2¶
- follow(loop=True, sleep_seconds=5.0)¶
- quartzbio.login(api_host: str = None, access_token: str = None, name: str = None, version: str = None, debug: bool = False)¶
Function to login to the QuartzBio/EDP API when using EDP in a python script. Note that another function is used when CLI command quartzbio login is used! EDP checks user credentials & host URL from multiple sources, in the following order:
Parameters provided (e.g. the parameters of this function)
Environment variables (if the above parameters weren’t provided)
- quartzbio credentials file stored in the user’s HOME directory
(if parameters and environment variables weren’t found)
- Parameters:
api_host – the QuartzBio EDP instance’s URL to access.
access_token – your user’s access token, which you can generate at the EDP website (user menu > Personal Access Tokens)
name – name
version – version
Example
import quartzbio quartzbio.login( api_host="https://quartzbio.api.az.aws.quartz.bio", )