OARepo DC data model
DC Terms data model for oarepo.
Instalation
pip install oarepo-dc
Usage
The library provides Dublin Core object for json schema with marshmallow validation and deserialization and elastic search mapping.
JSON Schema
Add this package to your dependencies and use it via $ref in json
schema as "[server]/schemas/dcterms-v2.0.0.json#/definitions/DCObject".
Elastic Search mapping is handled automatically via Eleastic Search templates.
Usage example
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"these": {
"$ref": "https://localhost:5000/schemas/dcterms-v2.0.0.json#/definitions/DCObject"
}
}
}
{
"type": "object",
"properties": {
"these": {
"abstract" : {"cs": "neco", "en": "something"},
"contributor" : "Alzbeta Pokorna",
"modified":"2012-04-23T18:25:43.511Z"
}
}
}
Marshmallow
For data validation and deserialization.
If marshmallow validation is performed within application context, languages in multilingual string data fields are validated against SUPPORTED_LANGUAGES config. If the validation is performed outside app context, the keys are not checked against a list of languages but a generic validation is performed - keys must be in ISO 639-1 or language-region format from RFC 5646.
Usage example
class MD(DCObjectSchemaV2Mixin, marshmallow.Schema):
pass
data = {"title": {"cs": "neco"},
"alternative": {"en-us": "something", "cs": "neco"},
"abstract": {},
"creator": "Alzbeta Pokorna",
"contributor": "Miroslav Simek",
"dateSubmitted": "1970-10-12",
"available": "1970-03-18",
"created": "1970-09-29",
"modified": "1970-12-31",
"description": {"en-us": "something", "cs": "neco"},
"identifier": "id"}
MD().load(data)
Supported languages validation
You can specified supported languages in your application configuration in SUPPORTED_LANGUAGES . Then only these
languages are allowed as multilingual string.
You must specified your languages in format "en" or "en-us".
Usage example
app.config.update(SUPPORTED_LANGUAGES = ["cs", "en"])
Changes
Version 2.0.0 (released 2020-08-25)
- Initial public release.
Metadata
Release files for oarepo-dc 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| oarepo_dc-2.2.0.tar.gz | 7.9 kB | Without provenance | Details for oarepo_dc-2.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| oarepo_dc-2.2.0-py3-none-any.whl | Python 3 | none | any | Details for oarepo_dc-2.2.0-py3-none-any.whl |
Total release size: 15.2 kB
Release files / oarepo_dc-2.2.0.tar.gz
| Download URL | oarepo_dc-2.2.0.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
73980df0f6d774d2951cef6744f97cd34519b0dd2b6e89c3ab6b5f0aff8b64f0
|
|
BLAKE2b-256 checksum How to use checksums |
ea2f522a129aa709c04add906e3af0d4af74d4a036766b9e18549b64c426391b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Release files / oarepo_dc-2.2.0-py3-none-any.whl
| Download URL | oarepo_dc-2.2.0-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75bfb07c97b546fd62b52590968d1884fddcaaecd571e0ddaa4b108e48245d81
|
|
BLAKE2b-256 checksum How to use checksums |
4b63004926975731d60c0dbfb5ba8dd86931837c0909b1772f87ee4d70a0c361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4
|
Security for oarepo-dc 2.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.