You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -94,13 +94,13 @@ instead of `bin`.
94
94
95
95
## Library usage
96
96
1.**DATA MODEL**
97
-
* The `src.spdx.model` package constitutes the internal SPDX v2.3 data model (v2.2 is a simply a subset of this).
97
+
* The `spdx_tools.spdx.model` package constitutes the internal SPDX v2.3 data model (v2.2 is a simply a subset of this). All relevant classes for SPDX document creation are exposed in the [__init__.py](src%2Fspdx_tools%2Fspdx%2Fmodel%2F__init__.py).
98
98
* SPDX objects are implemented via `@dataclass_with_properties`, a custom extension of `@dataclass`.
99
99
* Each class starts with a list of its properties and their possible types. When no default value is provided, the property is mandatory and must be set during initialization.
100
100
* Using the type hints, type checking is enforced when initializing a new instance or setting/getting a property on an instance
101
101
(wrong types will raise `ConstructorTypeError` or `TypeError`, respectively). This makes it easy to catch invalid properties early and only construct valid documents.
102
102
* Note: in-place manipulations like `list.append(item)` will circumvent the type checking (a `TypeError` will still be raised when reading `list` again). We recommend using `list = list + [item]` instead.
103
-
* The main entry point of an SPDX document is the `Document` class, which links to all other classes.
103
+
* The main entry point of an SPDX document is the `Document` class from the [document.py](src%2Fspdx_tools%2Fspdx%2Fmodel%2Fdocument.py) module, which links to all other classes.
104
104
* For license handling, the [license_expression](https://github.com/nexB/license-expression) library is used.
105
105
* Note on `documentDescribes` and `hasFiles`: These fields will be converted to relationships in the internal data model. As they are deprecated, these fields will not be written in the output.
106
106
2.**PARSING**
@@ -123,9 +123,9 @@ import logging
123
123
124
124
from license_expression import get_spdx_licensing
125
125
126
-
from spdx_tools.spdx.model.checksumimport Checksum, ChecksumAlgorithm
127
-
from spdx_tools.spdx.model.fileimport File, FileType
128
-
from spdx_tools.spdx.model.relationshipimport Relationship, RelationshipType
126
+
from spdx_tools.spdx.model import Checksum, ChecksumAlgorithm
127
+
from spdx_tools.spdx.model import File, FileType
128
+
from spdx_tools.spdx.model import Relationship, RelationshipType
129
129
from spdx_tools.spdx.parser.parse_anything import parse_file
130
130
from spdx_tools.spdx.validation.document_validator import validate_full_spdx_document
131
131
from spdx_tools.spdx.writer.write_anything import write_file
0 commit comments