Skip to content

Commit 90d76f3

Browse files
committed
Merge branch '0.5.0' into 'main'
0.5.0: improve documentation and rebase enumerations See merge request ado/core/external/elink2/python!6
2 parents af3eb8f + 099ffa3 commit 90d76f3

File tree

6 files changed

+204
-11
lines changed

6 files changed

+204
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,7 @@
131131
- Support patch methods to update metadata through new endpoints
132132
- Added documentation and explanations to a number of library functions
133133
- Accept dict or keyword arguments for Record argument methods
134+
135+
## 0.5.0 - 7/9/2025
136+
- **Possible breaking change** Moved WorkflowStatus enumeration from Revision subclass to standalone class
137+
- Added documentation for enumerations in README

README.md

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@
3636
- [Media File](#media-file)
3737
- [Revision](#revision)
3838
- [Revision Comparison](#revision-comparison)
39+
- [Enumerations](#enumerations)
40+
- [AccessLimtation](#access-limitation)
41+
- [JournalType](#journal-type)
42+
- [ProductType](#product-type)
43+
- [PAMSPatentStatus](#pams-patent-status)
44+
- [PAMSProductSubType](#pams-product-subtype)
45+
- [PAMSPublicationStatus](#pams-publication-status)
46+
- [WorkflowStatus](#workflow-status)
3947
- [Exceptions](#exceptions)
4048
- [UnauthorizedException](#unauthorized-exception)
4149
- [ForbiddenException](#forbidden-exception)
@@ -705,6 +713,180 @@ Each media file is uniquely identified by its "media_file_id" sequence number, g
705713
]
706714
```
707715

716+
## Enumerations<a id="enumerations"></a>
717+
718+
A number of enumerations are provided for use in Record construction or as field value vocabulary as applicable. The following list indicates the
719+
descriptions and uses of each of the provided value sets and where they apply. Each may be individually imported as needed:
720+
721+
```python
722+
from elinkapi import AccessLimitation, ProductType
723+
724+
>>> AccessLimitation.UNL
725+
<AccessLimitation.UNL: 'Unlimited'>
726+
>>> AccessLimitation.UNL.name
727+
'UNL'
728+
>>> help(AccessLimitation)
729+
Help on class AccessLimitation in module elinkapi.record:
730+
731+
class AccessLimitation(enum.Enum)
732+
| AccessLimitation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
733+
|
734+
| Access limitations, or distribution limitations, describe the intended audience
735+
| or any restrictions to be placed upon the distribution of this product's metadata
736+
| and/or related full text. This may range from UNL (Unlimited), being essentially
737+
| no restriction, to various levels of limited audience notations as desired.
738+
|
739+
| Note that many combinations are disallowed as conflicting; UNL may not be
740+
| combined with most others, for example, while OUO is often combined with various
741+
| other levels (e.g., PROT, SSI, etc.)
742+
:
743+
```
744+
745+
### Access or Distribution Limitations<a id="access-limitation"></a>
746+
747+
Defines one or more access or distribution limitations for the indicated Record, indicating various sensitivity markings or other details about
748+
how this product should be distributed via OSTI.gov or other OSTI output products, and its dissemination once fully processed. Note that a number
749+
of these (indicated in descriptions below) are legacy or historical in context, and generally will not be accepted as new product or revision data.
750+
751+
Most access limitations beyond UNL will require additional information for definitions in other required fields. Note that only certain combinations of access limitations are valid; sensitive limitations such as PROT, OUO, and the like may not be combined with UNL, for example.
752+
753+
CUI access limitation must be specified alone, and additional CUI markings designated in the access_limitation_other field.
754+
755+
For these enumerations, the Name is also the code value in the Record access_limitations array.
756+
757+
| Name | Description |
758+
| -- | -- |
759+
| AT | Applied Technology (legacy) |
760+
| UNL| Unlimited |
761+
| OPN | Opennet |
762+
| CPY | Copyrighted Information |
763+
| CUI | Controlled Unclassified Information |
764+
| OUO | Official Use Only |
765+
| ECI | Export-controlled Information |
766+
| SSI | Security sensitive information |
767+
| PROT | Protected data |
768+
| PAT | Patented information |
769+
| LRD | Limited Rights Data |
770+
| PDOUO | Program-determined OUO |
771+
| NNPI | Naval Navication Propulsion Information |
772+
| INTL | International Data |
773+
| ILLIM | International (legacy) |
774+
| ILUSO | International (legacy) |
775+
| OTHR | Other/unknown (legacy) |
776+
| PDSH | Program Directed Sensitive (legacy) |
777+
| PROP | Protected (legacy) |
778+
| SBIR | SBIR |
779+
| STTR | STTR |
780+
781+
### Journal Type<a id="journal-type"></a>
782+
783+
Describes the particular type of this journal publication, and is only applicable to
784+
ProductType JA.
785+
786+
| Name | Value | Description/Notes |
787+
| -- | -- | -- |
788+
| Manuscript | FT | |
789+
| DOEAcceptedManuscript | AM | Requires a DOI |
790+
| DOEAcceptedManuscriptNoDOI | AW | May not specify a DOI, special considerations required |
791+
| PublishedArticle | PA | CHORUS/Crossref provided publisher article |
792+
| PublishedAcceptedManuscript | PM | CHORUS/Crossref published accepted manuscript |
793+
794+
### PAMS Publication Status<a id="pams-publication-status"></a>
795+
796+
Specific values for DOE-PAMS related data products only. Details publication status of the PAMS work.
797+
798+
| Name | Value |
799+
| -- | -- |
800+
| Published | PUBLISHED |
801+
| Other | OTHER |
802+
| Submitted | SUBMITTED |
803+
| UnderReview | UNDER_REVIEW |
804+
| Accepted | ACCEPTED |
805+
| AwaitingPublication | AWAITING_PUBLICATION |
806+
| Pending | PENDING |
807+
| Granted | GRANTED |
808+
| Licensed | Licensed |
809+
| NONE | NONE |
810+
811+
### PAMS Patent Status<a id="pams-patent-status"></a>
812+
813+
Specific values for DOE-PAMS related patent data only. Provides state information of the patent.
814+
815+
| Name | Value |
816+
| -- | -- |
817+
| Submitted | 1 |
818+
| Pending | 2 |
819+
| Granted | 3 |
820+
821+
### PAMS Product Sub Type<a id="pams-product-sub-type"></a>
822+
823+
Specific values for DOE-PAMS records only. Further defines the type of PAMS data record.
824+
825+
| Name | Value |
826+
| -- | -- |
827+
| JournalArticle | 1 |
828+
| Book |2 |
829+
| BookChapter |3 |
830+
| ThesisDissertation |4 |
831+
| ConferencePaper |5 |
832+
| Website |6 |
833+
| OtherPublication |7 |
834+
| Patent |8 |
835+
| Invention |9 |
836+
| License |10 |
837+
| AudioVideo |11 |
838+
| Databases |12 |
839+
| DataResearchMaterial |13 |
840+
| EducationAidsCurricula |14 |
841+
| EvaluationInstruments |15 |
842+
| InstrumentsEquipment |16 |
843+
| Models |17 |
844+
| PhysicalCollections |18 |
845+
| Protocols |19 |
846+
| SoftwareNetWare |20 |
847+
| SurveyInstruments |21 |
848+
| OtherAwardProduct |22 |
849+
| TechnologyTechnique |23 |
850+
851+
### Product Type<a id="product-type"></a>
852+
853+
Indicates the type of product represented by this record. Each product type may require or disallow certain fields; for example,
854+
JA requires a number of "journal-related" fields, while most other types disallow information in these fields.
855+
856+
| Name | Value |
857+
| -- | -- |
858+
| AccomplishmentReport | AR |
859+
| Book | B |
860+
| Conference | CO |
861+
| Dataset | DA |
862+
| FactSheet | FS |
863+
| JournalArticle | JA |
864+
| Miscellaneous | MI |
865+
| Other | OT |
866+
| Patent | P |
867+
| ProgramDocument | PD |
868+
| SoftwareManual | SM |
869+
| ThesisDissertation | TD |
870+
| TechnicalReport | TR |
871+
| PatentApplication | PA |
872+
873+
### Workflow Status<a id="workflow-status"></a>
874+
875+
Current processing state of a given revision/record. Users generally submit in Saved ("SA"), SubmitReleasing ("SR"), or SubmitOSTI ("SO");
876+
for the latter state, automated workflow processes will move through the other states ultimately to Released ("R"). Revisions will
877+
remain in Validated ("SV") state until for example media is attached and processed if applicable. Failure states, such as FailedValidation ("SF")
878+
and FailedRelease ("SX") should have explanations in the Record audit log information.
879+
880+
| Name | Value | Notes |
881+
| -- | -- | -- |
882+
| Saved | SA | Saved state, no automated processing, usually incomplete record |
883+
| SubmitReleasing | SR | Submitted to releasing official, must be approved manually by such |
884+
| SubmitOSTI | SO | Submitted to OSTI, indicating automated workflow processes may finalize this record |
885+
| Released | R | Completed release, final state of revision |
886+
| Validated | SV | Validated, but may be awaiting media or further processing |
887+
| FailedValidation | SF | Failed validation after submission, requires manual edit or revision |
888+
| FailedRelease | SX | Failed to release, may require additional information or edits |
889+
708890
## Exceptions<a id="exceptions"></a>
709891

710892
Various exceptions are raised via API calls, and may be imported and caught in the code. Using

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "elinkapi"
7-
version = "0.4.9"
7+
version = "0.5.0"
88
authors = [
99
{ name="Jacob Samar", email="samarj@osti.gov" },
1010
{ name="Neal Ensor", email="ensorn@osti.gov" }

src/elinkapi/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from elinkapi.organization import Organization
99
from elinkapi.record import Record
1010
from elinkapi.auditlogs import AuditLog
11-
from elinkapi.record import AccessLimitation, JournalType, ProductType, PAMSPatentStatus, PAMSProductSubType, PAMSPublicationStatus
11+
from elinkapi.record import AccessLimitation, JournalType, ProductType, PAMSPatentStatus, PAMSProductSubType, PAMSPublicationStatus, WorkflowStatus
1212
from elinkapi.media_file import MediaFile
1313
from elinkapi.media_info import MediaInfo
1414
from elinkapi.related_identifier import RelatedIdentifier
@@ -57,6 +57,7 @@
5757
"PAMSPatentStatus",
5858
"PAMSProductSubType",
5959
"PAMSPublicationStatus",
60+
"WorkflowStatus",
6061
# method accessors
6162
"set_api_token",
6263
"set_target_url",

src/elinkapi/record.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,21 @@ class ProductType(Enum):
119119
TechnicalReport="TR"
120120
PatentApplication="PA"
121121

122+
class WorkflowStatus(Enum):
123+
"""
124+
Current processing state of a given revision/record. Users generally submit in Saved ("SA"), SubmitReleasing ("SR"), or SubmitOSTI ("SO");
125+
for the latter state, automated workflow processes will move through the other states ultimately to Released ("R"). Revisions will
126+
remain in Validated ("SV") state until for example media is attached and processed if applicable. Failure states, such as FailedValidation ("SF")
127+
and FailedRelease ("SX") should have explanations in the revision audit log information.
128+
"""
129+
Saved="SA"
130+
SubmitReleasing="SR"
131+
SubmitOSTI="SO"
132+
Released="R"
133+
Validated="SV"
134+
FailedValidation="SF"
135+
FailedRelease="SX"
136+
122137
class Record(BaseModel):
123138
"""
124139
Describes a particular record or product (e.g., dataset, technical report, journal article, etc.) with all

src/elinkapi/revision.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,6 @@
66
class Revision(BaseModel):
77
model_config = ConfigDict(validate_assignment=True)
88

9-
class WorkflowStatus(Enum):
10-
Saved="SA"
11-
SubmitReleasing="SR"
12-
SubmitOSTI="SO"
13-
Released="R"
14-
Validated="SV"
15-
FailedValidation="SF"
16-
FailedRelease="SX"
17-
189
osti_id: int
1910
revision: int
2011
date_valid_start: datetime.datetime

0 commit comments

Comments
 (0)