Source code for arxiv.canonical.domain.license
"""Provide license-related domain concepts and logic."""
from typing import Any, Dict, Iterable
from .base import CanonicalBase
[docs]class License(CanonicalBase):
"""License under which the e-print was provided to arXiv."""
href: str
"""URI of the license resource."""
def __init__(self, href: str) -> None:
self.href = href
[docs] @classmethod
def from_dict(cls, data: Dict[str, Any]) -> 'License':
"""Reconstitute from a native dict."""
return cls(href=data['href'])
[docs] def to_dict(self) -> Dict[str, Any]:
"""Generate a native dict representation."""
return {'href': self.href}