Welcome to Pacifica Metadata’s documentation!

The Pacifica Metadata service provides metadata storage about the files stored in Pacifica.

Installation

The Pacifica software is available through PyPi so creating a virtual environment to install is what is shown below. Please keep in mind compatibility with the Pacifica Core services.

Installation in Virtual Environment

These installation instructions are intended to work on both Windows, Linux, and Mac platforms. Please keep that in mind when following the instructions.

Please install the appropriate tested version of Python for maximum chance of success.

Linux and Mac Installation

mkdir ~/.virtualenvs
python -m virtualenv ~/.virtualenvs/pacifica
. ~/.virtualenvs/pacifica/bin/activate
pip install pacifica-metadata

Windows Installation

This is done using PowerShell. Please do not use Batch Command.

mkdir "$Env:LOCALAPPDATA\virtualenvs"
python.exe -m virtualenv "$Env:LOCALAPPDATA\virtualenvs\pacifica"
& "$Env:LOCALAPPDATA\virtualenvs\pacifica\Scripts\activate.ps1"
pip install pacifica-metadata

Configuration

The Pacifica Core services require two configuration files. The REST API utilizes CherryPy and review of their configuration documentation is recommended. The service configuration file is a INI formatted file containing configuration for database connections.

CherryPy Configuration File

An example of Metadata server CherryPy configuration:

[global]
log.screen: True
log.access_file: 'access.log'
log.error_file: 'error.log'
server.socket_host: '0.0.0.0'
server.socket_port: 8121

[/]
request.dispatch: cherrypy.dispatch.MethodDispatcher()
tools.response_headers.on: True
tools.response_headers.headers: [('Content-Type', 'application/json')]

Service Configuration File

The service configuration is an INI file and an example is as follows:

[database]
; This section contains database connection configuration

; peewee_url is defined as the URL PeeWee can consume.
; http://docs.peewee-orm.com/en/latest/peewee/database.html#connecting-using-a-database-url
peewee_url = postgresql://pacifica:metadata@localhost:5432/pacifica_metadata

; connect_attempts are the number of times the service will attempt to
; connect to the database if unavailable.
connect_attempts = 10

; connect_wait are the number of seconds the service will wait between
; connection attempts until a successful connection to the database.
connect_wait = 20

; enable debug logging of database queries
debug_logging = False

[notifications]
; This section describes where the notifications server is.

; Disable eventing for the metadata service.
disabled = False

; URL to the recieve endpoint on the notifications server.
url = http://127.0.0.1:8070/receive

[elasticsearch]
; This section describes configuration to contact elasticsearch

; URL to the elasticsearch server
url = http://127.0.0.1:9200

Starting the Service

Starting the Metadata service can be done by two methods. However, understanding the requirements and how they apply to REST services is important to address as well. Using the internal CherryPy server to start the service is recommended for Windows platforms. For Linux/Mac platforms it is recommended to deploy the service with uWSGI.

Deployment Considerations

The Metadata service is the authoritative metadata store for all data in Pacifica. This means any queries needed by any other Pacifica services goes through a REST endpoint on this service. As different services require performance characteristics of each endpoint it is important to have a deployment mechanism that behaves consistently.

The CherryPy service works well enough for many of the queries. However, for performance and scalability using uWSGI is preferred. Also putting system memory consumption limits on the service is also recommended. As you get more data in the system some queries will grow to consume memory beyond a single system.

As data volume in Pacifica and load on queries increase the Metadata service works better running in uWSGI. The chance increases of a query consuming all the system memory on the server. As CherryPy is a threaded application Linux will kill the process to free up memory. This results in the service going down entirely and not servicing requests. uWSGI takes care of this by utilizing a forking model for handling requests. Using uWSGI, a child process is killed and a 500 is returned to the client. uWSGI continues handling requests, cleans up the dead child and spawns new ones.

CherryPy Server

To make running the Metadata service using the CherryPy’s builtin server easier we have a command line entry point.

$ pacifica-metadata --help
usage: pacifica-metadata [-h] [--cpconfig CPCONFIG] [-c CONFIG] [-p PORT]
                         [-a ADDRESS]

Run the metadata server.

optional arguments:
  -h, --help            show this help message and exit
  --cpconfig CPCONFIG   cherrypy config file
  -c CONFIG, --config CONFIG
                        database config file
  -p PORT, --port PORT  port to listen on
  -a ADDRESS, --address ADDRESS
                        address to listen on
$ pacifica-metadata-cmd dbsync
$ pacifica-metadata
[09/Jan/2019:09:17:26] ENGINE Listening for SIGTERM.
[09/Jan/2019:09:17:26] ENGINE Bus STARTING
[09/Jan/2019:09:17:26] ENGINE Set handler for console events.
[09/Jan/2019:09:17:26] ENGINE Started monitor thread 'Autoreloader'.
[09/Jan/2019:09:17:26] ENGINE Serving on http://0.0.0.0:8121
[09/Jan/2019:09:17:26] ENGINE Bus STARTED

uWSGI Server

To make running the UniqueID service using uWSGI easier we have a module to be included as part of the uWSGI configuration. uWSGI is very configurable and can use this module many different ways. Please consult the uWSGI Configuration documentation for more complicated deployments.

$ pip install uwsgi
$ uwsgi --http-socket :8121 --master --module pacifica.metadata.wsgi

Metadata Model

This covers all the objects and their relationships to other objects in the model.

All The Objects

Journals

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
impact_factor FloatField   NOT NULL
encoding CharField   NOT NULL
website_url CharField   NOT NULL
name CharField   NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

Users

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
middle_initial CharField   NOT NULL
last_name CharField   NOT NULL
encoding CharField   NOT NULL
network_id CharField   NULL
first_name CharField   NOT NULL
email_address CharField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

Institutions

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
association_cd CharField   NOT NULL
name TextField   NOT NULL
encoding CharField   NOT NULL
is_foreign BooleanField   NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

Projects

Instruments

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
display_name CharField   NOT NULL
name CharField   NOT NULL
encoding CharField   NOT NULL
name_short CharField   NOT NULL
active BooleanField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

InstrumentCustodian

Column Type Reference Attributes
custodian ForeignKeyField Users.id NOT NULL
instrument ForeignKeyField Instruments.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

Citations

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
article_title TextField   NOT NULL
encoding CharField   NOT NULL
abstract_text TextField   NOT NULL
journal ForeignKeyField Journals.id NOT NULL
doi_reference CharField   NOT NULL
release_authorization_id CharField   NOT NULL
journal_volume IntegerField   NOT NULL
page_range CharField   NOT NULL
xml_text TextField   NOT NULL
journal_issue IntegerField   NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

Contributors

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
middle_initial CharField   NOT NULL
last_name CharField   NOT NULL
encoding CharField   NOT NULL
first_name CharField   NOT NULL
dept_code CharField   NOT NULL
institution ForeignKeyField Institutions.id NOT NULL
person ForeignKeyField Users.id NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

InstitutionPerson

Column Type Reference Attributes
person ForeignKeyField Users.id NOT NULL
institution ForeignKeyField Institutions.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

Keywords

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
keyword CharField   NOT NULL
encoding CharField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

Groups

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
name CharField   NOT NULL
encoding CharField   NOT NULL
is_admin BooleanField   NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

AnalyticalTools

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
name CharField   NOT NULL
encoding CharField   NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

CitationContributor

Column Type Reference Attributes
author ForeignKeyField Contributors.id NOT NULL
citation ForeignKeyField Citations.id NOT NULL
author_precedence IntegerField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

CitationKeyword

Column Type Reference Attributes
citation ForeignKeyField Citations.id NOT NULL
keyword ForeignKeyField Keywords.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

ProjectInstrument

ProjectParticipant

ProjectGroup

CitationProject

Transactions

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
description TextField   NULL
suspense_date ExtendDateField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

TransSIP

TransSAP

Files

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
mimetype CharField   NOT NULL
transaction ForeignKeyField Transactions.id NOT NULL
name CharField   NOT NULL
encoding CharField   NOT NULL
hashsum CharField   NOT NULL
ctime ExtendDateTimeField   NOT NULL
hashtype CharField   NOT NULL
suspense_date ExtendDateField   NULL
subdir CharField   NOT NULL
mtime ExtendDateTimeField   NOT NULL
size BigIntegerField   NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

Keys

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
encoding CharField   NOT NULL
key CharField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

Values

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
encoding CharField   NOT NULL
value CharField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

FileKeyValue

Column Type Reference Attributes
key ForeignKeyField Keys.id NOT NULL
value ForeignKeyField Values.id NOT NULL
file ForeignKeyField Files.id NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

TransactionKeyValue

Column Type Reference Attributes
transaction ForeignKeyField Transactions.id NOT NULL
value ForeignKeyField Values.id NOT NULL
key ForeignKeyField Keys.id NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

UserGroup

Column Type Reference Attributes
person ForeignKeyField Users.id NOT NULL
group ForeignKeyField Groups.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

InstrumentGroup

Column Type Reference Attributes
instrument ForeignKeyField Instruments.id NOT NULL
group ForeignKeyField Groups.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

AToolProject

AToolTransaction

Column Type Reference Attributes
analytical_tool ForeignKeyField AnalyticalTools.id NOT NULL
transaction ForeignKeyField Transactions.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

TransactionRelease

Column Type Reference Attributes
authorized_person ForeignKeyField Users.id NOT NULL
transaction ForeignKeyField Transactions.id NOT NULL, PRIMARY KEY
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

DOIEntries

Column Type Reference Attributes
status CharField   NOT NULL
doi CharField   NOT NULL, PRIMARY KEY
encoding CharField   NOT NULL
site_url CharField   NOT NULL
released BooleanField   NOT NULL
creator ForeignKeyField Users.id NOT NULL
updated ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL
created ExtendDateTimeField   NOT NULL

DOIAuthors

Column Type Reference Attributes
id AutoField   NOT NULL, PRIMARY KEY
last_name CharField   NOT NULL
first_name CharField   NOT NULL
email CharField   NULL
affiliation CharField   NULL
orcid CharField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

DOITransaction

Column Type Reference Attributes
transaction ForeignKeyField TransactionRelease.transaction NOT NULL
doi ForeignKeyField DOIEntries.doi NOT NULL, PRIMARY KEY
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

CitationTransaction

Column Type Reference Attributes
transaction ForeignKeyField TransactionRelease.transaction NOT NULL
citation ForeignKeyField Citations.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

CitationDOI

Column Type Reference Attributes
doi ForeignKeyField DOIEntries.doi NOT NULL
citation ForeignKeyField Citations.id NOT NULL
deleted ExtendDateTimeField   NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL

DOIAuthorMapping

Column Type Reference Attributes
doi ForeignKeyField DOIEntries.doi NOT NULL
author ForeignKeyField DOIAuthors.id NOT NULL
author_order IntegerField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

DOIInfo

Column Type Reference Attributes
doi ForeignKeyField DOIEntries.doi NOT NULL
value CharField   NOT NULL
key CharField   NOT NULL
updated ExtendDateTimeField   NOT NULL
created ExtendDateTimeField   NOT NULL
deleted ExtendDateTimeField   NULL

Note

This document is generated by the GenMetadataModelMD.py script and needs to be regenerated whenever changes are made to the model.

Example Usage

The API

The Pacifica Metadata Services API covers the complete object life-cycle: create, read, update, and delete.

The examples in this section demonstrate the life-cycle of the User object using a Pacifica Metadata Services deployment at http://localhost:8121/ (see “Installing the Service” section).

Creating an Object

To create a new User object, start by generating a new file create.json to store the JSON data:

{
  "_id": 127,
  "email_address": "john@doe.com",
  "first_name": "John",
  "last_name": "Doe",
  "middle_initial": "",
  "network_id": "guest"
}

Then, provide the contents of the new file as the body for a HTTP PUT request using the curl command:

curl -X PUT -T create.json 'http://localhost:8121/users'

Reading an Object

To retrieve the JSON data for the User object that was just created, send a HTTP GET request (with the _id attribute as a query parameter) using the curl command:

curl -X GET 'http://localhost:8121/users?_id=127'

The response body is a JSON array of JSON objects. Because the query uses the _id attribute, a primary key, the JSON array contains either zero (no match) or one (match) JSON objects:

[
  {
    "_id": 127,
    "email_address": "john@doe.com",
    "encoding": "UTF8",
    "first_name": "John",
    "last_name": "Doe",
    "middle_initial": "",
    "network_id": "guest",
    "created": 1459204793,
    "deleted": null,
    "updated": 1459204793
  }
]

Optionally, query on any other parts of an object by using its attributes as query parameters, e.g., to query on both the first_name and last_name attributes using the curl command:

curl -X GET 'http://localhost:8121/users?last_name=Doe&first_name=John'

Response bodies for queries on other parts may contain JSON data for more than one match:

[
  {
    "_id": 127,
    "email_address": "john@doe.com",
    "encoding": "UTF8",
    "first_name": "John",
    "last_name": "Doe",
    "middle_initial": "",
    "network_id": "guest",
    "created": 1459204793,
    "deleted": null,
    "updated": 1459204793
  },
  ...
]

Updating an Object

To modify a preexisting object, use the query parameters to identify the object (or objects) and then send a HTTP POST request with the JSON data for the modified attributes as the request body, e.g., to modify the network_id attribute, start by generating a new file update.json to store the JSON data:

{
  "network_id": "example"
}

Then, provide the contents of the new file as the body for a HTTP POST request using the curl command:

curl -X POST -T update.json 'http://localhost:8121/users?last_name=Doe&first_name=John'

Finally, verify the modifications by retrieving the most recent version of the object (see “Reading an Object” section), e.g., using the curl command:

curl -X GET 'http://localhost:8121/users?_id=127'

The updated attribute is automatically set to the current time when an object is modified:

[
  {
    "_id": 127,
    "email_address": "john@doe.com",
    "encoding": "UTF8",
    "first_name": "John",
    "last_name": "Doe",
    "middle_initial": "",
    "network_id": "example",
    "created": 1459204793,
    "deleted": null,
    "updated": 1459205143
  }
]

(Soft) Deleting an Object

To mark an object as deleted, i.e., to “soft delete” an object, send a HTTP DELETE request using the curl command:

curl -X DELETE 'http://localhost:8121/users?_id=127'

NOTE Don’t worry! The object isn’t really deleted.

Finally, verify the “soft delete” by retrieving the most recent version of the object (see “Reading an Object” section), e.g., using the curl command:

curl -X GET 'http://localhost:8121/users?_id=127'

The deleted attribute is automatically set to the current time when an object is “soft deleted”:

[
  {
    "_id": 127,
    "email_address": "john@doe.com",
    "encoding": "UTF8",
    "first_name": "John",
    "last_name": "Doe",
    "middle_initial": "",
    "network_id": "example",
    "created": 1459204793,
    "deleted": 1459205341,
    "updated": 1459205143
  }
]

Metadata Python Module

Configuration Python Module

Configuration reading and validation module.

pacifica.metadata.config.get_config()[source]

Return the ConfigParser object with defaults set.

Currently metadata API doesn’t work with SQLite the queries are too complex and it only is supported with MySQL and PostgreSQL.

Globals Python Module

Global configuration options expressed in environment variables.

ORM Python Module

All Objects Python Module

Core modules.

This loads all model objects and contains global operations on those objects.

Globals Python Module

Globals module for orm module.

Base Python Module

Pacifica Metadata ORM Base Class.

This class implements the basic functionality needed for all metadata objects in the metadata model for Pacifica.

PacificaModel.

Base class inherits from the PeeWee ORM Model class to create required fields by all objects and serialization methods for the base fields.

There are also CherryPy methods for creating, updating, getting and deleting these objects in from a web service layer.

class pacifica.metadata.orm.base.PacificaModel(*args, **kwargs)[source]

Basic fields for an object within the model.

Attributes:
Name Description
created When was the object created
updated When was the object last changed
deleted When was the object deleted
DoesNotExist

alias of PacificaModelDoesNotExist

static _bool_translate(thing)[source]

Translate the thing into a boolean.

_build_object(attr)[source]
static _date_operator_compare(date, kwargs, dt_converts=<function datetime_converts>)[source]
_generate_fk_obj_list(obj_ref)[source]
_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
_set_date_part(date_part, obj)[source]
_set_datetime_part(time_part, obj)[source]
_set_only_if(key, obj, dest_attr, func)[source]
_set_only_if_by_name(attr, obj, cls)[source]
classmethod _where_attr_clause(where_clause, kwargs, keys)[source]

Grab keys and operators out of kwargs and return where clause.

classmethod available_hash_list()[source]

Generate a hashable structure of all keys and values of keys.

This structure allows for easy evaluation of updates or current vs old data for any object in the database.

classmethod cls_foreignkey_rel_mods()[source]

Return a collection of related models for a given foreignkey.

classmethod cls_foreignkeys()[source]

Provide the foreign keys of the class as a list of attrs.

classmethod cls_revforeignkeys()[source]

Provide the rev foreign keys of the class as a list of attrs.

created = <ExtendDateTimeField: PacificaModel.created>
deleted = <ExtendDateTimeField: PacificaModel.deleted>
from_hash(obj)[source]

Convert the hash objects into object fields if they are present.

static get_append_item(obj_ref, fk_item_name, fk_obj_list)[source]

Generate the proper item to append to the newly built object.

classmethod get_object_info(where_clause=None)[source]

Get model and field information about the model class.

classmethod get_primary_keys()[source]

Return the primary keys for the object.

id = <AutoField: PacificaModel.id>
classmethod last_change_date()[source]

Find the last changed date for the object.

to_hash(**flags)[source]

Convert the base object fields into serializable attributes in a hash.

updated = <ExtendDateTimeField: PacificaModel.updated>
classmethod where_clause(kwargs)[source]

PeeWee specific extension meant to be passed to a PeeWee get or select.

pacifica.metadata.orm.base.db_connection_decorator(func)[source]

Wrap a method with a database connect and close.

Sync Python Module

The ORM Sync Module.

class pacifica.metadata.orm.sync.MetadataSystem(*args, **kwargs)[source]

Metadata Schema Version Model.

DoesNotExist

alias of MetadataSystemDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
classmethod get_or_create_version()[source]

Set or create the current version of the schema.

classmethod get_version()[source]

Get the current version as a tuple.

classmethod is_equal()[source]

Check to see if schema version matches code version.

classmethod is_safe()[source]

Check to see if the schema version is safe for the code.

part = <CharField: MetadataSystem.part>
value = <IntegerField: MetadataSystem.value>
class pacifica.metadata.orm.sync.OrmSync[source]

Special module for syncing the orm.

This module should incorporate a schema migration strategy.

The supported versions migrating forward must be in a versions array containing tuples for major and minor versions.

The version tuples are directly translated to method names in the orm_update class for the update between those versions.

Example Methods:

class OrmSync:
  versions = [
    (0, 1),
    (0, 2),
    (1, 0),
    (1, 1)
  ]

  def update_0_1_to_0_2():
    pass
  def update_0_2_to_1_0():
    pass

The body of the update should follow peewee migration practices. http://docs.peewee-orm.com/en/latest/peewee/playhouse.html#migrate

static close()[source]

Close the database connection.

classmethod connect_and_check()[source]

Connect and check the version.

static create_tables()[source]

Create the tables for the objects if they exist.

static dbconn_blocking()[source]

Wait for the db connection.

classmethod update_0_1_to_1_0()[source]

Update schema to 1.0.

classmethod update_1_0_to_2_0()[source]

Update to the schema to move proposal to project.

classmethod update_2_0_to_2_1()[source]

Update to the schema to move proposal to project.

classmethod update_2_1_to_3_0()[source]

Update to the schema to create relationships.

classmethod update_tables()[source]

Update the database to the current version.

versions = [(0, 1), (1, 0), (2, 0), (2, 1), (3, 0)]

Analytical Tools Python Module

Contains the model for metadata analytical tools.

class pacifica.metadata.orm.analytical_tools.AnalyticalTools(*args, **kwargs)[source]

Keys model class for metadata.

Attributes:
Name Description
name generic tool name
encoding encoding for the name
DoesNotExist

alias of AnalyticalToolsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: AnalyticalTools.created>
deleted = <ExtendDateTimeField: AnalyticalTools.deleted>
encoding = <CharField: AnalyticalTools.encoding>
from_hash(obj)[source]

Convert the hash to the object.

id = <AutoField: AnalyticalTools.id>
name = <CharField: AnalyticalTools.name>
projects
to_hash(**flags)[source]

Convert the object to a hash.

transactions
transsap
updated = <ExtendDateTimeField: AnalyticalTools.updated>
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Analytical Tool Project Python Module

TransactionKeyValue links Transactions and Keys and Values objects.

class pacifica.metadata.orm.atool_project.AToolProject(*args, **kwargs)[source]

TransactionKeyValue attributes are foreign keys.

Attributes:
DoesNotExist

alias of AToolProjectDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
analytical_tool = <ForeignKeyField: AToolProject.analytical_tool>
analytical_tool_id = <ForeignKeyField: AToolProject.analytical_tool>
created = <ExtendDateTimeField: AToolProject.created>
deleted = <ExtendDateTimeField: AToolProject.deleted>
from_hash(obj)[source]

Convert the hash into the object.

project = <ForeignKeyField: AToolProject.project>
project_id = <ForeignKeyField: AToolProject.project>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: AToolProject.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Analytical Tool Transaction Python Module

TransactionKeyValue links Transactions and Keys and Values objects.

class pacifica.metadata.orm.atool_transaction.AToolTransaction(*args, **kwargs)[source]

TransactionKeyValue attributes are foreign keys.

Attributes:
Name Description
transaction Link to the Transactions model
analytical_tool Link to the AnalyticalTools model
DoesNotExist

alias of AToolTransactionDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
analytical_tool = <ForeignKeyField: AToolTransaction.analytical_tool>
analytical_tool_id = <ForeignKeyField: AToolTransaction.analytical_tool>
created = <ExtendDateTimeField: AToolTransaction.created>
deleted = <ExtendDateTimeField: AToolTransaction.deleted>
from_hash(obj)[source]

Convert the hash into the object.

to_hash(**flags)[source]

Convert the object to a hash.

transaction = <ForeignKeyField: AToolTransaction.transaction>
transaction_id = <ForeignKeyField: AToolTransaction.transaction>
updated = <ExtendDateTimeField: AToolTransaction.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Citations Python Module

Citations model for tracking journal articles.

class pacifica.metadata.orm.citations.Citations(*args, **kwargs)[source]

Citations model tracks metadata for a journal article.

Attributes:
Name Description
article_title The title of the article
journal Link to the journal it was published in
journal_volume Journal volume for the publication
journal_issue Journal issue for the publication
page_range Pages in issue/volume was the article
abstract_text Abstract from the article in the journal
xml_text xml blob for the citation
release_authorization_id External link to authorization metadata about the released article
doi_reference Digital Object Identifier for the citation
encoding | Language this metadata is in not the
article itself
DoesNotExist

alias of CitationsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
abstract_text = <TextField: Citations.abstract_text>
article_title = <TextField: Citations.article_title>
authors
created = <ExtendDateTimeField: Citations.created>
deleted = <ExtendDateTimeField: Citations.deleted>
doi_entries
doi_reference = <CharField: Citations.doi_reference>
encoding = <CharField: Citations.encoding>
from_hash(obj)[source]

Convert the object into the citation object fields.

id = <AutoField: Citations.id>
journal = <ForeignKeyField: Citations.journal>
journal_id = <ForeignKeyField: Citations.journal>
journal_issue = <IntegerField: Citations.journal_issue>
journal_volume = <IntegerField: Citations.journal_volume>
keywords
page_range = <CharField: Citations.page_range>
projects
release_authorization_id = <CharField: Citations.release_authorization_id>
release_entries
to_hash(**flags)[source]

Convert the citation fields to a serializable hash.

updated = <ExtendDateTimeField: Citations.updated>
classmethod where_clause(kwargs)[source]

Generate the PeeWee where clause used in searching.

xml_text = <TextField: Citations.xml_text>

Citation Contributor Python Module

CitationContributor links citations and their authors.

class pacifica.metadata.orm.citation_contributor.CitationContributor(*args, **kwargs)[source]

CitationsContributors data model.

Attributes:
Name Description
citation Link to the Citation model
author Link to the Contributor model
author_precedence Order of the Author in the Citation
DoesNotExist

alias of CitationContributorDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
author = <ForeignKeyField: CitationContributor.author>
author_id = <ForeignKeyField: CitationContributor.author>
author_precedence = <IntegerField: CitationContributor.author_precedence>
citation = <ForeignKeyField: CitationContributor.citation>
citation_id = <ForeignKeyField: CitationContributor.citation>
created = <ExtendDateTimeField: CitationContributor.created>
deleted = <ExtendDateTimeField: CitationContributor.deleted>
from_hash(obj)[source]

Convert the hash into the object.

to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: CitationContributor.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Citation Doi Python Module

Keywords linked to citations.

class pacifica.metadata.orm.citation_doi.CitationDOI(*args, **kwargs)[source]

CitationDOI Model.

Attributes:
Name Description
doi Link to the DOI model
citation Link to the Citations model
DoesNotExist

alias of CitationDOIDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
citation = <ForeignKeyField: CitationDOI.citation>
citation_id = <ForeignKeyField: CitationDOI.citation>
created = <ExtendDateTimeField: CitationDOI.created>
deleted = <ExtendDateTimeField: CitationDOI.deleted>
doi = <ForeignKeyField: CitationDOI.doi>
doi_id = <ForeignKeyField: CitationDOI.doi>
from_hash(obj)[source]

Convert the hash to the object.

to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: CitationDOI.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Citation Keyword Python Module

Keywords linked to citations.

class pacifica.metadata.orm.citation_keyword.CitationKeyword(*args, **kwargs)[source]

CitationKeywords Model.

Attributes:
Name Description
citation Link to the Citation model
keyword Link to the Keyword model
DoesNotExist

alias of CitationKeywordDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
citation = <ForeignKeyField: CitationKeyword.citation>
citation_id = <ForeignKeyField: CitationKeyword.citation>
created = <ExtendDateTimeField: CitationKeyword.created>
deleted = <ExtendDateTimeField: CitationKeyword.deleted>
from_hash(obj)[source]

Convert the hash into the object.

keyword = <ForeignKeyField: CitationKeyword.keyword>
keyword_id = <ForeignKeyField: CitationKeyword.keyword>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: CitationKeyword.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Citation Project Python Module

Citation project relationship.

class pacifica.metadata.orm.citation_project.CitationProject(*args, **kwargs)[source]

Relates citations with projects.

Attributes:
Name Description
citation Link to the Citation model
project Link to the Project model
DoesNotExist

alias of CitationProjectDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
citation = <ForeignKeyField: CitationProject.citation>
citation_id = <ForeignKeyField: CitationProject.citation>
created = <ExtendDateTimeField: CitationProject.created>
deleted = <ExtendDateTimeField: CitationProject.deleted>
from_hash(obj)[source]

Convert the hash into the object.

project = <ForeignKeyField: CitationProject.project>
project_id = <ForeignKeyField: CitationProject.project>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: CitationProject.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Citation Transaction Python Module

Keywords linked to citations.

class pacifica.metadata.orm.citation_transaction.CitationTransaction(*args, **kwargs)[source]

CitationTransaction Model.

Attributes:
DoesNotExist

alias of CitationTransactionDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
citation = <ForeignKeyField: CitationTransaction.citation>
citation_id = <ForeignKeyField: CitationTransaction.citation>
created = <ExtendDateTimeField: CitationTransaction.created>
deleted = <ExtendDateTimeField: CitationTransaction.deleted>
from_hash(obj)[source]

Convert the hash to the object.

to_hash(**flags)[source]

Convert the object to a hash.

transaction = <ForeignKeyField: CitationTransaction.transaction>
transaction_id = <ForeignKeyField: CitationTransaction.transaction>
updated = <ExtendDateTimeField: CitationTransaction.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Contributors Python Module

Contributors model describes an author to a journal article.

class pacifica.metadata.orm.contributors.Contributors(*args, **kwargs)[source]

Contributors object and associated fields.

Attributes:
Name Description
user Link to the User model
institution Link to the Institution model
first_name Users first name as it appears in the citation
middle_initial Users middle initial as it appears in the citation
last_name Users last name as it appears in the citation
dept_code Department of the institution the User was a member of at the time of the citation
encoding Language encoding of the attributes above
DoesNotExist

alias of ContributorsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
citations
created = <ExtendDateTimeField: Contributors.created>
deleted = <ExtendDateTimeField: Contributors.deleted>
dept_code = <CharField: Contributors.dept_code>
encoding = <CharField: Contributors.encoding>
first_name = <CharField: Contributors.first_name>
from_hash(obj)[source]

Convert the hash into the object fields.

id = <AutoField: Contributors.id>
institution = <ForeignKeyField: Contributors.institution>
institution_id = <ForeignKeyField: Contributors.institution>
last_name = <CharField: Contributors.last_name>
middle_initial = <CharField: Contributors.middle_initial>
to_hash(**flags)[source]

Convert the object fields into a serializable hash.

updated = <ExtendDateTimeField: Contributors.updated>
user = <ForeignKeyField: Contributors.user>
user_id = <ForeignKeyField: Contributors.user>
classmethod where_clause(kwargs)[source]

Generate the PeeWee where clause used in searching.

DOI Authors Python Module

Secondary author list for DOI entries.

class pacifica.metadata.orm.doi_authors.DOIAuthors(*args, **kwargs)[source]

DOI Authors Model.

Attributes:
Name Description
last_name Author last name
first_name Author first name
email Author email address
affiliation Institutional affiliation
orcid Author’s ORCID ID
DoesNotExist

alias of DOIAuthorsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
affiliation = <CharField: DOIAuthors.affiliation>
created = <ExtendDateTimeField: DOIAuthors.created>
deleted = <ExtendDateTimeField: DOIAuthors.deleted>
doi_authorships
email = <CharField: DOIAuthors.email>
first_name = <CharField: DOIAuthors.first_name>
from_hash(obj)[source]

Convert the hash to the object.

id = <AutoField: DOIAuthors.id>
last_name = <CharField: DOIAuthors.last_name>
orcid = <CharField: DOIAuthors.orcid>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: DOIAuthors.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

DOI Author Mapping Python Module

Authors linked to DOI’s.

class pacifica.metadata.orm.doi_author_mapping.DOIAuthorMapping(*args, **kwargs)[source]

DOI Author Mapping Model.

Attributes:
Name Description
author ID from DOI_authors table
doi Full DOI Specifier
author_order where does this author go in the order?
DoesNotExist

alias of DOIAuthorMappingDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
author = <ForeignKeyField: DOIAuthorMapping.author>
author_id = <ForeignKeyField: DOIAuthorMapping.author>
author_order = <IntegerField: DOIAuthorMapping.author_order>
created = <ExtendDateTimeField: DOIAuthorMapping.created>
deleted = <ExtendDateTimeField: DOIAuthorMapping.deleted>
doi = <ForeignKeyField: DOIAuthorMapping.doi>
doi_id = <ForeignKeyField: DOIAuthorMapping.doi>
from_hash(obj)[source]

Convert the hash to the object.

to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: DOIAuthorMapping.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

DOI Entries Python Module

Keywords linked to citations.

class pacifica.metadata.orm.doi_entries.DOIEntries(*args, **kwargs)[source]

DOI Entries Model.

Attributes:
Name Description
doi full DOI specifier
status Current publishing status
released Has the data been released
site_url Linked landing page url
creator Link to Users table
encoding encoding of the keyword
DoesNotExist

alias of DOIEntriesDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
authors
created = <ExtendDateTimeField: DOIEntries.created>
creator = <ForeignKeyField: DOIEntries.creator>
creator_id = <ForeignKeyField: DOIEntries.creator>
deleted = <ExtendDateTimeField: DOIEntries.deleted>
doi = <CharField: DOIEntries.doi>
doi_citations
encoding = <CharField: DOIEntries.encoding>
from_hash(obj)[source]

Convert the hash to the object.

metadata
released = <BooleanField: DOIEntries.released>
site_url = <CharField: DOIEntries.site_url>
status = <CharField: DOIEntries.status>
to_hash(**flags)[source]

Convert the object to a hash.

transactions
updated = <ExtendDateTimeField: DOIEntries.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

DOI Info Python Module

DOIInfo stores return info from the minting service about the DOI entry.

class pacifica.metadata.orm.doi_info.DOIInfo(*args, **kwargs)[source]

DOI Info keys and values for return info from minting service.

Attributes:
Name Description
doi Link to the DOIEntries model
key Key name
value Value
DoesNotExist

alias of DOIInfoDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: DOIInfo.created>
deleted = <ExtendDateTimeField: DOIInfo.deleted>
doi = <ForeignKeyField: DOIInfo.doi>
doi_id = <ForeignKeyField: DOIInfo.doi>
from_hash(obj)[source]

Convert the hash into the object.

key = <CharField: DOIInfo.key>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: DOIInfo.updated>
value = <CharField: DOIInfo.value>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

DOI Transaction Python Module

DOI transaction relationship.

class pacifica.metadata.orm.doi_transaction.DOITransaction(*args, **kwargs)[source]

Relates DOI entries with transaction release entries.

Attributes:
Name Description
doi Link to the DOI model
transaction Link to the TransactionRelease model
DoesNotExist

alias of DOITransactionDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: DOITransaction.created>
deleted = <ExtendDateTimeField: DOITransaction.deleted>
doi = <ForeignKeyField: DOITransaction.doi>
doi_id = <ForeignKeyField: DOITransaction.doi>
from_hash(obj)[source]

Convert the hash into the object.

to_hash(**flags)[source]

Convert the object to a hash.

transaction = <ForeignKeyField: DOITransaction.transaction>
transaction_id = <ForeignKeyField: DOITransaction.transaction>
updated = <ExtendDateTimeField: DOITransaction.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Files Python Module

Contains the Files object model primary unit of metadata for Pacifica.

class pacifica.metadata.orm.files.Files(*args, **kwargs)[source]

Files metadata.

This object contains various attributes describing a file and where it came from.

Attributes:
DoesNotExist

alias of FilesDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
classmethod _where_date_clause(where_clause, kwargs)[source]
created = <ExtendDateTimeField: Files.created>
ctime = <ExtendDateTimeField: Files.ctime>
deleted = <ExtendDateTimeField: Files.deleted>
encoding = <CharField: Files.encoding>
from_hash(obj)[source]

Convert the hash to an object.

hashsum = <CharField: Files.hashsum>
hashtype = <CharField: Files.hashtype>
id = <AutoField: Files.id>
metadata
mimetype = <CharField: Files.mimetype>
mtime = <ExtendDateTimeField: Files.mtime>
name = <CharField: Files.name>
size = <BigIntegerField: Files.size>
subdir = <CharField: Files.subdir>
suspense_date = <ExtendDateField: Files.suspense_date>
to_hash(**flags)[source]

Convert the object to a hash.

transaction = <ForeignKeyField: Files.transaction>
transaction_id = <ForeignKeyField: Files.transaction>
updated = <ExtendDateTimeField: Files.updated>
classmethod where_clause(kwargs)[source]

PeeWee specific where expression.

File Key Value Python Module

FileKeyValue links Files and Keys and Values objects.

class pacifica.metadata.orm.file_key_value.FileKeyValue(*args, **kwargs)[source]

FileKeyValue attributes are foreign keys.

Attributes:
Name Description
file Link to the File model
key Link to the Key model
value Link to the Value model
DoesNotExist

alias of FileKeyValueDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: FileKeyValue.created>
deleted = <ExtendDateTimeField: FileKeyValue.deleted>
file = <ForeignKeyField: FileKeyValue.file>
file_id = <ForeignKeyField: FileKeyValue.file>
from_hash(obj)[source]

Convert the hash into the object.

key = <ForeignKeyField: FileKeyValue.key>
key_id = <ForeignKeyField: FileKeyValue.key>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: FileKeyValue.updated>
value = <ForeignKeyField: FileKeyValue.value>
value_id = <ForeignKeyField: FileKeyValue.value>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Groups Python Module

Contains model for groups.

class pacifica.metadata.orm.groups.Groups(*args, **kwargs)[source]

Groups model and associated fields.

Attributes:
Name Description
name name of the group
is_admin does the group has admin abilities
encoding encoding for the group name
DoesNotExist

alias of GroupsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: Groups.created>
deleted = <ExtendDateTimeField: Groups.deleted>
encoding = <CharField: Groups.encoding>
from_hash(obj)[source]

Convert the hash into the object.

id = <AutoField: Groups.id>
instrument_members
is_admin = <BooleanField: Groups.is_admin>
members
name = <CharField: Groups.name>
projects
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: Groups.updated>
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Institutions Python Module

Describes an institution and its attributes.

class pacifica.metadata.orm.institutions.Institutions(*args, **kwargs)[source]

Institution model scribes an institute.

Attributes:
Name Description
name Name of the institution
association_cd Type of institution (TBD)
is_foreign Is the institution foreign or not
encoding Any encoding for the name
DoesNotExist

alias of InstitutionsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
association_cd = <CharField: Institutions.association_cd>
contributors
created = <ExtendDateTimeField: Institutions.created>
deleted = <ExtendDateTimeField: Institutions.deleted>
encoding = <CharField: Institutions.encoding>
from_hash(obj)[source]

Convert the hash into the object.

id = <AutoField: Institutions.id>
is_foreign = <BooleanField: Institutions.is_foreign>
name = <TextField: Institutions.name>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: Institutions.updated>
users
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Institution Person Python Module

Instruments Python Module

Instrument model describing data generators.

class pacifica.metadata.orm.instruments.Instruments(*args, **kwargs)[source]

Instrument and associated fields.

Attributes:
Name Description
display_name Long display string for web sites
name Machine parsable display name
name_short Short version used in lists
active whether the instrument is active
encoding encoding for the various name attrs
DoesNotExist

alias of InstrumentsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
active = <BooleanField: Instruments.active>
created = <ExtendDateTimeField: Instruments.created>
custodians
data_sources
deleted = <ExtendDateTimeField: Instruments.deleted>
display_name = <CharField: Instruments.display_name>
encoding = <CharField: Instruments.encoding>
from_hash(obj)[source]

Convert the hash into the object.

groups
id = <AutoField: Instruments.id>
metadata
name = <CharField: Instruments.name>
name_short = <CharField: Instruments.name_short>
projects
to_hash(**flags)[source]

Convert the object to a hash.

transsip
updated = <ExtendDateTimeField: Instruments.updated>
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Instrument Custodian Python Module

Instrument Group Python Module

InstrumentGroup links Groups and Instruments and objects.

class pacifica.metadata.orm.instrument_group.InstrumentGroup(*args, **kwargs)[source]

InstrumentGroup attributes are foreign keys.

Attributes:
Name Description
instrument Link to the Instrument model
group Link to the Group model
DoesNotExist

alias of InstrumentGroupDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: InstrumentGroup.created>
deleted = <ExtendDateTimeField: InstrumentGroup.deleted>
from_hash(obj)[source]

Convert the hash into the object.

group = <ForeignKeyField: InstrumentGroup.group>
group_id = <ForeignKeyField: InstrumentGroup.group>
instrument = <ForeignKeyField: InstrumentGroup.instrument>
instrument_id = <ForeignKeyField: InstrumentGroup.instrument>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: InstrumentGroup.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Journals Python Module

Contains model for Journal.

class pacifica.metadata.orm.journals.Journals(*args, **kwargs)[source]

Journal model and associated fields.

Attributes:
Name Description
name name of the journal
author impact factor of the journal
website_url website for the journal (optional)
encoding language encoding for the name
DoesNotExist

alias of JournalsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
citations
created = <ExtendDateTimeField: Journals.created>
deleted = <ExtendDateTimeField: Journals.deleted>
encoding = <CharField: Journals.encoding>
from_hash(obj)[source]

Convert the hash into the object.

id = <AutoField: Journals.id>
impact_factor = <FloatField: Journals.impact_factor>
name = <CharField: Journals.name>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: Journals.updated>
website_url = <CharField: Journals.website_url>
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Keys Python Module

Contains the model for metadata keys.

class pacifica.metadata.orm.keys.Keys(*args, **kwargs)[source]

Keys model class for metadata.

Attributes:
Name Description
key generic metadata key
encoding encoding for the key
DoesNotExist

alias of KeysDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: Keys.created>
deleted = <ExtendDateTimeField: Keys.deleted>
encoding = <CharField: Keys.encoding>
from_hash(obj)[source]

Convert the hash to the object.

id = <AutoField: Keys.id>
key = <CharField: Keys.key>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: Keys.updated>
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Keywords Python Module

Keywords linked to citations.

class pacifica.metadata.orm.keywords.Keywords(*args, **kwargs)[source]

Keywords Model.

Attributes:
Name Description
citation Link to the Citation model
keyword keyword in the citation
encoding encoding of the keyword
DoesNotExist

alias of KeywordsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
citations
created = <ExtendDateTimeField: Keywords.created>
deleted = <ExtendDateTimeField: Keywords.deleted>
encoding = <CharField: Keywords.encoding>
from_hash(obj)[source]

Convert the hash to the object.

id = <AutoField: Keywords.id>
keyword = <CharField: Keywords.keyword>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: Keywords.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Projects Python Module

Projects data model.

class pacifica.metadata.orm.projects.Projects(*args, **kwargs)[source]

Projects data model.

Attributes:
Name Description
title Title of the project
abstract Long abstract of the project
science_theme science group or theme assigned to
project_type kind or type of project
submitted_date date project entered the system
accepted_date date project was accepted
actual_start_date date the project was started
actual_end_date date the project was ended
closed_date date the project was terminated
suspense_date date the project is made available
encoding encoding of the other text attrs
DoesNotExist

alias of ProjectsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
classmethod _where_date_clause(where_clause, kwargs)[source]
classmethod _where_datetime_clause(where_clause, kwargs)[source]
abstract = <TextField: Projects.abstract>
accepted_date = <ExtendDateField: Projects.accepted_date>
actual_end_date = <ExtendDateField: Projects.actual_end_date>
actual_start_date = <ExtendDateField: Projects.actual_start_date>
atools
citations
closed_date = <ExtendDateField: Projects.closed_date>
created = <ExtendDateTimeField: Projects.created>
deleted = <ExtendDateTimeField: Projects.deleted>
encoding = <CharField: Projects.encoding>
from_hash(obj)[source]

Convert the hash to the object.

groups
id = <CharField: Projects.id>
instruments
project_type = <CharField: Projects.project_type>
science_theme = <CharField: Projects.science_theme>
short_name = <CharField: Projects.short_name>
submitted_date = <ExtendDateTimeField: Projects.submitted_date>
suspense_date = <ExtendDateField: Projects.suspense_date>
title = <TextField: Projects.title>
to_hash(**flags)[source]

Convert the object to a hash.

transsap
transsip
updated = <ExtendDateTimeField: Projects.updated>
users
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Project Group Python Module

Project group relationship.

class pacifica.metadata.orm.project_group.ProjectGroup(*args, **kwargs)[source]

Relates projects and groups objects.

Attributes:
Name Description
group Link to the Group model
project Link to the Project model
DoesNotExist

alias of ProjectGroupDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: ProjectGroup.created>
deleted = <ExtendDateTimeField: ProjectGroup.deleted>
from_hash(obj)[source]

Convert the hash into the object.

group = <ForeignKeyField: ProjectGroup.group>
group_id = <ForeignKeyField: ProjectGroup.group>
project = <ForeignKeyField: ProjectGroup.project>
project_id = <ForeignKeyField: ProjectGroup.project>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: ProjectGroup.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Project Instrument Python Module

Project instrument relationship.

class pacifica.metadata.orm.project_instrument.ProjectInstrument(*args, **kwargs)[source]

Relates projects and instrument objects.

Attributes:
Name Description
instrument Link to the Instrument model
relationship Link to the Relationship model
project Link to the Project model
DoesNotExist

alias of ProjectInstrumentDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: ProjectInstrument.created>
deleted = <ExtendDateTimeField: ProjectInstrument.deleted>
from_hash(obj)[source]

Convert the hash into the object.

instrument = <ForeignKeyField: ProjectInstrument.instrument>
instrument_id = <ForeignKeyField: ProjectInstrument.instrument>
project = <ForeignKeyField: ProjectInstrument.project>
project_id = <ForeignKeyField: ProjectInstrument.project>
relationship = <ForeignKeyField: ProjectInstrument.relationship>
relationship_id = <ForeignKeyField: ProjectInstrument.relationship>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: ProjectInstrument.updated>
uuid = <UUIDField: ProjectInstrument.uuid>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Project Participant Python Module

Transactions Python Module

Transactions model.

class pacifica.metadata.orm.transactions.Transactions(*args, **kwargs)[source]

Transactions model class.

Attributes:
Name Description
description Description of the transaction
suspense_date date the transaction is available
DoesNotExist

alias of TransactionsDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
classmethod _where_date_clause(where_clause, kwargs)[source]
atools
created = <ExtendDateTimeField: Transactions.created>
deleted = <ExtendDateTimeField: Transactions.deleted>
description = <TextField: Transactions.description>
files
from_hash(obj)[source]

Convert the hash into the object.

id = <AutoField: Transactions.id>
metadata
suspense_date = <ExtendDateField: Transactions.suspense_date>
to_hash(**flags)[source]

Convert the object to a hash.

transsap
transsip
updated = <ExtendDateTimeField: Transactions.updated>
users
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Transaction Release Python Module

Transaction, Submitter, Analytical Tool, Project Python Module

TransSAP model.

class pacifica.metadata.orm.transsap.TransSAP(*args, **kwargs)[source]

TransSAP model class.

Attributes:
Name Description
submitter User who submitted the transaction
analytical_tool Analytical tool the transaction came from
project Project the transaction is for
suspense_date date the transaction is available
DoesNotExist

alias of TransSAPDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
analytical_tool = <ForeignKeyField: TransSAP.analytical_tool>
analytical_tool_id = <ForeignKeyField: TransSAP.analytical_tool>
created = <ExtendDateTimeField: TransSAP.created>
deleted = <ExtendDateTimeField: TransSAP.deleted>
from_hash(obj)[source]

Convert the hash into the object.

id = <ForeignKeyField: TransSAP.id>
id_id = <ForeignKeyField: TransSAP.id>
project = <ForeignKeyField: TransSAP.project>
project_id = <ForeignKeyField: TransSAP.project>
submitter = <ForeignKeyField: TransSAP.submitter>
submitter_id = <ForeignKeyField: TransSAP.submitter>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: TransSAP.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Transaction, Submitter, Instrument, Project Python Module

TransSIP model.

class pacifica.metadata.orm.transsip.TransSIP(*args, **kwargs)[source]

TransSIP model class.

Attributes:
Name Description
submitter User who submitted the transaction
instrument Instrument the transaction came from
project Project the transaction is for
suspense_date date the transaction is available
DoesNotExist

alias of TransSIPDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: TransSIP.created>
deleted = <ExtendDateTimeField: TransSIP.deleted>
from_hash(obj)[source]

Convert the hash into the object.

id = <ForeignKeyField: TransSIP.id>
id_id = <ForeignKeyField: TransSIP.id>
instrument = <ForeignKeyField: TransSIP.instrument>
instrument_id = <ForeignKeyField: TransSIP.instrument>
project = <ForeignKeyField: TransSIP.project>
project_id = <ForeignKeyField: TransSIP.project>
submitter = <ForeignKeyField: TransSIP.submitter>
submitter_id = <ForeignKeyField: TransSIP.submitter>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: TransSIP.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Transaction Key Value Python Module

TransactionKeyValue links Transactions and Keys and Values objects.

class pacifica.metadata.orm.trans_key_value.TransactionKeyValue(*args, **kwargs)[source]

TransactionKeyValue attributes are foreign keys.

Attributes:
Name Description
transaction Link to the Transactions model
key Link to the Keys model
value Link to the Values model
DoesNotExist

alias of TransactionKeyValueDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: TransactionKeyValue.created>
deleted = <ExtendDateTimeField: TransactionKeyValue.deleted>
from_hash(obj)[source]

Convert the hash into the object.

key = <ForeignKeyField: TransactionKeyValue.key>
key_id = <ForeignKeyField: TransactionKeyValue.key>
to_hash(**flags)[source]

Convert the object to a hash.

transaction = <ForeignKeyField: TransactionKeyValue.transaction>
transaction_id = <ForeignKeyField: TransactionKeyValue.transaction>
updated = <ExtendDateTimeField: TransactionKeyValue.updated>
value = <ForeignKeyField: TransactionKeyValue.value>
value_id = <ForeignKeyField: TransactionKeyValue.value>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Users Python Module

Users data model.

class pacifica.metadata.orm.users.Users(*args, **kwargs)[source]

Users data model object.

Attributes:
Name Description
first_name first name of the user/person
middle_initial middle initial of the user/person
last_name last name of the user/person
network_id computer account of the user/person
email_address user/person email address
encoding encoding for the other attrs
DoesNotExist

alias of UsersDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
contributions
created = <ExtendDateTimeField: Users.created>
deleted = <ExtendDateTimeField: Users.deleted>
dois_created
email_address = <CharField: Users.email_address>
encoding = <CharField: Users.encoding>
first_name = <CharField: Users.first_name>
from_hash(obj)[source]

Convert the hash into the object.

groups
id = <AutoField: Users.id>
institutions
instruments
last_name = <CharField: Users.last_name>
middle_initial = <CharField: Users.middle_initial>
network_id = <CharField: Users.network_id>
projects
to_hash(**flags)[source]

Convert the object to a hash.

transactions
transsap
transsip
updated = <ExtendDateTimeField: Users.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

User Group Python Module

UserGroup links Groups and Users and objects.

class pacifica.metadata.orm.user_group.UserGroup(*args, **kwargs)[source]

UserGroup attributes are foreign keys.

Attributes:
Name Description
person Link to the Users model
group Link to the Groups model
DoesNotExist

alias of UserGroupDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: UserGroup.created>
deleted = <ExtendDateTimeField: UserGroup.deleted>
from_hash(obj)[source]

Convert the hash into the object.

group = <ForeignKeyField: UserGroup.group>
group_id = <ForeignKeyField: UserGroup.group>
person = <ForeignKeyField: UserGroup.person>
person_id = <ForeignKeyField: UserGroup.person>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: UserGroup.updated>
classmethod where_clause(kwargs)[source]

Where clause for the various elements.

Utils Python Module

Utilities for common metadata tools.

class pacifica.metadata.orm.utils.ExtendDateField(formats=None, *args, **kwargs)[source]

Appends to the DateField to add isoformatted date.

isoformat()[source]

Return the isoformat date field.

class pacifica.metadata.orm.utils.ExtendDateTimeField(formats=None, *args, **kwargs)[source]

Appends to the DateTimeField to add isoformat from datetime object.

isoformat()[source]

Return the isoformat datetime field.

class pacifica.metadata.orm.utils.UUIDEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

UUID Encoder to JSON.

default(o)[source]

Encode tne UUID by returning it’s hex value.

pacifica.metadata.orm.utils.date_converts(date_obj)[source]

Standardize on converting to date objects.

pacifica.metadata.orm.utils.datetime_converts(time_obj)[source]

Standardize on converting to datetime objects.

pacifica.metadata.orm.utils.datetime_now_nomicrosecond()[source]

Return now with no microseconds.

pacifica.metadata.orm.utils.index_hash(*args)[source]

Generate a hash for all the arguments passed.

This is used to combine multiple unique IDs into a single string.

Values Python Module

Contains the model for metadata values.

class pacifica.metadata.orm.values.Values(*args, **kwargs)[source]

Values model class for metadata.

Attributes:
Name Description
value generic value for some metadata
encoding language encoding of the value
DoesNotExist

alias of ValuesDoesNotExist

_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
created = <ExtendDateTimeField: Values.created>
deleted = <ExtendDateTimeField: Values.deleted>
encoding = <CharField: Values.encoding>
from_hash(obj)[source]

Convert the hash to the object.

id = <AutoField: Values.id>
to_hash(**flags)[source]

Convert the object to a hash.

updated = <ExtendDateTimeField: Values.updated>
value = <CharField: Values.value>
classmethod where_clause(kwargs)[source]

PeeWee specific where clause used for search.

Core ORM Module.

REST Python Module

DOI Queries Python Module

DOI Modified Time Update Python Module

CherryPy DOI Registration Updater object class.

class pacifica.metadata.rest.doi_queries.doi_modified_time_update.DOIModifiedTimeUpdate[source]

Updates DOI Entries with new mod times.

static POST()[source]

Update existing DOI Entries.

static _update_modification_times(doi_list)[source]

Touch a list of DOI Entries to force a modification time update.

exposed = True
DOI Registration Base Python Module

CherryPy DOI Registration Updater object class.

class pacifica.metadata.rest.doi_queries.doi_registration_base.DOIRegistrationBase[source]

Base class for DOI registration functionality.

static _check_doi_info_for_change(item_to_check, value)[source]
static _update_doi_metadata_info(doi_info, doi_string)[source]
static change_doi_entry_info(doi_string, doi_info, status='pending', released=False)[source]

Update or create DOI entries.

static make_doi_entry_info(doi_string, doi_info, creator, status='pending', released=False)[source]

Update or create DOI entries.

DOI Registration Entry Python Module

CherryPy DOI Registration Updater object class.

class pacifica.metadata.rest.doi_queries.doi_registration_entry.DOIRegistrationEntry[source]

Updates the database with new DOI registration info from registration API.

static POST()[source]

Upload and create new DOI Entries.

static _add_doi_record_entry(doi_info)[source]
exposed = True
DOI Registration Update Python Module

CherryPy DOI Registration Updater object class.

class pacifica.metadata.rest.doi_queries.doi_registration_update.DOIRegistrationUpdate[source]

Updates the database with new DOI registration info from registration API.

static POST()[source]

Update existing DOI Entries.

static _check_for_doi_entry(doi_string)[source]
static _clean_author_info(author_info)[source]
static _extract_authors(creatorsblock_element, doi_string)[source]
static _extract_doi_info_from_xml(record_object)[source]
static _process_child_object(child_object)[source]
static _process_updated_osti_info(osti_xml_string)[source]

Access the server at OSTI and get all the relevant details for this DOI.

static _update_author_info(author_list, doi_string)[source]
exposed = True

Rest module for the DOI queries.

File Info Python Module

Earliest Latest Python Module

CherryPy File Details object class.

class pacifica.metadata.rest.fileinfo_queries.earliest_latest.EarliestLatestFiles[source]

Retrieves earliest and latest file entries for a set of metadata specifiers.

static POST(item_type, time_basis)[source]

Return file details for the list of file id’s.

static _get_earliest_latest(item_type, item_list, time_basis)[source]
exposed = True
Files With Tkv Python Module

CherryPy File Details object class.

class pacifica.metadata.rest.fileinfo_queries.files_with_tkv.FilesWithTransactionKeyValue[source]

Retrieves file details for a list of files having a certain key/value combo.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

static _get_files_for_kv_pair(key, value)[source]
exposed = True
File Details Python Module

CherryPy File Details object class.

class pacifica.metadata.rest.fileinfo_queries.file_details.FileDetailsLookup[source]

Retrieves file details for a list of file id’s.

static POST()[source]

Return file details for the list of file id’s.

static _get_file_details(file_list)[source]
exposed = True

Rest module for the FileInfo queries.

Instrument Queries Python Module

Instrument Categories Python Module

CherryPy Metadata Instrument Categories Class.

class pacifica.metadata.rest.instrument_queries.instrument_categories.InstrumentCategories[source]

Calculates a set of instrument categories from the display names of EUS instruments.

static GET()[source]

CherryPy GET method.

exposed = True
static get_instrument_categories()[source]

Pull the full list of instrument categories from the DB.

Instrument Lookup Python Module

CherryPy Status Metadata object class.

class pacifica.metadata.rest.instrument_queries.instrument_lookup.InstrumentLookup[source]

Retrieves a set of projects for a given keyword set.

static GET(instrument_id=None)[source]

CherryPy GET method.

static _get_instrument_details(instrument_id)[source]

Return a formatted dictionary containing the details of a given Instrument entry.

exposed = True
Query Base Python Module

CherryPy Status Metadata projectinfo base class.

class pacifica.metadata.rest.instrument_queries.query_base.QueryBase[source]

Retrieves a set of instruments for a given keyword set.

static format_instrument_block(instrument_entry)[source]

Construct a dictionary from a given instrument instance in the metadata stack.

static instrument_help_block_message()[source]

Assemble a block of relevant help text to be returned with an invalid request.

Rest module for the InstrumentInfo queries.

Migration Queries Python Module

Migrate Instruments Python Module

CherryPy Metadata Migration Class for Instrument Entities.

class pacifica.metadata.rest.migration_queries.migrate_instruments.MigrateInstruments[source]

Generate a streamlined query for importing instrument entities and linkages.

static GET()[source]

CherryPy GET Method.

exposed = True
static generate_instrument_list()[source]

Generate instrument objects with linkages.

Migrate Projects Python Module

CherryPy Metadata Migration Class for Instrument Entities.

class pacifica.metadata.rest.migration_queries.migrate_projects.MigrateProjects[source]

Generate a streamlined query for importing project entities and linkages.

static GET()[source]

CherryPy GET Method.

exposed = True
static generate_project_list()[source]

Generate project objects with linkages.

Migrate Users Python Module

CherryPy Metadata Migration Class for User Entities.

class pacifica.metadata.rest.migration_queries.migrate_users.MigrateUsers[source]

Generate a streamlined query for importing instrument entities and linkages.

static GET()[source]

CherryPy GET Method.

exposed = True
static generate_user_list()[source]

Generate user objects with linkages.

Rest module for the FileInfo queries.

Project Queries Python Module

Project Has Data Python Module

CherryPy Status Metadata object class.

class pacifica.metadata.rest.project_queries.project_has_data.ProjectHasData[source]

Does the project have data for instruments.

static POST(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
Project Lookup Python Module

CherryPy Status Metadata object class.

class pacifica.metadata.rest.project_queries.project_lookup.ProjectLookup[source]

Retrieves a set of projects for a given keyword set.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

static _get_project_details(project_id)[source]

Return a formatted dictionary containing the details of a given Project entry.

exposed = True
Query Base Python Module

CherryPy Status Metadata projectinfo base class.

class pacifica.metadata.rest.project_queries.query_base.QueryBase[source]

Retrieves a set of projects for a given keyword set.

static format_project_block(project_entry, instruments=None)[source]

Construct a dictionary from a given project instance in the metadata stack.

static project_help_block_message()[source]

Assemble a block of relevant help text to be returned with an invalid request.

Rest module for the ProjectInfo queries.

Reporting Query Python Module

Detailed Transactions List Python Module

CherryPy Status Metadata object class.

class pacifica.metadata.rest.reporting_queries.detailed_transactions_list.DetailedTransactionList[source]

Retrieves a list of all transactions matching the search criteria.

static POST(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
static get_transaction_list_details(transaction_list)[source]

Return complete data set on a specified transaction.

Query Base Python Module

CherryPy Status Metadata projectinfo base class.

class pacifica.metadata.rest.reporting_queries.query_base.QueryBase[source]

Formats summary data for other classes down the tree.

local_timezone = <DstTzInfo 'America/Los_Angeles' LMT-1 day, 16:07:00 STD>
object_type_mappings = {'instrument': 'instrument', 'project': 'project', 'user': 'submitter'}
time_basis_mappings = {'created': 'ctime', 'modified': 'mtime', 'submitted': 'updated'}
Summarize By Date Python Module

CherryPy Status Metadata object class.

class pacifica.metadata.rest.reporting_queries.summarize_by_date.SummarizeByDate[source]

Retrieves a list of all transactions matching the search criteria.

static POST(*args, **kwargs)

Wrapper to connect and close connection to database.

static _canonicalize_dates(start_date, end_date)[source]
static _search_by_dates(object_type, object_id_list, start_date, end_date, time_basis)[source]
static _summarize_by_date(summary_block, item)[source]
static _summarize_upload_stats(upload_stats_block, transaction_info)[source]
static _update_transaction_info_block(info_block, item, t_info)[source]
exposed = True
static local_to_utc(local_datetime_obj)[source]

Return a TZ corrected datetime object.

static utc_to_local(utc_datetime_obj)[source]

Return a TZ corrected datetime object.

Rest module for the ProjectInfo queries.

Transaction Key Value Queries Python Module

Key Values For Transaction Python Module

CherryPy File Details object class.

class pacifica.metadata.rest.tkvinfo_queries.kvs_for_transaction.KVsForTransaction[source]

Retrieves a list of key/value pairs for a transaction_id.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
static get_kv_pairs_for_transaction(transaction_id)[source]

Retrieve a list of key/value pairs for a transaction_id.

Values For Key Python Module

CherryPy File Details object class.

class pacifica.metadata.rest.tkvinfo_queries.values_for_key.ValuesForKey[source]

Retrieves a list of values for a given key from the trans_key_value table.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
static get_values_for_key(key, start_time, end_time)[source]

Retrieve all the tkv values for a given key item.

Rest module for the Transaction Key Value Info queries.

Transaction Key Value Upload Queries Python Module

Upload Entries Python Module

CherryPy TKV Metadata object class.

class pacifica.metadata.rest.tkvupload_queries.upload_entries.UploadEntries[source]

Uploads new transaction key/value pairs to Pacifica.

static POST()[source]

Return file details for the list of file id’s.

static _get_id_list(names_list, model_obj, field_name)[source]
static _insert_kv_mappings(item, key_cache, value_cache, transaction_id)[source]
static _update_id_list(names_list, model_obj, field_name)[source]
static add_or_update(item_list)[source]

Add or update transacton key value items.

exposed = True
upload_keys_cache = {}

Rest module for the ProjectInfo queries.

Transaction Queries Python Module

File Lookup Python Module

CherryPy Status File Metadata object class.

class pacifica.metadata.rest.transaction_queries.file_lookup.FileLookup[source]

Retrieves file listing for an individual transaction.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
Query Base Python Module

CherryPy Status Metadata projectinfo base class.

class pacifica.metadata.rest.transaction_queries.query_base.QueryBase[source]

Retrieves a set of projects for a given keyword set.

static _get_base_transaction_metadata(transaction_entry, option=None)[source]
static _get_file_key_values(file_entries)[source]
static _get_file_list(transaction_id)[source]
static _get_transaction_entries(transaction_list)[source]
static _get_transaction_info_block(transaction_id, option='details')[source]
static _get_transaction_info_blocks(transaction_list, option='details')[source]
static _get_transaction_key_values(transaction_id)[source]
static _get_transaction_sizes(transaction_list)[source]
static compose_help_block_message()[source]

Assemble a block of relevant help text to be returned with an invalid request.

valid_keywords = ['project', 'project_id', 'instrument', 'instrument_id', 'requesting_user', 'time_frame', 'start_time', 'start', 'end_time', 'end', 'transaction_id', 'user', 'user_id', 'person', 'person_id', 'submitter', 'submitter_id', 'item_count', 'page']
Transaction Last Python Module

CherryPy Status Transaction Metadata object class.

class pacifica.metadata.rest.transaction_queries.transaction_last.TransactionLast[source]

Retrieves details for an individual transaction.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

static _get_last_known_transaction()[source]
exposed = True
Transaction Lookup Python Module

CherryPy Status Transaction Metadata object class.

class pacifica.metadata.rest.transaction_queries.transaction_lookup.TransactionLookup[source]

Retrieves details for an individual transaction.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
Transaction Release State Python Module

CherryPy Status Transaction Metadata object class.

class pacifica.metadata.rest.transaction_queries.transaction_release_state.TransactionReleaseState[source]

Retrieves release state for an individual transaction (GET) or set of transactions (POST).

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

static POST(*args, **kwargs)

Wrapper to connect and close connection to database.

static _generate_missing_transactions(transaction_list, found_transactions)[source]
static _get_citation_release(transaction_id)[source]
static _get_doi_release(transaction_id)[source]
static _get_release_info(transaction_list)[source]
static _get_release_state(transaction_list)[source]
exposed = True

Rest module for the ProjectInfo queries.

User Queries Python Module

Query Base Python Module

CherryPy Status Metadata projectinfo base class.

class pacifica.metadata.rest.user_queries.query_base.QueryBase[source]

Retrieves a set of projects for a given keyword set.

static _is_admin_user(user_entry)[source]
static compose_help_block_message()[source]

Assemble a block of relevant help text to be returned with an invalid request.

static format_user_block(user_entry, option=None)[source]

Construct a dictionary from a given user instance in the metadata stack.

User Lookup Python Module

CherryPy Status Metadata object class.

class pacifica.metadata.rest.user_queries.user_lookup.UserLookup[source]

Retrieves detailed info for a given user.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
static get_user_info_block(person_id, option=None)[source]

Return a formatted dictionary containing the details of a given user entry.

Rest module for the ProjectInfo queries.

DOI Upload Python Module

Core interface to upload DOI registration info into metadata with CherryPy.

class pacifica.metadata.rest.doiupload.DOIUploadAPI[source]

InstrumentInfo API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Fileinfo Python Module

Core interface for the fileinfo metadataobjects.

class pacifica.metadata.rest.fileinfo.FileInfoAPI[source]

FileInfoAPI.

__init__()[source]

Create local objects for subtree items.

exposed = True

Ingest Python Module

Core interface for the ingest of metadata objects.

Example uploaded data:

[
  {"destinationTable": "Transactions._id", "value": 1234},
  {"destinationTable": "Transactions.submitter", "value": 34002},
  {"destinationTable": "Transactions.project", "value": 34002},
  {"destinationTable": "Transactions.instrument", "value": 34002},
  {"destinationTable": "TransactionKeyValue", "key": "Tag", "value": "Blah"},
  {"destinationTable": "TransactionKeyValue", "key": "Taggy", "value": "Blah"},
  {"destinationTable": "TransactionKeyValue", "key": "Taggier", "value": "Blah"}
  {
    "destinationTable": "Files",
    "_id": 34, "name": "foo.txt", "subdir": "a/b/",
    "ctime": "Tue Nov 29 14:09:05 PST 2016",
    "mtime": "Tue Nov 29 14:09:05 PST 2016",
    "size": 128, "mimetype": "text/plain"
  },
  {
      "destinationTable": "FileKeyValue",
      "key": "Micronic Adjustment",
      "value": "5.66%",
      "file_id": 34
  },
  {
    "destinationTable": "Files",
    "_id": 35, "name": "bar.txt", "subdir": "a/b/",
    "ctime": "Tue Nov 29 14:09:05 PST 2016",
    "mtime": "Tue Nov 29 14:09:05 PST 2016",
    "size": 47, "mimetype": "text/plain"
  },
]
class pacifica.metadata.rest.ingest.IngestAPI[source]

Uploader ingest API.

static PUT(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
static validate_file_meta(file_meta)[source]

Validate the file metadata.

static validate_hash_data(hashtype, hashsum)[source]

Validate the hashtype and hashsum are valid.

static validate_mime_type(mimetype)[source]

Validate the mimetype string.

Instrumentinfo Python Module

Core interface for the projectinfo metadata objects to interface with CherryPy.

class pacifica.metadata.rest.instrumentinfo.InstrumentInfoAPI[source]

InstrumentInfo API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Migrationinfo Python Module

Core interface for the projectinfo metadata objects to interface with CherryPy.

class pacifica.metadata.rest.migrationinfo.MigrationInfoAPI[source]

MigrationInfo API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Objectinfo Python Module

Core interface for the uploader metadata objects to interface with CherryPy.

class pacifica.metadata.rest.objectinfo.ObjectInfoAPI[source]

ObjectInfoAPI API.

static GET(*args, **kwargs)

Wrapper to connect and close connection to database.

exposed = True
static get_class_object_from_name(object_class_name)[source]

Return a metadata model class for a given class name string.

Orm Python Module

Core interface for each ORM object to interface with CherryPy.

class pacifica.metadata.rest.orm.CherryPyAPI(*args, **kwargs)[source]

Core CherryPy interface for all orm objects.

DELETE(**kwargs)

Wrapper to connect and close connection to database.

DoesNotExist

alias of CherryPyAPIDoesNotExist

GET(**kwargs)

Wrapper to connect and close connection to database.

POST(**kwargs)

Wrapper to connect and close connection to database.

PUT(**kwargs)

Wrapper to connect and close connection to database.

static _CherryPyAPI__fix_dates(orig_obj, db_obj)

Fix the dates for insert.

_delete(**kwargs)[source]

Internal delete object method.

_force_delete(**kwargs)[source]

Force delete entries in the database.

_insert(objs)[source]

Insert object from json into the system.

classmethod _insert_many_format(obj_hashes)[source]
_meta = <peewee.Metadata object>
_schema = <peewee.SchemaManager object>
_select(**kwargs)[source]

Internal select method.

_set_or_create(objs)[source]

Set or create the object if it doesn’t already exist.

static _set_recursion_depth(flags, kwargs)[source]
static _set_recursion_limit(flags, kwargs)[source]
_update(update_hash, **kwargs)[source]

Internal update method for an object.

classmethod check_for_key_existence(object_list)[source]

Check for already loaded keys to prevent collisions.

created = <ExtendDateTimeField: CherryPyAPI.created>
deleted = <ExtendDateTimeField: CherryPyAPI.deleted>
es_recursive_flags = {'recursion_depth': 1, 'recursion_exclude': [], 'recursion_limit': 1000}
exposed = True
id = <AutoField: CherryPyAPI.id>
updated = <ExtendDateTimeField: CherryPyAPI.updated>
pacifica.metadata.rest.orm._encode(value)[source]
pacifica.metadata.rest.orm.json_handler(*args, **kwargs)[source]

JSON handler to encode the data value.

Projectinfo Python Module

Core interface for the projectinfo metadata objects to interface with CherryPy.

class pacifica.metadata.rest.projectinfo.ProjectInfoAPI[source]

ProjectInfo API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Root Python Module

CherryPy root object class.

class pacifica.metadata.rest.root.Root[source]

CherryPy root object class.

not exposed by default the base objects are exposed

analytical_tools = <AnalyticalTools: None>
atool_project
atool_transaction
citation_contributor
citation_doi
citation_keyword
citation_project
citation_transaction
citations = <Citations: None>
contributors = <Contributors: None>
data_sources = <DataSources: a2a764ea-2d3f-4603-afc6-43e87fd86eb7>
doi_author_mapping
doi_authors = <DOIAuthors: None>
doi_entries = <DOIEntries: None>
doi_info
doi_transaction
doiupload = <pacifica.metadata.rest.doiupload.DOIUploadAPI object>
exposed = True
file_key_value
fileinfo = <pacifica.metadata.rest.fileinfo.FileInfoAPI object>
files = <Files: None>
groups = <Groups: None>
ingest = <pacifica.metadata.rest.ingest.IngestAPI object>
institution_user = <InstitutionUser: e6342a24-6470-4d58-be2b-ba0c5e770ec5>
institutions = <Institutions: None>
instrument_data_source
instrument_group
instrument_key_value
instrument_user = <InstrumentUser: 2fcf7916-650c-4831-9067-1c3263d5789b>
instrumentinfo = <pacifica.metadata.rest.instrumentinfo.InstrumentInfoAPI object>
instruments = <Instruments: None>
journals = <Journals: None>
keys = <Keys: None>
keywords = <Keywords: None>
migrate = <pacifica.metadata.rest.migrationinfo.MigrationInfoAPI object>
objectinfo = <pacifica.metadata.rest.objectinfo.ObjectInfoAPI object>
project_group
project_instrument = <ProjectInstrument: eb20187c-a449-432a-932d-1ac40f261848>
project_user = <ProjectUser: d34f1629-c4f0-491c-9860-abf9f7bd064b>
projectinfo = <pacifica.metadata.rest.projectinfo.ProjectInfoAPI object>
projects = <Projects: None>
relationships = <Relationships: 45230d34-47e1-49e4-b4a9-c1a911dd3de6>
summaryinfo = <pacifica.metadata.rest.summaryinfo.SummaryInfoAPI object>
tkvinfo = <pacifica.metadata.rest.tkvinfo.TkvInfoAPI object>
tkvupload = <pacifica.metadata.rest.tkvupload.TkvUploadAPI object>
trans_key_value
transaction_user = <TransactionUser: ee591a3a-52d0-4fc4-a086-b240fc2fc89c>
transactioninfo = <pacifica.metadata.rest.transactioninfo.TransactionInfoAPI object>
transactions = <Transactions: None>
transsap
transsip
user_group
userinfo = <pacifica.metadata.rest.userinfo.UserInfoAPI object>
users = <Users: None>
values = <Values: None>
pacifica.metadata.rest.root.error_page_default(**kwargs)[source]

The default error page should always enforce json.

Summaryinfo Python Module

Core interface for the summaryInfo metadata objects to interface with CherryPy.

class pacifica.metadata.rest.summaryinfo.SummaryInfoAPI[source]

SummaryInfo API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Transaction Key Value Info Python Module

Transaciton Key Value Upload Base CherryPy.

class pacifica.metadata.rest.tkvinfo.TkvInfoAPI[source]

Transaction Key Value Info API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Tkvupload Python Module

Core interface for the tkvupload metadata objects to interface with CherryPy.

class pacifica.metadata.rest.tkvupload.TkvUploadAPI[source]

InstrumentInfo API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Transactioninfo Python Module

Core interface for transactioninfo metadata objects to interface with CherryPy.

class pacifica.metadata.rest.transactioninfo.TransactionInfoAPI[source]

TransactionInfoAPI API.

__init__()[source]

Create local objects for subtree items.

exposed = True

Userinfo Python Module

Core interface for the userinfo metadata objects to interface with CherryPy.

class pacifica.metadata.rest.userinfo.UserInfoAPI[source]

UserInfo API.

__init__()[source]

Create local objects for subtree items.

exposed = True
pacifica.metadata.rest.userinfo.user_exists_decorator(func)[source]

Wrap a method with user existence checking.

Rest module for the ORM utilizes CherryPy.

WSGI Python Module

The WSGI interface module for metadata.

Client Python Module

Metadata Client Module.

class pacifica.metadata.client.PMClient(url)[source]

Pacifica Metadata Client.

This class provides client API to connect to the metadata service

__init__(url)[source]

Constructor takes the url to the endpoint.

create(cls_type, set_hash)[source]

Create the object of type based on hash.

delete(cls_type, query_hash)[source]

Delete the object of type from query_hash.

get(cls_type, query_hash)[source]

Get the object of type from query_hash.

headers = {'content-type': 'application/json'}
update(cls_type, query_hash, set_hash)[source]

Update the object.

Update object of type returned from query_hash and set the values in set_hash

exception pacifica.metadata.client.PMClientError[source]

Base Exception Error Class.

Admin Command Python Module

Admin Module for Admin Commands.

pacifica.metadata.admin_cmd.bool2cmdint(command_bool)[source]

Convert a boolean to either 0 for true or -1 for false.

pacifica.metadata.admin_cmd.create_subcommands(subparsers)[source]

Create the subcommands from the subparsers.

pacifica.metadata.admin_cmd.create_table(args)[source]

Create a specific object.

pacifica.metadata.admin_cmd.create_table_options(create_table_parser)[source]

Add the create object command line options.

pacifica.metadata.admin_cmd.db_options(db_parser)[source]

Add the options for dbsync subcommand.

pacifica.metadata.admin_cmd.dbchk(args)[source]

Check the database for the version running.

pacifica.metadata.admin_cmd.dbchk_options(dbchk_parser)[source]

Add the options for dbchk.

pacifica.metadata.admin_cmd.dbsync(_args=None)[source]

Create or update the database.

pacifica.metadata.admin_cmd.delete_obj(args)[source]

Delete an object based on args.

pacifica.metadata.admin_cmd.delete_obj_options(delete_obj_parser)[source]

Delete the object command line options.

pacifica.metadata.admin_cmd.main(*argv)[source]

Main method for admin command line tool.

pacifica.metadata.admin_cmd.objstr_to_ormobj(obj_str)[source]

Convert a string to an orm object or raise ValueError.

pacifica.metadata.admin_cmd.objstr_to_timedelta(obj_str)[source]

Turn an object string of the format X unit ago into timedelta.

pacifica.metadata.admin_cmd.objstr_to_whereclause(obj_str)[source]

Convert a string to a where clause hash or raise ValueError.

pacifica.metadata.admin_cmd.render_obj(args)[source]

Render an object based on args.

pacifica.metadata.admin_cmd.render_options(render_parser)[source]

Add the essync command line options.

ElasticSearch Sync Python Module

Pacifica Metadata Module.

Metadata Module.

pacifica.metadata.__main__.main()[source]

Main method to start the httpd server.

pacifica.metadata.__main__.stop_later(doit=False)[source]

Used for unit testing stop after 10 seconds.

Indices and tables