wipo-gbd-transformation 1.1.67__py3-none-any.whl → 1.1.68__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.
- gbdtransformation/brands/phtm/filters.py +78 -2
- gbdtransformation/brands/phtm/template.yml +185 -1
- {wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/METADATA +1 -1
- {wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/RECORD +8 -8
- {wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/LICENSE.md +0 -0
- {wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/WHEEL +0 -0
- {wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/entry_points.txt +0 -0
- {wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/top_level.txt +0 -0
|
@@ -1,10 +1,59 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
import gbdtransformation.brands.ipas.filters as ipas
|
|
2
3
|
|
|
3
4
|
# -------------------------------------------------------------
|
|
4
5
|
# data translation helpers:
|
|
5
6
|
# translate values from office interpretation to gbd equivalent
|
|
6
7
|
# -------------------------------------------------------------
|
|
7
8
|
|
|
9
|
+
ignore_namespace = [
|
|
10
|
+
'http://www.wipo.int/standards/XMLSchema/trademarks',
|
|
11
|
+
'http://www.wipo.int/standards/XMLSchema/wo-trademarks']
|
|
12
|
+
|
|
13
|
+
def get_appdate(appdate, appnum):
|
|
14
|
+
return appnum.split('/')[-2].zfill(4)
|
|
15
|
+
|
|
16
|
+
def clean_application_number(number):
|
|
17
|
+
# PH/4/1981/00000115 -> 4/1981/00000115
|
|
18
|
+
if number.startswith("PH/"):
|
|
19
|
+
number = number.replace("PH/", "")
|
|
20
|
+
return number
|
|
21
|
+
|
|
22
|
+
def get_registration_nb(trademark, tmstatus):
|
|
23
|
+
if trademark.RegistrationNumber:
|
|
24
|
+
return trademark.RegistrationNumber
|
|
25
|
+
|
|
26
|
+
if not tmstatus in ['Expired', 'Registered']:
|
|
27
|
+
return None
|
|
28
|
+
|
|
29
|
+
# 4/1981/00000115
|
|
30
|
+
appnum = clean_application_number(trademark.ApplicationNumber)
|
|
31
|
+
return appnum
|
|
32
|
+
|
|
33
|
+
def get_expiry_date(trademark, tmstatus):
|
|
34
|
+
return ipas.get_expiry_date(trademark, tmstatus)
|
|
35
|
+
|
|
36
|
+
def get_registration_date(trademark, tmstatus):
|
|
37
|
+
return ipas.get_registration_date(trademark, tmstatus)
|
|
38
|
+
|
|
39
|
+
def translate_type(header):
|
|
40
|
+
code = header.TransactionCode
|
|
41
|
+
|
|
42
|
+
if code == 'Trademark': return 'TRADEMARK'
|
|
43
|
+
if code == 'Trademarks': return 'TRADEMARK'
|
|
44
|
+
|
|
45
|
+
raise Exception('Type "%s" is not mapped.' % code)
|
|
46
|
+
|
|
47
|
+
def translate_kind(trademark, header):
|
|
48
|
+
subcode = header.TransactionSubCode
|
|
49
|
+
|
|
50
|
+
if subcode == 'Part A': return ['Individual']
|
|
51
|
+
if subcode == 'Part B': return ['Individual']
|
|
52
|
+
if subcode == 'National': return ['Individual']
|
|
53
|
+
if subcode == 'Trademark (national)': return ['Individual']
|
|
54
|
+
|
|
55
|
+
raise Exception('Kind "%s" not mapped.' % subcode)
|
|
56
|
+
|
|
8
57
|
def convertdate2(date, input_formats, output_format="%Y-%m-%d"):
|
|
9
58
|
if not date: return None
|
|
10
59
|
|
|
@@ -61,15 +110,31 @@ def translate_status(record):
|
|
|
61
110
|
|
|
62
111
|
raise Exception('Status "%s" unmapped' % status)
|
|
63
112
|
|
|
113
|
+
def translate_status(trademark):
|
|
114
|
+
status = trademark.MarkCurrentStatusCode
|
|
115
|
+
|
|
116
|
+
if status == 'TM Applications Received in Error': return 'Ended'
|
|
117
|
+
|
|
118
|
+
return ipas.translate_status(status)
|
|
119
|
+
|
|
120
|
+
def translate_event(event):
|
|
121
|
+
if event == 'TM Applications Received in Error': return 'Withdrawn'
|
|
122
|
+
return ipas.translate_event(event)
|
|
123
|
+
|
|
124
|
+
def translate_feature(trademark):
|
|
125
|
+
feature = trademark.MarkFeature
|
|
64
126
|
|
|
65
|
-
def translate_feature(feature):
|
|
66
127
|
if not feature: return 'Undefined'
|
|
67
128
|
|
|
68
129
|
if feature == 'B': return 'Combined'
|
|
69
130
|
if feature == 'L': return 'Figurative'
|
|
70
131
|
if feature == 'N': return 'Word'
|
|
71
132
|
|
|
72
|
-
|
|
133
|
+
return ipas.translate_feature(feature)
|
|
134
|
+
#raise Exception('Feature "%s" unmapped' % feature)
|
|
135
|
+
|
|
136
|
+
def verbal_lang_map(markVerbalElements, applang=None):
|
|
137
|
+
return ipas.verbal_lang_map(markVerbalElements, applang=applang)
|
|
73
138
|
|
|
74
139
|
def get_address(record):
|
|
75
140
|
if not record: return None
|
|
@@ -79,3 +144,14 @@ def get_address(record):
|
|
|
79
144
|
addr = [x for x in addr if x]
|
|
80
145
|
|
|
81
146
|
return ', '.join(addr)
|
|
147
|
+
|
|
148
|
+
# no international for PH
|
|
149
|
+
def is_international(header):
|
|
150
|
+
return False
|
|
151
|
+
|
|
152
|
+
# never accessed
|
|
153
|
+
def get_ir_refnum(appnum):
|
|
154
|
+
return
|
|
155
|
+
|
|
156
|
+
def get_goods_services(goods_services):
|
|
157
|
+
return ipas.get_goods_services(goods_services)
|
|
@@ -1 +1,185 @@
|
|
|
1
|
-
{%
|
|
1
|
+
{% from 'navigation.tmpl' import match %}
|
|
2
|
+
|
|
3
|
+
{% call(header) match('TradeMarkTransactionBody.TransactionContentDetails', Transaction) %}
|
|
4
|
+
|
|
5
|
+
{% set type = header | translate_type %}
|
|
6
|
+
type: {{ type }}
|
|
7
|
+
|
|
8
|
+
{% call(trademark) match('TransactionData.TradeMarkApplication.TradeMarkDetails.TradeMark', header) %}
|
|
9
|
+
|
|
10
|
+
{% set kind = trademark | translate_kind(header) %}
|
|
11
|
+
|
|
12
|
+
kind: {{ kind }}
|
|
13
|
+
|
|
14
|
+
reference:
|
|
15
|
+
{% if header | is_international %}
|
|
16
|
+
office: WO
|
|
17
|
+
registration:
|
|
18
|
+
- number: {{ trademark.ApplicationNumber | get_ir_refnum }}
|
|
19
|
+
{% endif %}
|
|
20
|
+
{% if not type == 'TRADEMARK' %}
|
|
21
|
+
office: {{ trademark.RegistrationOfficeCode }}
|
|
22
|
+
{% endif %}
|
|
23
|
+
|
|
24
|
+
registrationOfficeCode: {{ trademark.RegistrationOfficeCode }}
|
|
25
|
+
designatedCountries:
|
|
26
|
+
- {{ trademark.RegistrationOfficeCode }}
|
|
27
|
+
|
|
28
|
+
applicationLanguageCode: {{ trademark.ApplicationLanguageCode }}
|
|
29
|
+
|
|
30
|
+
{% set tmstatus = trademark | translate_status %}
|
|
31
|
+
{% set appdate = trademark.ApplicationDate | get_appdate(trademark.ApplicationNumber) %}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
gbdStatus: {{ tmstatus }}
|
|
35
|
+
officeStatus: {{ trademark.MarkCurrentStatusCode | parseStatus }}
|
|
36
|
+
statusDate: {{ trademark.MarkCurrentStatusDate }}
|
|
37
|
+
publicationDate: {{ (trademark.PublicationDetails.Publication | last).PublicationDate }}
|
|
38
|
+
|
|
39
|
+
markFeature: {{ trademark | translate_feature }}
|
|
40
|
+
|
|
41
|
+
st13: {{ trademark.ApplicationNumber | clean_application_number | st13(trademark.RegistrationOfficeCode, type=type, appdate=appdate) }}
|
|
42
|
+
applicationNumber: {{ trademark.ApplicationNumber | clean_application_number }}
|
|
43
|
+
applicationDate: {{ trademark.ApplicationDate }}
|
|
44
|
+
registrationNumber: {{ trademark | get_registration_nb(tmstatus) | remove_trailing('-') }}
|
|
45
|
+
registrationDate: {{ trademark | get_registration_date(tmstatus) }}
|
|
46
|
+
|
|
47
|
+
expiryDate: {{ trademark | get_expiry_date(tmstatus) }}
|
|
48
|
+
|
|
49
|
+
{% if tmstatus == 'Ended' %}
|
|
50
|
+
terminationDate: {{ trademark.MarkCurrentStatusDate }}
|
|
51
|
+
{% endif %}
|
|
52
|
+
|
|
53
|
+
markDisclaimerDetails:
|
|
54
|
+
{% call(disclaimer) match('MarkDisclaimerDetails.MarkDisclaimer', trademark) %}
|
|
55
|
+
- text: {{ disclaimer.__value }}
|
|
56
|
+
languageCode: {{ disclaimer.__value | guess_language(disclaimer._languageCode, default=trademark.ApplicationLanguageCode) }}
|
|
57
|
+
{% endcall %}
|
|
58
|
+
|
|
59
|
+
wordMarkSpecification:
|
|
60
|
+
{% call(wordSpec) match('WordMarkSpecification', trademark) %}
|
|
61
|
+
{% set verbal_by_language = wordSpec.MarkVerbalElementText | verbal_lang_map(applang=trademark.ApplicationLanguageCode) %}
|
|
62
|
+
markVerbalElement:
|
|
63
|
+
{% for lang, verbals in verbal_by_language.items() %}
|
|
64
|
+
{% for verbal in verbals %}
|
|
65
|
+
- languageCode: {{ lang }}
|
|
66
|
+
text: {{ verbal }}
|
|
67
|
+
{% endfor %}
|
|
68
|
+
{% endfor %}
|
|
69
|
+
markTranslation:
|
|
70
|
+
{% call(trans) match('MarkTranslation', wordSpec) %}
|
|
71
|
+
- text: {{ trans }}
|
|
72
|
+
languageCode: {{ trans | guess_language(trans._languageCode, trademark.ApplicationLanguageCode) }}
|
|
73
|
+
{% endcall %}
|
|
74
|
+
{% endcall %}
|
|
75
|
+
|
|
76
|
+
markImageDetails:
|
|
77
|
+
{% call(img) match('MarkImageDetails.MarkImage', trademark) %}
|
|
78
|
+
- name: {{ trademark.ApplicationNumber }}
|
|
79
|
+
{% call(cclaim) match('MarkImageColourClaimedText', img) %}
|
|
80
|
+
{% if not cclaim.__value == 'N/A' %}
|
|
81
|
+
colourIndicator: {{ cclaim.__value | remove_trailing('-') | get_true_or_false }}
|
|
82
|
+
colourClaimed:
|
|
83
|
+
- text: {{ cclaim.__value | remove_trailing('-') }}
|
|
84
|
+
languageCode: {{ cclaim.__value | remove_trailing('-') | guess_language(cclaim._languageCode, trademark.ApplicationLanguageCode) }}
|
|
85
|
+
{% endif %}
|
|
86
|
+
{% endcall %}
|
|
87
|
+
{% call(category) match('MarkImageCategory', img) %}
|
|
88
|
+
classification:
|
|
89
|
+
kind: {{ category.CategoryKind }}
|
|
90
|
+
version: {{ category.CategoryVersion | parse_version }}
|
|
91
|
+
code:
|
|
92
|
+
{% call(vc) match('CategoryCodeDetails.CategoryCode', category) %}
|
|
93
|
+
- {{ vc }}
|
|
94
|
+
{% endcall %}
|
|
95
|
+
{% endcall %}
|
|
96
|
+
{% endcall %}
|
|
97
|
+
|
|
98
|
+
{% set nc_gs = trademark.GoodsServicesDetails.GoodsServices.ClassDescriptionDetails.ClassDescription | get_goods_services %}
|
|
99
|
+
{% if (nc_gs.keys() | length) > 0 %}
|
|
100
|
+
goodsServicesClassification:
|
|
101
|
+
kind: Nice
|
|
102
|
+
version: {{ ASK_THE_OFFICE }}
|
|
103
|
+
class:
|
|
104
|
+
{% for nc in nc_gs.keys() %}
|
|
105
|
+
- code: {{ nc | int }}
|
|
106
|
+
{% if nc_gs[nc]['terms'] %}
|
|
107
|
+
terms:
|
|
108
|
+
{{ nc_gs[nc]['terms'] | guess_language(nc_gs[nc['terms']], trademark.ApplicationLanguageCode) | field_name}}:
|
|
109
|
+
{% for gsline in nc_gs[nc]['terms'] | remove_trailing('.', '-') | split_terms %}
|
|
110
|
+
- {{ gsline | lower }}
|
|
111
|
+
{% endfor %}
|
|
112
|
+
{% endif %}
|
|
113
|
+
{% endfor %}
|
|
114
|
+
{% endif %}
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
applicants:
|
|
118
|
+
{% call(applicant) match('ApplicantDetails.Applicant', trademark) %}
|
|
119
|
+
{% call(details) match('ApplicantAddressBook.FormattedNameAddress.Name.FreeFormatName', applicant) %}
|
|
120
|
+
- identifier: {{ details.ApplicantIdentifier }}
|
|
121
|
+
fullName:
|
|
122
|
+
{% call(nameline) match('FreeFormatNameDetails.FreeFormatNameLine', details) %}
|
|
123
|
+
{% if nameline | has_value %}
|
|
124
|
+
- text: {{ nameline }}
|
|
125
|
+
languageCode: {{ nameline.__value | guess_language(nameline._languageCode, trademark.ApplicationLanguageCode) }}
|
|
126
|
+
{% endif %}
|
|
127
|
+
{% endcall %}
|
|
128
|
+
{% endcall %}
|
|
129
|
+
{% call(address) match('ApplicantAddressBook.FormattedNameAddress.Address', applicant) %}
|
|
130
|
+
fullAddress:
|
|
131
|
+
{% call(adrline) match('FreeFormatAddress.FreeFormatAddressLine', address) %}
|
|
132
|
+
{% if adrline | has_value %}
|
|
133
|
+
- text: {{ adrline }}
|
|
134
|
+
languageCode: {{ adrline | guess_language(adrline._languageCode, trademark.ApplicationLanguageCode) }}
|
|
135
|
+
{% endif %}
|
|
136
|
+
{% endcall %}
|
|
137
|
+
countryCode: {{ address.AddressCountryCode | remove_trailing('-', '.') | remove_numerics }}
|
|
138
|
+
{% endcall %}
|
|
139
|
+
{% endcall %}
|
|
140
|
+
|
|
141
|
+
representatives:
|
|
142
|
+
{% call(representative) match('RepresentativeDetails.Representative', trademark) %}
|
|
143
|
+
{% call(details) match('RepresentativeAddressBook.FormattedNameAddress.Name.FreeFormatName', representative) %}
|
|
144
|
+
- identifier: {{ details.RepresentativeIdentifier }}
|
|
145
|
+
fullName:
|
|
146
|
+
{% call(nameline) match('FreeFormatNameDetails.FreeFormatNameLine', details) %}
|
|
147
|
+
- text: {{ nameline }}
|
|
148
|
+
languageCode: {{ nameline.__value | guess_language(nameline._languageCode, trademark.ApplicationLanguageCode) }}
|
|
149
|
+
{% endcall %}
|
|
150
|
+
{% endcall %}
|
|
151
|
+
{% call(address) match('RepresentativeAddressBook.FormattedNameAddress.Address', representative) %}
|
|
152
|
+
fullAddress:
|
|
153
|
+
{% call(adrline) match('FreeFormatAddress.FreeFormatAddressLine', address) %}
|
|
154
|
+
{% if not adrline == '-' %}
|
|
155
|
+
- text: {{ adrline }}
|
|
156
|
+
languageCode: {{ adrline | guess_language(adrline._languageCode, trademark.ApplicationLanguageCode) }}
|
|
157
|
+
{% endif %}
|
|
158
|
+
{% endcall %}
|
|
159
|
+
countryCode: {{ address.AddressCountryCode | remove_trailing('-', '.') | remove_numerics }}
|
|
160
|
+
{% endcall %}
|
|
161
|
+
{% endcall %}
|
|
162
|
+
|
|
163
|
+
priorities:
|
|
164
|
+
{% call(priority) match('PriorityDetails.Priority', trademark) %}
|
|
165
|
+
- countryCode: {{ priority.PriorityCountryCode }}
|
|
166
|
+
number: {{ priority.PriorityNumber }}
|
|
167
|
+
date: {{ priority.PriorityDate }}
|
|
168
|
+
{% endcall %}
|
|
169
|
+
|
|
170
|
+
events:
|
|
171
|
+
{% call(event) match('MarkEventDetails.MarkEvent', trademark) %}
|
|
172
|
+
{% if event.MarkEventCode %}
|
|
173
|
+
- officeKind: {{ event.MarkEventCode }}
|
|
174
|
+
gbdKind: {{ event.MarkEventCode | translate_event }}
|
|
175
|
+
date: {{ event.MarkEventDate }}
|
|
176
|
+
{% else %}
|
|
177
|
+
- officeKind: {{ event.OfficeSpecificMarkEventName }}
|
|
178
|
+
gbdKind: {{ event.OfficeSpecificMarkEventName | translate_event }}
|
|
179
|
+
date: {{ event.MarkEventDate }}
|
|
180
|
+
|
|
181
|
+
{% endif %}
|
|
182
|
+
{% endcall %}
|
|
183
|
+
|
|
184
|
+
{% endcall %}
|
|
185
|
+
{% endcall %}
|
{wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/RECORD
RENAMED
|
@@ -320,11 +320,11 @@ gbdtransformation/brands/pgtm/template.yml,sha256=PO7s1HDQM9ushIJuIX3z_dfWO-f62Y
|
|
|
320
320
|
gbdtransformation/brands/pgtm/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
321
321
|
gbdtransformation/brands/pgtm/tests/pgtm.xml,sha256=fAzAz2VtqOFV_2QImDbNxDvuTr-Ue3e5tGx8h-Lnnvg,6533
|
|
322
322
|
gbdtransformation/brands/phtm/__init__.py,sha256=UHmbQDIPDdApISBKfO9tKOX6LgUQ_Ib-IVMR5kCVMTY,86
|
|
323
|
-
gbdtransformation/brands/phtm/filters.py,sha256=
|
|
323
|
+
gbdtransformation/brands/phtm/filters.py,sha256=01woZNZUCCBEuX2NMS3S0oUZ-BZUwiBrU-YjP5I0CpE,5885
|
|
324
324
|
gbdtransformation/brands/phtm/schema,sha256=Nb5tI5MUrzn19c8GpLFuJhpiLn0Fa9XPza10eNHeesI,2877
|
|
325
325
|
gbdtransformation/brands/phtm/schema.classic,sha256=3JOKHUfK0jSo0NBlDmeGFAKqfYdMJOrIPBIoNUMrVFI,808
|
|
326
326
|
gbdtransformation/brands/phtm/template.classic.yml,sha256=U5th90SpXjspWTPuimqftd8vZfJ3tT90mIud5n7Zv8w,2820
|
|
327
|
-
gbdtransformation/brands/phtm/template.yml,sha256=
|
|
327
|
+
gbdtransformation/brands/phtm/template.yml,sha256=Tvr7L7--PodWQ_SxK-s5VElSIQaCE8yMeYptl6K4lbE,7456
|
|
328
328
|
gbdtransformation/brands/qatm/__init__.py,sha256=NBdOewZ1F_3eErahjyR-up8bjz1FSxwEiPSJfDw6GxY,79
|
|
329
329
|
gbdtransformation/brands/qatm/filters.py,sha256=lMPVBX2ProdUtg5LcuQAmlInoGCo1-JZemHrvE1lNvw,2330
|
|
330
330
|
gbdtransformation/brands/qatm/schema,sha256=AP0MxQyD0hY4APRh8nxitlxMqJYJB4AaaTJ8y20-XBA,3283
|
|
@@ -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.
|
|
588
|
-
wipo_gbd_transformation-1.1.
|
|
589
|
-
wipo_gbd_transformation-1.1.
|
|
590
|
-
wipo_gbd_transformation-1.1.
|
|
591
|
-
wipo_gbd_transformation-1.1.
|
|
592
|
-
wipo_gbd_transformation-1.1.
|
|
587
|
+
wipo_gbd_transformation-1.1.68.dist-info/LICENSE.md,sha256=6r2dL13EwZqSt2ellLbJRFTA-6ECIDOer4YthCfkac0,35654
|
|
588
|
+
wipo_gbd_transformation-1.1.68.dist-info/METADATA,sha256=AADeJ835Tr7JRCIcKIFV51fUHgtlMR5VdeaEZjwZaFo,577
|
|
589
|
+
wipo_gbd_transformation-1.1.68.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
590
|
+
wipo_gbd_transformation-1.1.68.dist-info/entry_points.txt,sha256=NFLtlP3mPHUi-hEoUcz4CXa7vcpP8bbwd18HS4arbEk,223
|
|
591
|
+
wipo_gbd_transformation-1.1.68.dist-info/top_level.txt,sha256=oU1j-JNLga18Fd-EV6Xl9wM8zxYoNVEzb7P8MDhTPJg,26
|
|
592
|
+
wipo_gbd_transformation-1.1.68.dist-info/RECORD,,
|
{wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/LICENSE.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wipo_gbd_transformation-1.1.67.dist-info → wipo_gbd_transformation-1.1.68.dist-info}/top_level.txt
RENAMED
|
File without changes
|