diff --git a/CI.Jenkinsfile b/CI.Jenkinsfile
index 8704189..9cde98f 100644
--- a/CI.Jenkinsfile
+++ b/CI.Jenkinsfile
@@ -1,6 +1,6 @@
-def versions = [3.9, 3.10, 3.11, 3.12, 3.13]
+def versions = [3.11, 3.12, 3.13, 3.14]
def runSonnarForPythonVersion(sourceDir, ver){
mySonarOpts="-Dsonar.sources=/source -Dsonar.host.url=${env.SONAR_HOST_URL} -Dsonar.login=${env.SONAR_AUTH_TOKEN}"
diff --git a/Jenkinsfile b/Jenkinsfile
index 58a6d77..66cf002 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -19,17 +19,18 @@ node ("docker-light") {
sh "docker run --rm -e API_KEY=${API_KEY} -e ALT_URL=${ALT_URL} -v ${SOURCEDIR}:/source rosette/docker-python"
}
}
- slack(true)
+ postToTeams(true)
} catch (e) {
currentBuild.result = "FAILED"
- slack(false)
+ postToTeams(false)
throw e
}
}
-def slack(boolean success) {
+def postToTeams(boolean success) {
+ def webhookUrl = "${env.TEAMS_PNC_JENKINS_WEBHOOK_URL}"
def color = success ? "#00FF00" : "#FF0000"
def status = success ? "SUCCESSFUL" : "FAILED"
- def message = status + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' (${env.BUILD_URL})"
- slackSend(color: color, channel: "#rapid", message: message)
+ def message = "*" + status + ":* '${env.JOB_NAME}' - [${env.BUILD_NUMBER}] - ${env.BUILD_URL}"
+ office365ConnectorSend(webhookUrl: webhookUrl, color: color, message: message, status: status)
}
diff --git a/LICENSE.txt b/LICENSE.txt
index 5723e02..b95ebb6 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,4 +1,4 @@
-Copyright (c) 2014-2019 Basis Technology Corporation.
+Copyright (c) 2014-2026 Babel Street Rosette Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/README.md b/README.md
index bc34f47..8a88e63 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,5 @@
-
-
-
-
-
-
+
+
# Analytics by Babel Street
@@ -38,10 +34,10 @@ in the [examples](https://github.com/rosette-api/python/tree/develop/examples) d
#### Documentation & Support
- [Binding API](https://rosette-api.github.io/python/)
-- [Analytics Platform API](https://docs.babelstreet.com/API/en/index-en.html)
+- [Analytics Platform API](https://documentation.babelstreet.com/analytics)
- [Binding Release Notes](https://github.com/rosette-api/python/wiki/Release-Notes)
-- [Analytics Platform Release Notes](https://docs.babelstreet.com/Release/en/rosette-cloud.html)
-- [Support](https://babelstreet.my.site.com/support/s/)
+- [Analytics Platform Release Notes](https://docs.babelstreet.com/r/Hosted-Services-Release-Notes)
+- [Support](https://babelstreet.my.site.com/support/s/contactsupport)
- [Binding License: Apache 2.0](https://github.com/rosette-api/python/blob/develop/LICENSE.txt)
## Binding Developer Information
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 2114fa5..5754e5a 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -55,9 +55,9 @@
# built documents.
#
# The short X.Y version.
-version = '1.31.0'
+version = '1.39.0'
# The full version, including alpha/beta/rc tags.
-release = '1.31.0'
+release = '1.39.0'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/examples/record_similarity.py b/examples/record_similarity.py
index 0ef1ea7..a2c1fe2 100644
--- a/examples/record_similarity.py
+++ b/examples/record_similarity.py
@@ -31,6 +31,18 @@ def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
"dob2": {
"type": "rni_date",
"weight": 0.1
+ },
+ "jobTitle": {
+ "type": "rni_string",
+ "weight": 0.2
+ },
+ "age": {
+ "type": "rni_number",
+ "weight": 0.4
+ },
+ "isRetired": {
+ "type": "rni_boolean",
+ "weight": 0.05
}
}
properties = {
@@ -52,7 +64,8 @@ def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
"dob2": {
"date": "04161993",
"format": "MMddyyyy"
- }
+ },
+ "jobTitle": "software engineer"
},
{
"dob": {
@@ -60,7 +73,9 @@ def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
},
"primaryName": {
"text": "Evan R"
- }
+ },
+ "age": 47,
+ "isRetired": False
}
],
"right": [
@@ -71,7 +86,9 @@ def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
"primaryName": {
"text": "Seth R",
"language": "eng"
- }
+ },
+ "jobTitle": "manager",
+ "isRetired": True
},
{
"primaryName": "Ivan R",
@@ -84,7 +101,9 @@ def run(key, alt_url='https://analytics.babelstreet.com/rest/v1/'):
},
"dob2": {
"date": "1993/04/16"
- }
+ },
+ "age": 72,
+ "isRetired": True
}
]
}
diff --git a/rosette/__init__.py b/rosette/__init__.py
index 5c89253..a9203f0 100644
--- a/rosette/__init__.py
+++ b/rosette/__init__.py
@@ -12,4 +12,4 @@
limitations under the License.
"""
-__version__ = '1.31.0'
+__version__ = '1.39.0'
diff --git a/rosette/api.py b/rosette/api.py
index 9dadf15..5ed8cee 100644
--- a/rosette/api.py
+++ b/rosette/api.py
@@ -3,7 +3,7 @@
"""
Python client for the Babel Street Analytics API.
-Copyright (c) 2014-2024 Basis Technology Corporation.
+Copyright (c) 2014-2026 Babel Street Rosette Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
_APPLICATION_JSON = 'application/json'
_BINDING_LANGUAGE = 'python'
-_BINDING_VERSION = '1.31.0'
+_BINDING_VERSION = '1.39.0'
# TODO Remove legacies in future release
_LEGACY_CONCURRENCY_HEADER = 'x-rosetteapi-concurrency'
_CONCURRENCY_HEADER = 'x-babelstreetapi-concurrency'
@@ -356,7 +356,7 @@ class RecordSimilarityParameters(_RequestParametersBase):
def __init__(self):
self.use_multipart = False
- _RequestParametersBase.__init__(self, ("fields", "properties", "records"))
+ _RequestParametersBase.__init__(self, ("fields", "properties", "records", "comparisonMethod"))
def validate(self):
"""Internal. Do not use."""
diff --git a/setup.py b/setup.py
index 1bcd653..7eab950 100755
--- a/setup.py
+++ b/setup.py
@@ -49,11 +49,10 @@ def read(*filenames, **kwargs):
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python',
- 'Programming Language :: Python :: 3.9',
- 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
+ 'Programming Language :: Python :: 3.14',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
diff --git a/tests/test_rosette_api.py b/tests/test_rosette_api.py
index ca8085c..8785da3 100644
--- a/tests/test_rosette_api.py
+++ b/tests/test_rosette_api.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
-Copyright (c) 2014-2024 Basis Technology Corporation.
+Copyright (c) 2014-2026 Babel Street Rosette Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -248,46 +248,46 @@ def test_document_endpoints(api, json_response, doc_params, endpoint):
response_json=json_response,
reply=200)
- # TODO: Convert to match-case when minimum supported version is 3.10
- if endpoint == "categories":
- result = api.categories(doc_params)
- elif endpoint == "entities":
- result = api.entities(doc_params)
- elif endpoint == "events":
- result = api.events(doc_params)
- elif endpoint == "language":
- result = api.language(doc_params)
- elif endpoint == "morphology/complete":
- result = api.morphology(doc_params)
- elif endpoint == "morphology/compound-components":
- result = api.morphology(doc_params, "compound-components")
- elif endpoint == "morphology/han-readings":
- result = api.morphology(doc_params, "han-readings")
- elif endpoint == "morphology/lemmas":
- result = api.morphology(doc_params, "lemmas")
- elif endpoint == "morphology/parts-of-speech":
- result = api.morphology(doc_params, "parts-of-speech")
- elif endpoint == "relationships":
- api.set_option('accuracyMode', 'PRECISION')
- result = api.relationships(doc_params)
- elif endpoint == "semantics/similar":
- result = api.similar_terms(doc_params)
- elif endpoint == "semantics/vector":
- result = api.semantic_vectors(doc_params)
- elif endpoint == "sentences":
- result = api.sentences(doc_params)
- elif endpoint == "sentiment":
- result = api.sentiment(doc_params)
- elif endpoint == "syntax/dependencies":
- result = api.syntax_dependencies(doc_params)
- elif endpoint == "tokens":
- result = api.tokens(doc_params)
- elif endpoint == "topics":
- result = api.topics(doc_params)
- elif endpoint == "transliteration":
- result = api.transliteration(doc_params)
- else:
- raise Exception("Unknown endpoint.")
+ match endpoint:
+ case "categories":
+ result = api.categories(doc_params)
+ case "entities":
+ result = api.entities(doc_params)
+ case "events":
+ result = api.events(doc_params)
+ case "language":
+ result = api.language(doc_params)
+ case "morphology/complete":
+ result = api.morphology(doc_params)
+ case "morphology/compound-components":
+ result = api.morphology(doc_params, "compound-components")
+ case "morphology/han-readings":
+ result = api.morphology(doc_params, "han-readings")
+ case "morphology/lemmas":
+ result = api.morphology(doc_params, "lemmas")
+ case "morphology/parts-of-speech":
+ result = api.morphology(doc_params, "parts-of-speech")
+ case "relationships":
+ api.set_option('accuracyMode', 'PRECISION')
+ result = api.relationships(doc_params)
+ case "semantics/similar":
+ result = api.similar_terms(doc_params)
+ case "semantics/vector":
+ result = api.semantic_vectors(doc_params)
+ case "sentences":
+ result = api.sentences(doc_params)
+ case "sentiment":
+ result = api.sentiment(doc_params)
+ case "syntax/dependencies":
+ result = api.syntax_dependencies(doc_params)
+ case "tokens":
+ result = api.tokens(doc_params)
+ case "topics":
+ result = api.topics(doc_params)
+ case "transliteration":
+ result = api.transliteration(doc_params)
+ case _:
+ raise Exception("Unknown endpoint.")
assert result["name"] == "Babel Street Analytics"
@@ -678,6 +678,31 @@ def test_the_record_similarity_endpoint(api, json_response):
assert result["name"] == "Babel Street Analytics"
+@pook.on
+def test_record_similarity_comparison_method(api, json_response):
+ """Accept and serialize the optional comparison method."""
+ pook.post(url=get_base_url() + "v1/record-similarity",
+ response_json=json_response,
+ reply=200)
+
+ params = RecordSimilarityParameters()
+ params["fields"] = {}
+ params["records"] = {}
+ assert params["comparisonMethod"] is None
+ assert "comparisonMethod" not in params.serialize(None)
+
+ params["comparisonMethod"] = "one_to_n"
+ assert params["comparisonMethod"] == "one_to_n"
+ assert params.serialize(None) == {
+ "fields": {},
+ "records": {},
+ "comparisonMethod": "one_to_n"
+ }
+
+ result = api.record_similarity(params)
+ assert result["name"] == "Babel Street Analytics"
+
+
@pook.on
def test_for_record_similarity_required_parameters(api, json_response):
pook.post(url=get_base_url() + "v1/record-similarity",