wipo-gbd-transformation 1.1.75__py3-none-any.whl → 1.1.76__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of wipo-gbd-transformation might be problematic. Click here for more details.

@@ -1,12 +1,17 @@
1
1
  import re
2
2
 
3
3
  def translate_kind(kind):
4
- if not kind: return ['Individual']
4
+ if not kind: return 'Individual'
5
5
 
6
- if kind == 'Individual mark': return ['Individual']
7
- if kind == 'Collective mark': return ['Collective']
6
+ if kind.lower() == 'individual mark': return 'Individual'
7
+ if kind.lower() == 'trademark': return 'Individual'
8
+ if kind.lower() == 'collective mark': return 'Collective'
9
+ if kind.lower() == 'guarantee' or kind.lower() =='guarantee mark': return 'Collective'
10
+ if kind.lower() == 'certificate' or kind.lower() =='certificate mark': return 'Certificate'
11
+ if kind.lower() == 'certification' or kind.lower() =='certification mark': return 'Certificate'
8
12
 
9
- raise Exception('kind "%s" is not mapped.' % kind)
13
+ return 'Other'
14
+ #raise Exception('kind "%s" is not mapped.' % kind)
10
15
 
11
16
  def translate_status(status):
12
17
  if not status: return 'Ended'
@@ -74,6 +79,8 @@ def get_local_texts(nodes):
74
79
  return text
75
80
 
76
81
  def get_full_address(postalStructuredAddress):
82
+ if postalStructuredAddress is None:
83
+ return
77
84
  result = ""
78
85
  if "addressLineText" in postalStructuredAddress:
79
86
  for addressLineText in postalStructuredAddress["addressLineText"]:
@@ -110,4 +117,38 @@ def local_guess_language(content):
110
117
  lang = "no"
111
118
  return lang
112
119
  else:
113
- return "en"
120
+ return "en"
121
+
122
+ def has_vienna_classes(markImage):
123
+ if not "markImageClassification" in markImage:
124
+ return False
125
+ if not "figurativeElementClassificationBag" in markImage["markImageClassification"]:
126
+ return False
127
+ if not "viennaClassificationBag" in markImage["markImageClassification"]["figurativeElementClassificationBag"]:
128
+ return False
129
+
130
+ for element in markImage["markImageClassification"]["figurativeElementClassificationBag"]["viennaClassificationBag"]:
131
+ if "viennaClassification" in element:
132
+ for viennaClassification in element["viennaClassification"]:
133
+ if "viennaCategory" in viennaClassification:
134
+ return True
135
+ return False
136
+
137
+ def translate_licence_category(kind):
138
+ if not kind: return 'Other'
139
+
140
+ if kind.lower() == 'exclusive': return 'Exclusive'
141
+ if kind.lower() == 'nonexclusive' or kind.lower() == 'non exclusive' or kind.lower() == 'non-exclusive': return 'NonExclusive'
142
+
143
+ return 'Other'
144
+ #raise Exception('licence category "%s" is not mapped.' % kind)
145
+
146
+ def translate_licence_status(status):
147
+ if not status: return 'Other'
148
+ # Cancelled, Valid, Other
149
+
150
+ if status.lower() == 'cancelled': return 'Cancelled'
151
+ if status.lower() == 'valid': return 'Valid'
152
+
153
+ return 'Other'
154
+ #raise Exception('licence status "%s" is not mapped.' % status)
@@ -14,6 +14,14 @@ registrationDate: {{ trademark.registrationDate }}
14
14
 
15
15
  expiryDate: {{ trademark.expiryDate }}
16
16
 
17
+ # publication date appears as an event of category "markEventCategory": "Registration published"
18
+ # with publication date given by markEventDate attribute
19
+ {% call(event) match('markEvent', trademark.markEventBag) %}
20
+ {% if event.markEventCategory == 'Registration published' %}
21
+ publicationDate: {{ event.markEventDate }}
22
+ {% endif %}
23
+ {% endcall %}
24
+
17
25
  {% set status = trademark.markCurrentStatusCode | translate_status %}
18
26
  gbdStatus: {{ status }}
19
27
  officeStatus: {{ trademark.markCurrentStatusCode }}
@@ -26,14 +34,23 @@ designatedCountries:
26
34
  type: TRADEMARK
27
35
 
28
36
  kind:
29
- - Individual
37
+ {% call(markCategory) match('markCategory', trademark) %}
38
+ - {{ markCategory | translate_kind() }}
39
+ {% endcall %}
40
+ # (Individual|Collective|Certificate|Defensive|Other|Membership|Unknown)
30
41
 
31
42
  markFeature: {{ trademark.markFeatureDescription | translate_feature() }}
32
43
  # (Word|Stylized characters|Figurative|Combined|Three dimensional|Colour|Sound|Hologram|Olfactory|Motion|Municipal|Chimney|Other|Undefined)
33
44
 
34
- kind:
35
- - Individual
36
- # (Individual|Collective|Certificate|Defensive|Other|Membership)
45
+ # in case it is relevant and available, we can store here the Madrid application from witch the national trademark originates
46
+ {% set application_case = markApplicationCategory %}
47
+ {% if application_case == 'International Mark' %}
48
+ reference:
49
+ registration:
50
+ - number: {{ trademark.trademarkTypeChoice1.registrationNumber }}
51
+ date: {{ trademark.registrationDate }}
52
+ office: "WO"
53
+ {% endif %}
37
54
 
38
55
  markDisclaimerDetails:
39
56
  {% call(markDisclaimerText) match('markDisclaimerText', trademark.markDisclaimerBag) %}
@@ -69,6 +86,18 @@ markImageDetails:
69
86
  - languageCode:
70
87
  text: {{ markDescriptionText | get_local_text() }}
71
88
  {% endcall %}
89
+ {% set has_vienna_classes = markImage | has_vienna_classes() %}
90
+ {% if has_vienna_classes %}
91
+ classification:
92
+ kind: Vienna
93
+ version:
94
+ code:
95
+ {% call(viennaClass) match('viennaClassificationBag', markImage.markImageClassification.figurativeElementClassificationBag) %}
96
+ {% call(viennaValue) match('viennaClassification', viennaClass) %}
97
+ - {{ viennaValue.viennaCategory }}
98
+ {% endcall %}
99
+ {% endcall %}
100
+ {% endif %}
72
101
  {% endcall %}
73
102
 
74
103
  markSoundDetails:
@@ -119,7 +148,18 @@ representatives:
119
148
  - languageCode:
120
149
  text: {{ postalAddress.postalStructuredAddress | get_full_address() }}
121
150
  {% endcall %}
122
- countryCode:
151
+ detailedAddress:
152
+ {% call(postalAddress) match('postalAddress', representative.contact.contactTypeChoiceSequence.postalAddressBag) %}
153
+ - languageCode:
154
+ text:
155
+ cityName: {{ postalAddress.postalStructuredAddress.cityName }}
156
+ geographicRegionName:
157
+ postalCode: {{ postalAddress.postalStructuredAddress.postalCode }}
158
+ countryCode: {{ postalAddress.postalStructuredAddress.countryCode }}
159
+ {% endcall %}
160
+ {% call(postalAddress) match('postalAddress', representative.contact.contactTypeChoiceSequence.postalAddressBag) %}
161
+ countryCode: {{ postalAddress.postalStructuredAddress.countryCode }}
162
+ {% endcall %}
123
163
  {% endcall %}
124
164
 
125
165
  correspondence:
@@ -143,7 +183,78 @@ applicants:
143
183
  - languageCode:
144
184
  text: {{ postalAddress.postalStructuredAddress | get_full_address() }}
145
185
  {% endcall %}
146
- countryCode:
186
+ detailedAddress:
187
+ {% call(postalAddress) match('postalAddress', applicant.contact.contactTypeChoiceSequence.postalAddressBag) %}
188
+ - languageCode:
189
+ text:
190
+ cityName: {{ postalAddress.postalStructuredAddress.cityName }}
191
+ geographicRegionName:
192
+ postalCode: {{ postalAddress.postalStructuredAddress.postalCode }}
193
+ countryCode: {{ postalAddress.postalStructuredAddress.countryCode }}
194
+ {% endcall %}
195
+ {% call(postalAddress) match('postalAddress', applicant.contact.contactTypeChoiceSequence.postalAddressBag) %}
196
+ countryCode: {{ postalAddress.postalStructuredAddress.countryCode }}
197
+ {% endcall %}
198
+ {% endcall %}
199
+
200
+ # licence information, not frequent, but provided by Singapore, Norway and UK as of 2025-04-23
201
+ licences:
202
+ {% call(record) match('markRecord', trademark.markRecordBag) %}
203
+ {% if record.recordLicence.recordLicenceCategory == 'Licence' %}
204
+ {% call(licence) match('licence', record.recordLicence.licenceBag) %}
205
+ - licenceCategory: {{ licence.licenceCategory | translate_licence_category() }}
206
+ # Exclusive, NonExclusive, Other
207
+ goodsServicesLimitation:
208
+ {% call(goodsServices) match('commentText', licence.goodsServicesLimitation.commentTextBag) %}
209
+ - languageCode:
210
+ text: {{ goodsServices.localizedTextType | get_local_text }}
211
+ {% endcall %}
212
+ periodLimitationEndDate: {{ licence.periodLimitationEndDate }}
213
+ licenceDate: {{ licence.licenceDate }}
214
+ licenceStatus: {{ licence.licenceStatusCategory | translate_licence_status() }}
215
+ effectiveDate: {{ record.recordLicence.recordEffectiveDate }}
216
+ licensee:
217
+ {% call(licensee) match('licensee', licence.licenseeBag) %}
218
+ - identifier:
219
+ kind:
220
+ fullName:
221
+ - languageCode:
222
+ text: {{ licensee.contact.contactTypeChoiceSequence.name.entityName.phraseType | get_local_text }}
223
+ firstName:
224
+ - languageCode:
225
+ text:
226
+ lastName:
227
+ - languageCode:
228
+ text:
229
+ middleName:
230
+ - languageCode:
231
+ text:
232
+ organizationName:
233
+ - languageCode:
234
+ text:
235
+ fullAddress:
236
+ {% call(postalAddress) match('postalAddress', licensee.contact.contactTypeChoiceSequence.postalAddressBag) %}
237
+ - languageCode:
238
+ text: {{ postalAddress.postalStructuredAddress | get_full_address() }}
239
+ {% endcall %}
240
+ detailedAddress:
241
+ {% call(postalAddress) match('postalAddress', licensee.contact.contactTypeChoiceSequence.postalAddressBag) %}
242
+ - languageCode:
243
+ text:
244
+ cityName: {{ postalAddress.postalStructuredAddress.cityName }}
245
+ geographicRegionName:
246
+ postalCode: {{ postalAddress.postalStructuredAddress.postalCode }}
247
+ countryCode: {{ postalAddress.postalStructuredAddress.countryCode }}
248
+ {% endcall %}
249
+ contact:
250
+ phone:
251
+ fax:
252
+ email:
253
+ url:
254
+ countryCode: # sometimes, country name is provided instead
255
+ {% endcall %}
256
+ {% endcall %}
257
+ {% endif %}
147
258
  {% endcall %}
148
259
 
149
260
  {% endcall %}
@@ -187,6 +187,7 @@ applicants:
187
187
  cityName:
188
188
  geographicRegionName:
189
189
  postalCode:
190
+ countryCode:
190
191
  contact:
191
192
  phone:
192
193
  fax:
@@ -221,6 +222,7 @@ representatives:
221
222
  cityName:
222
223
  geographicRegionName:
223
224
  postalCode:
225
+ countryCode:
224
226
  contact:
225
227
  phone:
226
228
  fax:
@@ -253,6 +255,7 @@ correspondence:
253
255
  cityName:
254
256
  geographicRegionName:
255
257
  postalCode:
258
+ countryCode:
256
259
  contact:
257
260
  phone:
258
261
  fax:
@@ -272,5 +275,52 @@ appeals:
272
275
  - kind:
273
276
  date:
274
277
 
278
+ # licence information, not frequent, but provided by Singapore, Norway and UK as of 2025-04-23
279
+ licences:
280
+ - licenceCategory: # Exclusive, NonExclusive, Other
281
+ goodsServicesLimitation:
282
+ - languageCode:
283
+ text:
284
+ periodLimitationEndDate:
285
+ licenceDate: # date Agreement signed
286
+ licenceStatus: # Cancelled, Valid, Other
287
+ effectiveDate: # date notice received at the IP office
288
+ licensee:
289
+ - identifier:
290
+ kind:
291
+ fullName:
292
+ - languageCode:
293
+ text:
294
+ firstName:
295
+ - languageCode:
296
+ text:
297
+ lastName:
298
+ - languageCode:
299
+ text:
300
+ middleName:
301
+ - languageCode:
302
+ text:
303
+ organizationName:
304
+ - languageCode:
305
+ text:
306
+ fullAddress:
307
+ - languageCode:
308
+ text:
309
+ detailedAddress:
310
+ - languageCode:
311
+ text:
312
+ cityName:
313
+ geographicRegionName:
314
+ postalCode:
315
+ countryCode:
316
+ contact:
317
+ phone:
318
+ fax:
319
+ email:
320
+ url:
321
+ countryCode: # sometimes, country name is provided instead
322
+
275
323
  # here goes extra information that is office specific and that is pertinent for us to retain.
276
324
  extra:
325
+
326
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wipo-gbd-transformation
3
- Version: 1.1.75
3
+ Version: 1.1.76
4
4
  Summary: GBD XML ETL package
5
5
  Home-page: https://github.com/GBD-Wipo/xmlE
6
6
  Author: WIPO GDB team
@@ -296,8 +296,8 @@ gbdtransformation/brands/natm/schema,sha256=TFrF4FR76cytcbtQkDWxtF74I0tCPRDIvWRF
296
296
  gbdtransformation/brands/natm/template.yml,sha256=PO7s1HDQM9ushIJuIX3z_dfWO-f62YDzBG_sYKDlnG8,34
297
297
  gbdtransformation/brands/natm/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
298
298
  gbdtransformation/brands/notm/__init__.py,sha256=YRZPymjJv7V5vqjphBN1UOHZ3RL1oeYYqaOI6AKInl0,88
299
- gbdtransformation/brands/notm/filters.py,sha256=1f1vF9kKTlMQ9K_Qh7Hk6OQ964WGWQ8BadNOu-61sIo,3738
300
- gbdtransformation/brands/notm/template.yml,sha256=UmJ35fKzAHQSYrECsJtXRXTE2egXM69oXcu0Ya5fqWA,5090
299
+ gbdtransformation/brands/notm/filters.py,sha256=hFVIsTFyO41QGS98JqVlg0J16A0mg9Hw5rH48kW7pYc,5518
300
+ gbdtransformation/brands/notm/template.yml,sha256=SE9mcE3VxgOErmJPssTXkLeKuDRrajVMYG_Zvdef9sM,10135
301
301
  gbdtransformation/brands/nztm/__init__.py,sha256=UHmbQDIPDdApISBKfO9tKOX6LgUQ_Ib-IVMR5kCVMTY,86
302
302
  gbdtransformation/brands/nztm/filters.py,sha256=dAjrg03Yq37H10oAM8rnAMNa71lZHuG1uMwHi25kIvA,4211
303
303
  gbdtransformation/brands/nztm/schema,sha256=tpcyNMtmiBQQ0FsxKKTASRSo4nbrw0j0_b1nhELyAzE,6355
@@ -456,7 +456,7 @@ gbdtransformation/brands/wstm/tests/test.xml.gz,sha256=UKm7LTvKaETUtHMKurFGqkqXO
456
456
  gbdtransformation/brands/xxxx/__init__.py,sha256=fricc3VHm4BwGRFKIIqB0t-NtP3tTVRrEYee_gWpiFo,172
457
457
  gbdtransformation/brands/xxxx/filters.py,sha256=YCaQ6yH2LINwCQvbPHDhnORQyWglbswLlSOY6ur3KXQ,1874
458
458
  gbdtransformation/brands/xxxx/schema,sha256=g_oWkd7k2e5fAQR1BdNkPSsIgP3dkTyc7esWo_UOHQA,163
459
- gbdtransformation/brands/xxxx/template.yml,sha256=OscSZDrec-rCfK0HVbOaIPmhkykZCWcxK54Zf7iZe6o,5872
459
+ gbdtransformation/brands/xxxx/template.yml,sha256=-jmopincQdri1jKA32gjq1H7KOEi9A_2bhXg3BLPxOY,7094
460
460
  gbdtransformation/brands/zmtm/__init__.py,sha256=Mtsi_-CaLQirHkhnletNhJ4li-pZlzEZMcKjv6mEk50,256
461
461
  gbdtransformation/brands/zmtm/filters.py,sha256=FkGfv3nPiYDUy97O7bDzPp824qoDsqX-oh2Ox01NTpA,2344
462
462
  gbdtransformation/brands/zmtm/schema,sha256=TFrF4FR76cytcbtQkDWxtF74I0tCPRDIvWRFeqaJt6Q,3242
@@ -584,9 +584,9 @@ gbdtransformation/utilities/st66.xsd,sha256=co8aFN3a5TpudllRttWmfLeiZu8ulNipfeXm
584
584
  schemas/ShazamConfig.py,sha256=D67os5B11C41h_WZ7kk54Ss0Kk7tHh8W0d_1c_aX-lY,1191
585
585
  schemas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
586
586
  schemas/schema_extractor.py,sha256=3-ImtnI777f6b3VA0A_w-NoXdlGz5VZMzK6MnPdQQAY,10294
587
- wipo_gbd_transformation-1.1.75.dist-info/LICENSE.md,sha256=6r2dL13EwZqSt2ellLbJRFTA-6ECIDOer4YthCfkac0,35654
588
- wipo_gbd_transformation-1.1.75.dist-info/METADATA,sha256=VeeKM8Bu-kxQaq8SzYx_CJXGheafEd0rWGqllC_5-3I,577
589
- wipo_gbd_transformation-1.1.75.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
590
- wipo_gbd_transformation-1.1.75.dist-info/entry_points.txt,sha256=NFLtlP3mPHUi-hEoUcz4CXa7vcpP8bbwd18HS4arbEk,223
591
- wipo_gbd_transformation-1.1.75.dist-info/top_level.txt,sha256=oU1j-JNLga18Fd-EV6Xl9wM8zxYoNVEzb7P8MDhTPJg,26
592
- wipo_gbd_transformation-1.1.75.dist-info/RECORD,,
587
+ wipo_gbd_transformation-1.1.76.dist-info/LICENSE.md,sha256=6r2dL13EwZqSt2ellLbJRFTA-6ECIDOer4YthCfkac0,35654
588
+ wipo_gbd_transformation-1.1.76.dist-info/METADATA,sha256=YGUcgoRuLlulcuj6g_g58XcDEYPUtPctdpz6itMyEl8,577
589
+ wipo_gbd_transformation-1.1.76.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
590
+ wipo_gbd_transformation-1.1.76.dist-info/entry_points.txt,sha256=NFLtlP3mPHUi-hEoUcz4CXa7vcpP8bbwd18HS4arbEk,223
591
+ wipo_gbd_transformation-1.1.76.dist-info/top_level.txt,sha256=oU1j-JNLga18Fd-EV6Xl9wM8zxYoNVEzb7P8MDhTPJg,26
592
+ wipo_gbd_transformation-1.1.76.dist-info/RECORD,,