Changelog¶
Unreleased¶
Added¶
Add support for Python 3.13, 3.14.
Removed¶
Drop support for Python 3.9.
0.8.0 (2025-07-04)¶
Fixed¶
ocdsmerge.flatten.unflatten()raisesocdsmerge.exceptions.InconsistentTypeErrorif the same path is an object in one release and an array in another release.
Changed¶
ocdsmerge.flatten.flatten()acceptsversionedas a keyword argument only.
Removed¶
Drop support for Python 3.8.
0.7.0 (2024-05-08)¶
Changed¶
ocdsmerge.util.get_tags()raises an error if it encounters an HTTP error.ocdsmerge.exceptions.DuplicateIdValueWarninghas no custom attributes.
Removed¶
Drop support for Python 3.6 and 3.7.
Added¶
Add PyPy support.
0.6.6 (2021-04-10)¶
Added¶
Add Python wheels distribution.
0.6.5 (2021-02-04)¶
Changed¶
ocdsmerge.flatten.unflatten()raisesocdsmerge.exceptions.InconsistentTypeErrorinstead ofTypeErrorif the same path is a literal in one release and an object in another release.
0.6.4 (2020-01-02)¶
Fixed¶
Restore prior order of
ocidkey in merged releases.
0.6.3 (2020-01-02)¶
Changed¶
Improve performance of
ocdsmerge.flatten.flatten().
Added¶
ocdsmerge.merge.MergedRelease: Extractflat_append()fromappend(), to enable custom flattening methods.
0.6.2 (2019-12-31)¶
Changed¶
Rename
ocdsmerge.errorsmodule toocdsmerge.exceptions.
0.6.1 (2019-12-30)¶
Changed¶
Improve performance.
0.6.0 (2019-12-29)¶
Changed¶
Backwards-incompatible: Replace
mergeandmerged_versionedfunctions withocdsmerge.Mergerclass.
Fixed¶
rule_overrideskeys omit array indexes.
0.5.12 (2019-12-19)¶
Fixed¶
MissingDateKeyErroris now initialized correctly.
0.5.11 (2019-11-28)¶
Changed¶
MissingDateKeyErrorinherits fromKeyError, andNonObjectReleaseError,NullDateValueErrorandNonStringDateValueErrorinherit fromTypeError, to allow exception handling of versions less than 0.5.2 to remain unchanged.
0.5.10.post3 (2019-11-28)¶
Changed¶
The collision behavior is changed to always warn.
Remove the
collision_behaviorargument. Use a warning filter instead.Add
pathandidproperties toDuplicateIdValueWarningto store thepathat which, and theidon which, the collision occurred.
0.5.10.post2 (2019-11-22)¶
Changed¶
Add a
rule_overridesargument tomerge,merge_versioned,add_release_to_compiled_releaseandadd_release_to_versioned_release, which can be set on a per-field basis to:ocdsmerge.MERGE_BY_POSITION: merge objects in the array based on their array index, instead of theiridvalue.ocdsmerge.APPEND: retain all objects in the array.
Remove these flags as possible values of
collision_behavior.
0.5.10.post1 (2019-11-21)¶
Changed¶
The collision behavior is changed to silently ignore the collision, by default.
Add these flags as possible values of
collision_behavior:ocdsmerge.MERGE_BY_POSITION: merge objects in arrays based on their array index, instead of theiridvalue.ocdsmerge.APPEND: retain all objects in arrays.
Remove the
ocdsmerge.IGNOREflag.
0.5.10 (2019-11-21)¶
Changed¶
Warn if multiple objects in an array have the same
idvalue.Add a
collision_behaviorargument tomerge,merge_versioned,add_release_to_compiled_releaseandadd_release_to_versioned_release, which can be set to:ocdsmerge.WARN: issue aDuplicateIdValueWarningwarning (default)ocdsmerge.RAISE: raise aDuplicateIdValueErrorexceptionocdsmerge.IGNORE: silently ignore the collision
0.5.9 (2019-11-20)¶
Fixed¶
get_tagsno longer returns duplicate tags.
0.5.8 (2019-10-21)¶
Changed¶
Added exception messages to all exceptions.
Fixed¶
If there is more than one release, but a
datefield is neither a string nor null, theNonStringDateValueErrorexception is raised, instead ofNullDateValueError.If a release is not an object, the
NonObjectReleaseErrorexception is raised, instead ofNullDateValueError.If there is a
TypeErrorfor any other reason, it is raised as-is, instead ofNullDateValueError.
0.5.7 (2019-08-09)¶
Fix package: Rename VCR cassettes for Windows users.
0.5.6 (2019-07-30)¶
Fix package: Remove
testsfrom build.
0.5.5 (2019-07-29)¶
Fix package: Add VCR cassettes to
MANIFEST.in.
0.5.4 (2019-07-29)¶
Fix package: Add
MANIFEST.inand allow tests to run offline.
0.5.3 (2019-06-26)¶
Changed¶
Use
https://instead ofhttp://forstandard.open-contracting.org.
Added¶
Extract the inner loops of
mergeandmerge_versionedtoadd_release_to_compiled_releaseandadd_release_to_versioned_release, respectively.
0.5.2 (2019-05-24)¶
Changed¶
If there is more than one release, but a
datefield is either missing or null, theMissingDateKeyErrorandNullDateValueErrorexceptions are raised, respectively, instead of the genericKeyErrorandTypeError.
Fixed¶
If a field’s value is set to
null, it is omitted from the compiled release.If a field’s value is an empty object or empty array in a release, skip it.
0.5.1 (2019-01-09)¶
Changed¶
get_tagsandget_release_schema_urlreplaceget_latest_versionandget_latest_release_schema_url.
0.5 (2019-01-04)¶
Advisories¶
Behavior is undefined and inconsistent if an array is not defined in the schema and contains only objects in some releases but not in others. 0a81a43
For developers using this library as a reference implementation:
versionIdis ignored by this library, as it merely assists in identifying whichidfields are not on objects in arrays.
The following behaviors were previously undocumented, though they are implied by the merge rules:
Added¶
Test cases for other implementations. See README.
You can specify the merge rules with a new
merge_rulesargument. #17 #18You can specify a custom schema by passing parsed JSON to the existing
schemaargument. 4244b3fIf the schema isn’t provided or is a URL or file path, it is parsed once and cached. 5d2f831
Recognizes OCDS 1.0
ocdsOmitandocdsVersionmerge strategies. e67353d
Changed¶
Fixed¶
The following conditions occur on structurally correct OCDS data:
If the items in an array were non-objects, the array wouldn’t be treated as a single value. #14
If an array were mixing objects with and without
idfields, the compiled release would merge objects if an array index matched anidvalue. The new behavior is to keep any objects withoutidvalues. 0e26402If objects in an array weren’t defined in the schema and had no
idfields, the objects would be merged based on array index. The new behavior is to keep all objects. 0e26402
The following conditions don’t occur in OCDS schema, but can occur in extensions:
If objects in an array were defined in the schema and had no
idfields, andwholeListMergewere not set, the objects would be merged based on array index, instead of using the whole-list-merge strategy. 73dd088If an array were defined in the schema as having objects and non-objects, the identifier-merge strategy would sometimes be used instead of the whole-list-merge strategy. d222e09
The following conditions don’t occur in OCDS schema, or in extensions authored by the Open Contracting Partnership, but can occur in extensions authored by others:
If
omitWhenMergedorwholeListMergewerefalse, they were treated astrue, instead of being ignored. d115fa2If
omitWhenMergedwere set on an array of non-objects, the array wouldn’t be omitted, instead of being omitted. 2d39a0fIf
wholeListMergewere set on an object, only the latest version of the object would be retained in the compiled release, instead of merging all versions of the object. b2a0dc6
0.4 (2018-01-04)¶
Use the schema to determine the merge rules.
Allow specifying a custom local or remote schema.
0.3 (2015-12-04)¶
Use relative imports.
0.2 (2015-12-01)¶
Move repository to open-contracting organization.
0.1 (2015-11-29)¶
First release.