wipo-gbd-transformation 1.1.105__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.
- gbdtransformation/__init__.py +0 -0
- gbdtransformation/brands/__init__.py +44 -0
- gbdtransformation/brands/aetm/__init__.py +5 -0
- gbdtransformation/brands/aetm/filters.py +84 -0
- gbdtransformation/brands/aetm/schema +87 -0
- gbdtransformation/brands/aetm/template.yml +1 -0
- gbdtransformation/brands/aetm/tests/__init__.py +0 -0
- gbdtransformation/brands/altm/__init__.py +6 -0
- gbdtransformation/brands/altm/filters.py +107 -0
- gbdtransformation/brands/altm/schema +83 -0
- gbdtransformation/brands/altm/template.yml +1 -0
- gbdtransformation/brands/altm/tests/__init__.py +0 -0
- gbdtransformation/brands/altm/tests/altm.xml +93 -0
- gbdtransformation/brands/aptm/__init__.py +15 -0
- gbdtransformation/brands/aptm/filters.py +80 -0
- gbdtransformation/brands/aptm/schema +87 -0
- gbdtransformation/brands/aptm/template.yml +1 -0
- gbdtransformation/brands/aptm/tests/__init__.py +0 -0
- gbdtransformation/brands/attm/__init__.py +6 -0
- gbdtransformation/brands/attm/filters.py +76 -0
- gbdtransformation/brands/attm/schema +52 -0
- gbdtransformation/brands/attm/template.yml +85 -0
- gbdtransformation/brands/autm/__init__.py +2 -0
- gbdtransformation/brands/autm/filters.py +222 -0
- gbdtransformation/brands/autm/schema +91 -0
- gbdtransformation/brands/autm/template.yml +157 -0
- gbdtransformation/brands/bgtm/__init__.py +5 -0
- gbdtransformation/brands/bgtm/filters.py +112 -0
- gbdtransformation/brands/bgtm/schema +314 -0
- gbdtransformation/brands/bgtm/template.yml +154 -0
- gbdtransformation/brands/bhtm/__init__.py +12 -0
- gbdtransformation/brands/bhtm/filters.py +87 -0
- gbdtransformation/brands/bhtm/schema +87 -0
- gbdtransformation/brands/bhtm/template.yml +1 -0
- gbdtransformation/brands/bhtm/tests/__init__.py +0 -0
- gbdtransformation/brands/bntm/__init__.py +2 -0
- gbdtransformation/brands/bntm/filters.py +75 -0
- gbdtransformation/brands/bntm/schema +87 -0
- gbdtransformation/brands/bntm/template.yml +1 -0
- gbdtransformation/brands/bntm/tests/__init__.py +0 -0
- gbdtransformation/brands/brtm/__init__.py +3 -0
- gbdtransformation/brands/brtm/filters.py +169 -0
- gbdtransformation/brands/brtm/schema +86 -0
- gbdtransformation/brands/brtm/template.yml +22 -0
- gbdtransformation/brands/brtm/tests/__init__.py +0 -0
- gbdtransformation/brands/brtm/tests/test01.xml +53 -0
- gbdtransformation/brands/bttm/__init__.py +10 -0
- gbdtransformation/brands/bttm/filters.py +80 -0
- gbdtransformation/brands/bttm/schema +87 -0
- gbdtransformation/brands/bttm/template.yml +1 -0
- gbdtransformation/brands/bttm/tests/__init__.py +0 -0
- gbdtransformation/brands/bwtm/__init__.py +13 -0
- gbdtransformation/brands/bwtm/filters.py +90 -0
- gbdtransformation/brands/bwtm/schema +87 -0
- gbdtransformation/brands/bwtm/template.yml +1 -0
- gbdtransformation/brands/bwtm/tests/__init__.py +0 -0
- gbdtransformation/brands/bztm/__init__.py +16 -0
- gbdtransformation/brands/bztm/filters.py +77 -0
- gbdtransformation/brands/bztm/schema +87 -0
- gbdtransformation/brands/bztm/template.yml +1 -0
- gbdtransformation/brands/bztm/tests/__init__.py +0 -0
- gbdtransformation/brands/catm/__init__.py +10 -0
- gbdtransformation/brands/catm/filters.py +272 -0
- gbdtransformation/brands/catm/schema +804 -0
- gbdtransformation/brands/catm/template.yml +230 -0
- gbdtransformation/brands/chtm/__init__.py +6 -0
- gbdtransformation/brands/chtm/filters.py +161 -0
- gbdtransformation/brands/chtm/schema +79 -0
- gbdtransformation/brands/chtm/template.yml +121 -0
- gbdtransformation/brands/cltm/__init__.py +2 -0
- gbdtransformation/brands/cltm/filters.py +80 -0
- gbdtransformation/brands/cltm/schema +86 -0
- gbdtransformation/brands/cltm/template.yml +1 -0
- gbdtransformation/brands/cltm/tests/__init__.py +0 -0
- gbdtransformation/brands/crtm/__init__.py +5 -0
- gbdtransformation/brands/crtm/filters.py +196 -0
- gbdtransformation/brands/crtm/schema +86 -0
- gbdtransformation/brands/crtm/template.yml +1 -0
- gbdtransformation/brands/crtm/tests/__init__.py +0 -0
- gbdtransformation/brands/cutm/__init__.py +10 -0
- gbdtransformation/brands/cutm/filters.py +94 -0
- gbdtransformation/brands/cutm/schema +86 -0
- gbdtransformation/brands/cutm/template.yml +4 -0
- gbdtransformation/brands/cutm/tests/__init__.py +0 -0
- gbdtransformation/brands/detm/__init__.py +19 -0
- gbdtransformation/brands/detm/filters.py +75 -0
- gbdtransformation/brands/detm/schema +511 -0
- gbdtransformation/brands/detm/template.yml +151 -0
- gbdtransformation/brands/dktm/__init__.py +7 -0
- gbdtransformation/brands/dktm/filters.py +90 -0
- gbdtransformation/brands/dktm/schema +95 -0
- gbdtransformation/brands/dktm/template.yml +114 -0
- gbdtransformation/brands/dztm/__init__.py +10 -0
- gbdtransformation/brands/dztm/filters.py +81 -0
- gbdtransformation/brands/dztm/schema +87 -0
- gbdtransformation/brands/dztm/template.yml +1 -0
- gbdtransformation/brands/dztm/tests/__init__.py +0 -0
- gbdtransformation/brands/eetm/__init__.py +8 -0
- gbdtransformation/brands/eetm/filters.py +115 -0
- gbdtransformation/brands/eetm/schema +48 -0
- gbdtransformation/brands/eetm/template.yml +98 -0
- gbdtransformation/brands/egtm/__init__.py +5 -0
- gbdtransformation/brands/egtm/filters.py +73 -0
- gbdtransformation/brands/egtm/schema +87 -0
- gbdtransformation/brands/egtm/template.yml +1 -0
- gbdtransformation/brands/egtm/tests/__init__.py +0 -0
- gbdtransformation/brands/emtm/__init__.py +3 -0
- gbdtransformation/brands/emtm/filters.py +96 -0
- gbdtransformation/brands/emtm/schema +314 -0
- gbdtransformation/brands/emtm/template.yml +125 -0
- gbdtransformation/brands/estm/__init__.py +3 -0
- gbdtransformation/brands/estm/filters.py +110 -0
- gbdtransformation/brands/estm/schema +99 -0
- gbdtransformation/brands/estm/template.yml +144 -0
- gbdtransformation/brands/filters.py +125 -0
- gbdtransformation/brands/frtm/__init__.py +2 -0
- gbdtransformation/brands/frtm/filters.py +172 -0
- gbdtransformation/brands/frtm/schema +300 -0
- gbdtransformation/brands/frtm/template.yml +203 -0
- gbdtransformation/brands/gbtm/__init__.py +3 -0
- gbdtransformation/brands/gbtm/filters.py +122 -0
- gbdtransformation/brands/gbtm/schema +362 -0
- gbdtransformation/brands/gbtm/template.yml +147 -0
- gbdtransformation/brands/gdtm/__init__.py +5 -0
- gbdtransformation/brands/gdtm/filters.py +68 -0
- gbdtransformation/brands/gdtm/schema +87 -0
- gbdtransformation/brands/gdtm/template.yml +1 -0
- gbdtransformation/brands/gdtm/tests/__init__.py +0 -0
- gbdtransformation/brands/getm/__init__.py +3 -0
- gbdtransformation/brands/getm/filters.py +68 -0
- gbdtransformation/brands/getm/schema +209 -0
- gbdtransformation/brands/getm/template.yml +142 -0
- gbdtransformation/brands/ghtm/__init__.py +12 -0
- gbdtransformation/brands/ghtm/filters.py +74 -0
- gbdtransformation/brands/ghtm/schema +86 -0
- gbdtransformation/brands/ghtm/template.yml +1 -0
- gbdtransformation/brands/ghtm/tests/__init__.py +0 -0
- gbdtransformation/brands/gmtm/__init__.py +7 -0
- gbdtransformation/brands/gmtm/filters.py +70 -0
- gbdtransformation/brands/gmtm/schema +86 -0
- gbdtransformation/brands/gmtm/template.yml +1 -0
- gbdtransformation/brands/gmtm/tests/__init__.py +0 -0
- gbdtransformation/brands/gstm/__init__.py +2 -0
- gbdtransformation/brands/gstm/filters.py +75 -0
- gbdtransformation/brands/gstm/template.gs.yml +56 -0
- gbdtransformation/brands/gstm/template.yml +32 -0
- gbdtransformation/brands/hrtm/__init__.py +3 -0
- gbdtransformation/brands/hrtm/filters.py +158 -0
- gbdtransformation/brands/hrtm/schema +43 -0
- gbdtransformation/brands/hrtm/template.yml +205 -0
- gbdtransformation/brands/idtm/__init__.py +12 -0
- gbdtransformation/brands/idtm/filters.py +95 -0
- gbdtransformation/brands/idtm/schema +86 -0
- gbdtransformation/brands/idtm/template.yml +1 -0
- gbdtransformation/brands/idtm/tests/__init__.py +0 -0
- gbdtransformation/brands/idtm/tests/translation.xml +106 -0
- gbdtransformation/brands/idtm/tests/unicode.xml +120 -0
- gbdtransformation/brands/iltm/__init__.py +2 -0
- gbdtransformation/brands/iltm/filters.py +91 -0
- gbdtransformation/brands/iltm/schema +87 -0
- gbdtransformation/brands/iltm/template.yml +213 -0
- gbdtransformation/brands/iltm/tests/__init__.py +0 -0
- gbdtransformation/brands/iltm/tests/cancellations.xml +156 -0
- gbdtransformation/brands/iltm/tests/collcert.xml +51 -0
- gbdtransformation/brands/iltm/tests/eventdata.xml +83 -0
- gbdtransformation/brands/iltm/tests/international.xml +80 -0
- gbdtransformation/brands/iltm/tests/markfeature.xml +117 -0
- gbdtransformation/brands/iltm/tests/noevents.xml +44 -0
- gbdtransformation/brands/iltm/tests/opposition.xml +147 -0
- gbdtransformation/brands/iltm/tests/tlit.xml +77 -0
- gbdtransformation/brands/intm/__init__.py +6 -0
- gbdtransformation/brands/intm/filters.py +75 -0
- gbdtransformation/brands/intm/schema +127 -0
- gbdtransformation/brands/intm/template.yml +112 -0
- gbdtransformation/brands/ipas/__init__.py +0 -0
- gbdtransformation/brands/ipas/filters.py +203 -0
- gbdtransformation/brands/ipas/template.yml +185 -0
- gbdtransformation/brands/istm/__init__.py +10 -0
- gbdtransformation/brands/istm/filters.py +60 -0
- gbdtransformation/brands/istm/schema +53 -0
- gbdtransformation/brands/istm/template.yml +119 -0
- gbdtransformation/brands/ittm/__init__.py +6 -0
- gbdtransformation/brands/ittm/filters.py +114 -0
- gbdtransformation/brands/ittm/schema +104 -0
- gbdtransformation/brands/ittm/template.yml +107 -0
- gbdtransformation/brands/jotm/__init__.py +8 -0
- gbdtransformation/brands/jotm/filters.py +61 -0
- gbdtransformation/brands/jotm/schema +86 -0
- gbdtransformation/brands/jotm/template.yml +1 -0
- gbdtransformation/brands/jotm/tests/__init__.py +0 -0
- gbdtransformation/brands/jotm/tests/test.xml +84 -0
- gbdtransformation/brands/jptm/__init__.py +6 -0
- gbdtransformation/brands/jptm/filters.py +79 -0
- gbdtransformation/brands/jptm/schema +39 -0
- gbdtransformation/brands/jptm/template.yml +113 -0
- gbdtransformation/brands/ketm/__init__.py +9 -0
- gbdtransformation/brands/ketm/filters.py +77 -0
- gbdtransformation/brands/ketm/schema +86 -0
- gbdtransformation/brands/ketm/template.yml +1 -0
- gbdtransformation/brands/ketm/tests/__init__.py +0 -0
- gbdtransformation/brands/kgtm/__init__.py +6 -0
- gbdtransformation/brands/kgtm/filters.py +67 -0
- gbdtransformation/brands/kgtm/schema +27 -0
- gbdtransformation/brands/kgtm/template.yml +58 -0
- gbdtransformation/brands/khtm/__init__.py +14 -0
- gbdtransformation/brands/khtm/filters.py +134 -0
- gbdtransformation/brands/khtm/schema +86 -0
- gbdtransformation/brands/khtm/template.yml +1 -0
- gbdtransformation/brands/khtm/tests/__init__.py +0 -0
- gbdtransformation/brands/khtm/tests/khtm.xml +122 -0
- gbdtransformation/brands/krtm/__init__.py +6 -0
- gbdtransformation/brands/krtm/filters.py +136 -0
- gbdtransformation/brands/krtm/schema +179 -0
- gbdtransformation/brands/krtm/template.yml +186 -0
- gbdtransformation/brands/kwtm/__init__.py +2 -0
- gbdtransformation/brands/kwtm/filters.py +69 -0
- gbdtransformation/brands/kwtm/schema +86 -0
- gbdtransformation/brands/kwtm/template.yml +1 -0
- gbdtransformation/brands/kwtm/tests/__init__.py +0 -0
- gbdtransformation/brands/kwtm/tests/test.xml +84 -0
- gbdtransformation/brands/kztm/__init__.py +242 -0
- gbdtransformation/brands/kztm/filters.py +140 -0
- gbdtransformation/brands/kztm/schema +36 -0
- gbdtransformation/brands/kztm/template.yml +117 -0
- gbdtransformation/brands/latm/__init__.py +7 -0
- gbdtransformation/brands/latm/filters.py +93 -0
- gbdtransformation/brands/latm/schema +86 -0
- gbdtransformation/brands/latm/template.yml +1 -0
- gbdtransformation/brands/latm/tests/__init__.py +0 -0
- gbdtransformation/brands/latm/tests/test.xml +112 -0
- gbdtransformation/brands/lktm/__init__.py +5 -0
- gbdtransformation/brands/lktm/filters.py +83 -0
- gbdtransformation/brands/lktm/schema +87 -0
- gbdtransformation/brands/lktm/template.yml +1 -0
- gbdtransformation/brands/lktm/tests/__init__.py +0 -0
- gbdtransformation/brands/matm/__init__.py +3 -0
- gbdtransformation/brands/matm/filters.py +36 -0
- gbdtransformation/brands/matm/schema +33 -0
- gbdtransformation/brands/matm/template.yml +72 -0
- gbdtransformation/brands/mctm/__init__.py +3 -0
- gbdtransformation/brands/mctm/filters.py +65 -0
- gbdtransformation/brands/mctm/schema +128 -0
- gbdtransformation/brands/mctm/template.yml +122 -0
- gbdtransformation/brands/mdtm/__init__.py +3 -0
- gbdtransformation/brands/mdtm/filters.py +64 -0
- gbdtransformation/brands/mdtm/schema +128 -0
- gbdtransformation/brands/mdtm/template.yml +122 -0
- gbdtransformation/brands/metm/__init__.py +5 -0
- gbdtransformation/brands/metm/filters.py +87 -0
- gbdtransformation/brands/metm/schema +87 -0
- gbdtransformation/brands/metm/template.yml +1 -0
- gbdtransformation/brands/metm/tests/__init__.py +0 -0
- gbdtransformation/brands/mgtm/__init__.py +7 -0
- gbdtransformation/brands/mgtm/filters.py +73 -0
- gbdtransformation/brands/mgtm/schema +86 -0
- gbdtransformation/brands/mgtm/template.yml +1 -0
- gbdtransformation/brands/mgtm/tests/__init__.py +0 -0
- gbdtransformation/brands/mgtm/tests/test.xml +107 -0
- gbdtransformation/brands/mktm/__init__.py +6 -0
- gbdtransformation/brands/mktm/filters.py +63 -0
- gbdtransformation/brands/mktm/schema +80 -0
- gbdtransformation/brands/mktm/template.yml +112 -0
- gbdtransformation/brands/mntm/__init__.py +11 -0
- gbdtransformation/brands/mntm/filters.py +99 -0
- gbdtransformation/brands/mntm/schema +86 -0
- gbdtransformation/brands/mntm/template.yml +1 -0
- gbdtransformation/brands/mntm/tests/__init__.py +0 -0
- gbdtransformation/brands/mwtm/__init__.py +11 -0
- gbdtransformation/brands/mwtm/filters.py +80 -0
- gbdtransformation/brands/mwtm/schema +86 -0
- gbdtransformation/brands/mwtm/template.yml +1 -0
- gbdtransformation/brands/mwtm/tests/__init__.py +0 -0
- gbdtransformation/brands/mxtm/__init__.py +6 -0
- gbdtransformation/brands/mxtm/filters.py +77 -0
- gbdtransformation/brands/mxtm/schema +81 -0
- gbdtransformation/brands/mxtm/template.yml +127 -0
- gbdtransformation/brands/mytm/__init__.py +17 -0
- gbdtransformation/brands/mytm/filters.py +125 -0
- gbdtransformation/brands/mytm/schema +86 -0
- gbdtransformation/brands/mytm/template.yml +1 -0
- gbdtransformation/brands/mytm/tests/__init__.py +0 -0
- gbdtransformation/brands/mytm/tests/example.xml +132 -0
- gbdtransformation/brands/mytm/tests/mytm.xml +132 -0
- gbdtransformation/brands/mztm/__init__.py +14 -0
- gbdtransformation/brands/mztm/filters.py +89 -0
- gbdtransformation/brands/mztm/schema +86 -0
- gbdtransformation/brands/mztm/template.yml +1 -0
- gbdtransformation/brands/mztm/tests/__init__.py +0 -0
- gbdtransformation/brands/natm/__init__.py +11 -0
- gbdtransformation/brands/natm/filters.py +88 -0
- gbdtransformation/brands/natm/schema +86 -0
- gbdtransformation/brands/natm/template.yml +1 -0
- gbdtransformation/brands/natm/tests/__init__.py +0 -0
- gbdtransformation/brands/notm/__init__.py +5 -0
- gbdtransformation/brands/notm/filters.py +170 -0
- gbdtransformation/brands/notm/template.yml +289 -0
- gbdtransformation/brands/nztm/__init__.py +3 -0
- gbdtransformation/brands/nztm/filters.py +126 -0
- gbdtransformation/brands/nztm/schema +197 -0
- gbdtransformation/brands/nztm/template.yml +161 -0
- gbdtransformation/brands/oatm/__init__.py +18 -0
- gbdtransformation/brands/oatm/filters.py +82 -0
- gbdtransformation/brands/oatm/schema +87 -0
- gbdtransformation/brands/oatm/template.yml +1 -0
- gbdtransformation/brands/oatm/tests/__init__.py +0 -0
- gbdtransformation/brands/omtm/__init__.py +5 -0
- gbdtransformation/brands/omtm/filters.py +60 -0
- gbdtransformation/brands/omtm/schema +86 -0
- gbdtransformation/brands/omtm/template.yml +1 -0
- gbdtransformation/brands/omtm/tests/__init__.py +0 -0
- gbdtransformation/brands/omtm/tests/test.xml +84 -0
- gbdtransformation/brands/patm/__init__.py +8 -0
- gbdtransformation/brands/patm/filters.py +149 -0
- gbdtransformation/brands/patm/template.yml +40 -0
- gbdtransformation/brands/petm/__init__.py +6 -0
- gbdtransformation/brands/petm/filters.py +90 -0
- gbdtransformation/brands/petm/schema +114 -0
- gbdtransformation/brands/petm/template.yml +143 -0
- gbdtransformation/brands/pgtm/__init__.py +5 -0
- gbdtransformation/brands/pgtm/filters.py +76 -0
- gbdtransformation/brands/pgtm/schema +86 -0
- gbdtransformation/brands/pgtm/template.yml +1 -0
- gbdtransformation/brands/pgtm/tests/__init__.py +0 -0
- gbdtransformation/brands/pgtm/tests/pgtm.xml +128 -0
- gbdtransformation/brands/phtm/__init__.py +14 -0
- gbdtransformation/brands/phtm/filters.py +169 -0
- gbdtransformation/brands/phtm/schema +79 -0
- gbdtransformation/brands/phtm/schema.classic +50 -0
- gbdtransformation/brands/phtm/template.classic.yml +102 -0
- gbdtransformation/brands/phtm/template.yml +189 -0
- gbdtransformation/brands/pttm/__init__.py +0 -0
- gbdtransformation/brands/pttm/filters.py +0 -0
- gbdtransformation/brands/pttm/schema +0 -0
- gbdtransformation/brands/pttm/template.yml +0 -0
- gbdtransformation/brands/pytm/__init__.py +6 -0
- gbdtransformation/brands/pytm/filters.py +136 -0
- gbdtransformation/brands/pytm/template.yml +40 -0
- gbdtransformation/brands/qatm/__init__.py +5 -0
- gbdtransformation/brands/qatm/filters.py +81 -0
- gbdtransformation/brands/qatm/schema +87 -0
- gbdtransformation/brands/qatm/template.yml +1 -0
- gbdtransformation/brands/qatm/tests/__init__.py +0 -0
- gbdtransformation/brands/rotm/__init__.py +3 -0
- gbdtransformation/brands/rotm/filters.py +82 -0
- gbdtransformation/brands/rotm/schema +128 -0
- gbdtransformation/brands/rotm/template.yml +121 -0
- gbdtransformation/brands/rstm/__init__.py +5 -0
- gbdtransformation/brands/rstm/filters.py +88 -0
- gbdtransformation/brands/rstm/schema +86 -0
- gbdtransformation/brands/rstm/template.yml +1 -0
- gbdtransformation/brands/rstm/tests/__init__.py +0 -0
- gbdtransformation/brands/rutm/__init__.py +14 -0
- gbdtransformation/brands/rutm/filters.py +82 -0
- gbdtransformation/brands/rutm/schema +94 -0
- gbdtransformation/brands/rutm/template.yml +105 -0
- gbdtransformation/brands/sdtm/__init__.py +5 -0
- gbdtransformation/brands/sdtm/filters.py +59 -0
- gbdtransformation/brands/sdtm/schema +86 -0
- gbdtransformation/brands/sdtm/template.yml +1 -0
- gbdtransformation/brands/sdtm/tests/__init__.py +0 -0
- gbdtransformation/brands/sdtm/tests/test.xml +84 -0
- gbdtransformation/brands/sgtm/__init__.py +16 -0
- gbdtransformation/brands/sgtm/filters.py +177 -0
- gbdtransformation/brands/sgtm/schema +213 -0
- gbdtransformation/brands/sgtm/template.article6ter.yml +48 -0
- gbdtransformation/brands/sgtm/template.r13.yml +45 -0
- gbdtransformation/brands/sgtm/template.trademark.yml +148 -0
- gbdtransformation/brands/sgtm/template.yml +9 -0
- gbdtransformation/brands/smtm/__init__.py +6 -0
- gbdtransformation/brands/smtm/filters.py +77 -0
- gbdtransformation/brands/smtm/schema +86 -0
- gbdtransformation/brands/smtm/template.yml +1 -0
- gbdtransformation/brands/smtm/tests/__init__.py +0 -0
- gbdtransformation/brands/smtm/tests/test.xml +133 -0
- gbdtransformation/brands/solrjtm/__init__.py +1 -0
- gbdtransformation/brands/solrjtm/filters.py +85 -0
- gbdtransformation/brands/solrjtm/template.yml +195 -0
- gbdtransformation/brands/st66tm/__init__.py +1 -0
- gbdtransformation/brands/st66tm/filters.py +33 -0
- gbdtransformation/brands/st66tm/st66tm.tmpl +219 -0
- gbdtransformation/brands/sttm/__init__.py +18 -0
- gbdtransformation/brands/sttm/filters.py +72 -0
- gbdtransformation/brands/sttm/schema +83 -0
- gbdtransformation/brands/sttm/template.yml +1 -0
- gbdtransformation/brands/sttm/tests/__init__.py +0 -0
- gbdtransformation/brands/sztm/__init__.py +14 -0
- gbdtransformation/brands/sztm/filters.py +72 -0
- gbdtransformation/brands/sztm/schema +86 -0
- gbdtransformation/brands/sztm/template.yml +1 -0
- gbdtransformation/brands/sztm/tests/__init__.py +0 -0
- gbdtransformation/brands/thtm/__init__.py +2 -0
- gbdtransformation/brands/thtm/filters.py +86 -0
- gbdtransformation/brands/thtm/schema +86 -0
- gbdtransformation/brands/thtm/template.yml +175 -0
- gbdtransformation/brands/thtm/tests/__init__.py +0 -0
- gbdtransformation/brands/thtm/tests/test.xml +84 -0
- gbdtransformation/brands/tntm/__init__.py +16 -0
- gbdtransformation/brands/tntm/filters.py +89 -0
- gbdtransformation/brands/tntm/schema +87 -0
- gbdtransformation/brands/tntm/template.yml +1 -0
- gbdtransformation/brands/tntm/tests/__init__.py +0 -0
- gbdtransformation/brands/totm/__init__.py +5 -0
- gbdtransformation/brands/totm/filters.py +72 -0
- gbdtransformation/brands/totm/schema +86 -0
- gbdtransformation/brands/totm/template.yml +1 -0
- gbdtransformation/brands/totm/tests/__init__.py +0 -0
- gbdtransformation/brands/totm/tests/nofeature.xml +106 -0
- gbdtransformation/brands/totm/tests/syntax.xml +162 -0
- gbdtransformation/brands/totm/tests/test.xml +84 -0
- gbdtransformation/brands/tttm/__init__.py +17 -0
- gbdtransformation/brands/tttm/filters.py +79 -0
- gbdtransformation/brands/tttm/schema +87 -0
- gbdtransformation/brands/tttm/template.yml +1 -0
- gbdtransformation/brands/tttm/tests/__init__.py +0 -0
- gbdtransformation/brands/uatm/__init__.py +18 -0
- gbdtransformation/brands/uatm/filters.py +70 -0
- gbdtransformation/brands/uatm/schema +158 -0
- gbdtransformation/brands/uatm/template.yml +148 -0
- gbdtransformation/brands/ustm/__init__.py +187 -0
- gbdtransformation/brands/ustm/filters.py +227 -0
- gbdtransformation/brands/ustm/schema +2183 -0
- gbdtransformation/brands/ustm/template.yml +219 -0
- gbdtransformation/brands/uytm/__init__.py +3 -0
- gbdtransformation/brands/uytm/filters.py +64 -0
- gbdtransformation/brands/uytm/schema +106 -0
- gbdtransformation/brands/uytm/template.yml +137 -0
- gbdtransformation/brands/vctm/__init__.py +5 -0
- gbdtransformation/brands/vctm/filters.py +75 -0
- gbdtransformation/brands/vctm/schema +87 -0
- gbdtransformation/brands/vctm/template.yml +1 -0
- gbdtransformation/brands/vctm/tests/__init__.py +0 -0
- gbdtransformation/brands/vntm/__init__.py +9 -0
- gbdtransformation/brands/vntm/filters.py +84 -0
- gbdtransformation/brands/vntm/schema +86 -0
- gbdtransformation/brands/vntm/template.yml +1 -0
- gbdtransformation/brands/vntm/tests/__init__.py +0 -0
- gbdtransformation/brands/vutm/__init__.py +5 -0
- gbdtransformation/brands/vutm/filters.py +67 -0
- gbdtransformation/brands/vutm/schema +83 -0
- gbdtransformation/brands/vutm/template.yml +1 -0
- gbdtransformation/brands/vutm/tests/__init__.py +0 -0
- gbdtransformation/brands/whoinn/__init__.py +6 -0
- gbdtransformation/brands/whoinn/filters.py +46 -0
- gbdtransformation/brands/whoinn/schema +4 -0
- gbdtransformation/brands/whoinn/template.yml +45 -0
- gbdtransformation/brands/wo6ter/__init__.py +1 -0
- gbdtransformation/brands/wo6ter/filters.py +88 -0
- gbdtransformation/brands/wo6ter/template.yml +88 -0
- gbdtransformation/brands/woao/__init__.py +1 -0
- gbdtransformation/brands/woao/filters.py +107 -0
- gbdtransformation/brands/woao/schema +116 -0
- gbdtransformation/brands/woao/template.yml +90 -0
- gbdtransformation/brands/woptm/__init__.py +3 -0
- gbdtransformation/brands/woptm/filters.py +42 -0
- gbdtransformation/brands/woptm/template.yml +2 -0
- gbdtransformation/brands/wotm/__init__.py +3 -0
- gbdtransformation/brands/wotm/filters.py +127 -0
- gbdtransformation/brands/wotm/schema +218 -0
- gbdtransformation/brands/wotm/template.yml +220 -0
- gbdtransformation/brands/wstm/__init__.py +6 -0
- gbdtransformation/brands/wstm/filters.py +67 -0
- gbdtransformation/brands/wstm/schema +86 -0
- gbdtransformation/brands/wstm/template.yml +1 -0
- gbdtransformation/brands/wstm/tests/__init__.py +0 -0
- gbdtransformation/brands/wstm/tests/test.xml +132 -0
- gbdtransformation/brands/xxxx/__init__.py +6 -0
- gbdtransformation/brands/xxxx/filters.py +60 -0
- gbdtransformation/brands/xxxx/schema +4 -0
- gbdtransformation/brands/xxxx/template.yml +363 -0
- gbdtransformation/brands/zmtm/__init__.py +12 -0
- gbdtransformation/brands/zmtm/filters.py +79 -0
- gbdtransformation/brands/zmtm/schema +86 -0
- gbdtransformation/brands/zmtm/template.yml +1 -0
- gbdtransformation/brands/zmtm/tests/__init__.py +0 -0
- gbdtransformation/brands/zwtm/__init__.py +3 -0
- gbdtransformation/brands/zwtm/filters.py +86 -0
- gbdtransformation/brands/zwtm/schema +86 -0
- gbdtransformation/brands/zwtm/template.yml +1 -0
- gbdtransformation/brands/zwtm/tests/__init__.py +0 -0
- gbdtransformation/common/__init__.py +383 -0
- gbdtransformation/common/filters.py +418 -0
- gbdtransformation/common/jpap/__init__.py +1 -0
- gbdtransformation/common/jpap/filters.py +83 -0
- gbdtransformation/common/jpap/template.yml +37 -0
- gbdtransformation/common/jpbase/__init__.py +1 -0
- gbdtransformation/common/jpbase/filters.py +93 -0
- gbdtransformation/common/jpbase/template.yml +51 -0
- gbdtransformation/common/jprp/__init__.py +1 -0
- gbdtransformation/common/jprp/filters.py +86 -0
- gbdtransformation/common/jprp/template.yml +51 -0
- gbdtransformation/common/navigation.tmpl +12 -0
- gbdtransformation/commons/__init__.py +0 -0
- gbdtransformation/commons/emap/__init__.py +1 -0
- gbdtransformation/commons/emap/filters.py +16 -0
- gbdtransformation/commons/emap/template.yml +55 -0
- gbdtransformation/commons/emrp/__init__.py +1 -0
- gbdtransformation/commons/emrp/filters.py +14 -0
- gbdtransformation/commons/emrp/template.yml +53 -0
- gbdtransformation/commons/filters.py +3 -0
- gbdtransformation/designs/__init__.py +8 -0
- gbdtransformation/designs/alid/__init__.py +5 -0
- gbdtransformation/designs/alid/filters.py +69 -0
- gbdtransformation/designs/alid/schema +89 -0
- gbdtransformation/designs/alid/template.yml +1 -0
- gbdtransformation/designs/bnid/__init__.py +5 -0
- gbdtransformation/designs/bnid/filters.py +61 -0
- gbdtransformation/designs/bnid/schema +80 -0
- gbdtransformation/designs/bnid/template.yml +1 -0
- gbdtransformation/designs/bwid/__init__.py +6 -0
- gbdtransformation/designs/bwid/filters.py +64 -0
- gbdtransformation/designs/bwid/schema +101 -0
- gbdtransformation/designs/bwid/template.yml +1 -0
- gbdtransformation/designs/crid/__init__.py +5 -0
- gbdtransformation/designs/crid/filters.py +63 -0
- gbdtransformation/designs/crid/schema +94 -0
- gbdtransformation/designs/crid/template.yml +1 -0
- gbdtransformation/designs/cuid/__init__.py +5 -0
- gbdtransformation/designs/cuid/filters.py +60 -0
- gbdtransformation/designs/cuid/schema +98 -0
- gbdtransformation/designs/cuid/template.yml +1 -0
- gbdtransformation/designs/egid/__init__.py +5 -0
- gbdtransformation/designs/egid/filters.py +62 -0
- gbdtransformation/designs/egid/schema +82 -0
- gbdtransformation/designs/egid/template.yml +1 -0
- gbdtransformation/designs/filters.py +73 -0
- gbdtransformation/designs/idid/__init__.py +5 -0
- gbdtransformation/designs/idid/filters.py +67 -0
- gbdtransformation/designs/idid/schema +102 -0
- gbdtransformation/designs/idid/template.yml +1 -0
- gbdtransformation/designs/ipas/__init__.py +0 -0
- gbdtransformation/designs/ipas/filters.py +181 -0
- gbdtransformation/designs/ipas/template.yml +174 -0
- gbdtransformation/designs/joid/__init__.py +6 -0
- gbdtransformation/designs/joid/filters.py +62 -0
- gbdtransformation/designs/joid/schema +97 -0
- gbdtransformation/designs/joid/template.yml +1 -0
- gbdtransformation/designs/keid/__init__.py +5 -0
- gbdtransformation/designs/keid/filters.py +62 -0
- gbdtransformation/designs/keid/schema +99 -0
- gbdtransformation/designs/keid/template.yml +1 -0
- gbdtransformation/designs/khid/__init__.py +5 -0
- gbdtransformation/designs/khid/filters.py +63 -0
- gbdtransformation/designs/khid/schema +100 -0
- gbdtransformation/designs/khid/template.yml +1 -0
- gbdtransformation/designs/laid/__init__.py +5 -0
- gbdtransformation/designs/laid/filters.py +61 -0
- gbdtransformation/designs/laid/schema +94 -0
- gbdtransformation/designs/laid/template.yml +1 -0
- gbdtransformation/designs/mnid/__init__.py +6 -0
- gbdtransformation/designs/mnid/filters.py +62 -0
- gbdtransformation/designs/mnid/schema +98 -0
- gbdtransformation/designs/mnid/template.yml +1 -0
- gbdtransformation/designs/myid/__init__.py +5 -0
- gbdtransformation/designs/myid/filters.py +60 -0
- gbdtransformation/designs/myid/schema +95 -0
- gbdtransformation/designs/myid/template.yml +1 -0
- gbdtransformation/designs/phid/__init__.py +5 -0
- gbdtransformation/designs/phid/filters.py +70 -0
- gbdtransformation/designs/phid/schema +95 -0
- gbdtransformation/designs/phid/template.yml +1 -0
- gbdtransformation/designs/sgid/__init__.py +6 -0
- gbdtransformation/designs/sgid/filters.py +66 -0
- gbdtransformation/designs/sgid/schema +115 -0
- gbdtransformation/designs/sgid/template.yml +1 -0
- gbdtransformation/designs/thid/__init__.py +4 -0
- gbdtransformation/designs/thid/filters.py +64 -0
- gbdtransformation/designs/thid/schema +98 -0
- gbdtransformation/designs/thid/template.yml +1 -0
- gbdtransformation/designs/tnid/__init__.py +5 -0
- gbdtransformation/designs/tnid/filters.py +66 -0
- gbdtransformation/designs/tnid/schema +96 -0
- gbdtransformation/designs/tnid/template.yml +1 -0
- gbdtransformation/designs/vnid/__init__.py +5 -0
- gbdtransformation/designs/vnid/filters.py +62 -0
- gbdtransformation/designs/vnid/schema +97 -0
- gbdtransformation/designs/vnid/template.yml +1 -0
- gbdtransformation/designs/woid/__init__.py +2 -0
- gbdtransformation/designs/woid/filters.py +372 -0
- gbdtransformation/designs/woid/schema +592 -0
- gbdtransformation/designs/woid/template.yml +516 -0
- gbdtransformation/designs/xxid/__init__.py +2 -0
- gbdtransformation/designs/xxid/filters.py +60 -0
- gbdtransformation/designs/xxid/schema +4 -0
- gbdtransformation/designs/xxid/template.yml +358 -0
- gbdtransformation/execs-nico.py +709 -0
- gbdtransformation/execs.py +734 -0
- gbdtransformation/gbd-transform.exec.tgz +0 -0
- gbdtransformation/parser.py +190 -0
- gbdtransformation/renders.py +149 -0
- gbdtransformation/utilities/ISOCountryCodeType-V2006.xsd +1245 -0
- gbdtransformation/utilities/ISOCurrencyCodeType-V2001.xsd +855 -0
- gbdtransformation/utilities/ISOLanguageCodeType-V2002.xsd +715 -0
- gbdtransformation/utilities/WIPOST3CodeType-V2007.xsd +1151 -0
- gbdtransformation/utilities/__init__.py +0 -0
- gbdtransformation/utilities/st66.dot +2828 -0
- gbdtransformation/utilities/st66.pdf +0 -0
- gbdtransformation/utilities/st66.py +38700 -0
- gbdtransformation/utilities/st66.xsd +4174 -0
- schemas/ShazamConfig.py +35 -0
- schemas/__init__.py +0 -0
- schemas/schema_extractor.py +300 -0
- wipo_gbd_transformation-1.1.105.dist-info/LICENSE.md +687 -0
- wipo_gbd_transformation-1.1.105.dist-info/METADATA +25 -0
- wipo_gbd_transformation-1.1.105.dist-info/RECORD +607 -0
- wipo_gbd_transformation-1.1.105.dist-info/WHEEL +5 -0
- wipo_gbd_transformation-1.1.105.dist-info/entry_points.txt +6 -0
- wipo_gbd_transformation-1.1.105.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
import re
|
|
2
|
+
import time
|
|
3
|
+
import unicodedata
|
|
4
|
+
|
|
5
|
+
from yaml import dump
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
|
|
8
|
+
import boto3
|
|
9
|
+
try:
|
|
10
|
+
from yaml import CDumper as Dumper
|
|
11
|
+
except ImportError:
|
|
12
|
+
from yaml import Dumper
|
|
13
|
+
import os
|
|
14
|
+
try:
|
|
15
|
+
from polyglot.detect import Detector
|
|
16
|
+
except Exception as e:
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
from gbdtransformation.common import countries
|
|
20
|
+
|
|
21
|
+
def load_collection_package(type, collection):
|
|
22
|
+
module_pckg = __import__('gbdtransformation.%s.%s' % (type, collection),
|
|
23
|
+
globals(),
|
|
24
|
+
locals(),
|
|
25
|
+
[collection])
|
|
26
|
+
return module_pckg
|
|
27
|
+
|
|
28
|
+
def get_entity_from_db(value, collection, e_type, st13):
|
|
29
|
+
e_type = e_type[0:3].upper()
|
|
30
|
+
key = "%s.%s.%s" % (collection.lower(), e_type, value)
|
|
31
|
+
#dynamodb = boto3.resource('dynamodb',
|
|
32
|
+
# endpoint_url=os.environ.get('DYNAMO_DB'))
|
|
33
|
+
dynamodb = boto3.resource('dynamodb',
|
|
34
|
+
endpoint_url=os.environ.get('DYDB_URL'))
|
|
35
|
+
#dynamodb = boto3.resource('dynamodb',
|
|
36
|
+
# region_name="eu-west-1",
|
|
37
|
+
# aws_access_key_id='anything',
|
|
38
|
+
# aws_secret_access_key='anything',
|
|
39
|
+
# endpoint_url="http://localhost:8001")
|
|
40
|
+
table = dynamodb.Table('gbd_pypers_entity')
|
|
41
|
+
response = table.get_item(Key={
|
|
42
|
+
'entity_id': key}).get('Item', {})
|
|
43
|
+
if response:
|
|
44
|
+
linked = set(response['linked_items'])
|
|
45
|
+
linked.add(st13)
|
|
46
|
+
payload = response['payload']
|
|
47
|
+
# Updated the linked
|
|
48
|
+
retry = 0
|
|
49
|
+
while retry < 3:
|
|
50
|
+
try:
|
|
51
|
+
table.update_item(Key={'entity_id': key},
|
|
52
|
+
UpdateExpression='SET linked_items = :val1',
|
|
53
|
+
ExpressionAttributeValues={
|
|
54
|
+
':val1': list(linked)
|
|
55
|
+
})
|
|
56
|
+
break
|
|
57
|
+
except Exception as e:
|
|
58
|
+
time.sleep(0.2)
|
|
59
|
+
retry += 1
|
|
60
|
+
# Ignore applicant / representative root
|
|
61
|
+
payload = payload[list(payload.keys())[0]]
|
|
62
|
+
output = dump(payload, Dumper=Dumper)
|
|
63
|
+
first = True
|
|
64
|
+
new_output = []
|
|
65
|
+
# pepare the padding
|
|
66
|
+
for line in output.split('\n'):
|
|
67
|
+
if not first:
|
|
68
|
+
line = ' %s' % line
|
|
69
|
+
first = False
|
|
70
|
+
new_output.append(line)
|
|
71
|
+
output = '\n'.join(new_output)
|
|
72
|
+
return output
|
|
73
|
+
return None
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def to_str(input):
|
|
77
|
+
return str(input)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
# split goods and services terms
|
|
81
|
+
def split_terms(data, separator=';'):
|
|
82
|
+
""" Splits text base on seprator"""
|
|
83
|
+
if not data:
|
|
84
|
+
return []
|
|
85
|
+
elif hasattr(data, '__value'): data = data.__value
|
|
86
|
+
|
|
87
|
+
if not data:
|
|
88
|
+
return []
|
|
89
|
+
terms = []
|
|
90
|
+
if type(data) == list:
|
|
91
|
+
for d in data:
|
|
92
|
+
tmp = [str(x).strip() for x in d.split(separator) if str(x).strip()]
|
|
93
|
+
tmp = [x for x in tmp if x != 'true' and x != 'false']
|
|
94
|
+
terms.extend(tmp)
|
|
95
|
+
else:
|
|
96
|
+
terms = [str(x).strip() for x in data.split(separator) if str(x).strip()]
|
|
97
|
+
terms = [x for x in terms if x != 'true' and x != 'false']
|
|
98
|
+
return terms
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def convertdate(date, input_format=None, output_format="%Y-%m-%d"):
|
|
102
|
+
"""Date convertor from input_format to output_format"""
|
|
103
|
+
if not date:
|
|
104
|
+
return None
|
|
105
|
+
try:
|
|
106
|
+
return datetime.strptime(date, input_format).strftime(output_format)
|
|
107
|
+
except ValueError:
|
|
108
|
+
# TODO - go back one day
|
|
109
|
+
# example from detm
|
|
110
|
+
# while True:
|
|
111
|
+
# try:
|
|
112
|
+
# edate = datetime(edate.year, fdate.month, fdate.day)
|
|
113
|
+
# break
|
|
114
|
+
# except:
|
|
115
|
+
# fdate = fdate + relativedelta(days=-1)
|
|
116
|
+
# removing invalid dates
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
# expand multi-national applications
|
|
121
|
+
def expand_territories(territory, applicationDate):
|
|
122
|
+
if territory.upper() == 'EM':
|
|
123
|
+
territories = [ 'EM', 'AT', 'BE', 'BG', 'HR',
|
|
124
|
+
'CY', 'CZ', 'DK', 'EE', 'FI',
|
|
125
|
+
'FR', 'DE', 'GR', 'HU', 'IE',
|
|
126
|
+
'IT', 'LV', 'LT', 'LU', 'MT',
|
|
127
|
+
'NL', 'PL', 'PT', 'RO', 'SK',
|
|
128
|
+
'SI', 'ES', 'SE' ]
|
|
129
|
+
# BREXIT date
|
|
130
|
+
if applicationDate < '2020-01-31':
|
|
131
|
+
territories.append('GB')
|
|
132
|
+
|
|
133
|
+
return territories
|
|
134
|
+
else:
|
|
135
|
+
return [ territory.upper() ]
|
|
136
|
+
|
|
137
|
+
def replace_quotes(data, replace=""):
|
|
138
|
+
"""Remove quotes from strings"""
|
|
139
|
+
if(isinstance(data, str)):
|
|
140
|
+
return data.replace('"', replace).replace(':', ':')
|
|
141
|
+
elif hasattr(data, '__value'):
|
|
142
|
+
return replace_quotes(data.__value)
|
|
143
|
+
|
|
144
|
+
return None
|
|
145
|
+
|
|
146
|
+
def remove_tab(data):
|
|
147
|
+
"""Remove carriage returns"""
|
|
148
|
+
if(isinstance(data, str)):
|
|
149
|
+
return data.replace('\t', ' ')
|
|
150
|
+
elif hasattr(data, '__value'):
|
|
151
|
+
return remove_tab(data.__value)
|
|
152
|
+
|
|
153
|
+
return None
|
|
154
|
+
|
|
155
|
+
def remove_cr(data):
|
|
156
|
+
"""Remove carriage returns"""
|
|
157
|
+
if(isinstance(data, str)):
|
|
158
|
+
return data.replace('\n', '')
|
|
159
|
+
elif hasattr(data, '__value'):
|
|
160
|
+
return remove_cr(data.__value)
|
|
161
|
+
|
|
162
|
+
return None
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def get_true_or_false(data):
|
|
166
|
+
"""Converts None to False, false to False and data to True"""
|
|
167
|
+
if not data:
|
|
168
|
+
return False
|
|
169
|
+
elif isinstance(data, str):
|
|
170
|
+
data = data.lower()
|
|
171
|
+
if data == 'false': return False
|
|
172
|
+
if data == 'n':
|
|
173
|
+
return False
|
|
174
|
+
|
|
175
|
+
return True
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def append(value, *suf):
|
|
179
|
+
if not value: return ''
|
|
180
|
+
|
|
181
|
+
for s in suf:
|
|
182
|
+
if s:
|
|
183
|
+
value = '%s%s' % (value, s)
|
|
184
|
+
|
|
185
|
+
return value
|
|
186
|
+
|
|
187
|
+
def contains(text, value):
|
|
188
|
+
try:
|
|
189
|
+
text.lower().index(value.lower())
|
|
190
|
+
return True
|
|
191
|
+
except:
|
|
192
|
+
return False
|
|
193
|
+
|
|
194
|
+
def remove_leading(value, *chars):
|
|
195
|
+
if not value:
|
|
196
|
+
return None
|
|
197
|
+
for char in chars:
|
|
198
|
+
if value[0:1] == char:
|
|
199
|
+
value = value[1:]
|
|
200
|
+
return(remove_leading(value, *chars))
|
|
201
|
+
return value
|
|
202
|
+
|
|
203
|
+
def remove_trailing(value, *chars):
|
|
204
|
+
if not value:
|
|
205
|
+
return None
|
|
206
|
+
if isinstance(value, list):
|
|
207
|
+
return [remove_trailing(v, chars) for v in value]
|
|
208
|
+
if hasattr(value, '__value'):
|
|
209
|
+
value = value.__value
|
|
210
|
+
if not value:
|
|
211
|
+
return None
|
|
212
|
+
|
|
213
|
+
for char in chars:
|
|
214
|
+
if value.endswith(char):
|
|
215
|
+
value = value[:-1]
|
|
216
|
+
return(remove_trailing(value, *chars))
|
|
217
|
+
return value
|
|
218
|
+
|
|
219
|
+
# remove special characters
|
|
220
|
+
def remove_special(val):
|
|
221
|
+
special_chars = re.compile(r'\W')
|
|
222
|
+
val = special_chars.sub('', val)
|
|
223
|
+
return val
|
|
224
|
+
|
|
225
|
+
# remove non-numeric
|
|
226
|
+
def remove_non_numeric(val):
|
|
227
|
+
non_numeric = re.compile(r'\D')
|
|
228
|
+
val = non_numeric.sub('', val)
|
|
229
|
+
return val
|
|
230
|
+
|
|
231
|
+
# some collections need to split brand name by language
|
|
232
|
+
def guess_brand_language(value, lang=None, default=None, opts=[]):
|
|
233
|
+
return guess_language(value, lang=lang, default=default, opts=opts)
|
|
234
|
+
|
|
235
|
+
def guess_language(value, lang=None, default=None, opts=[]):
|
|
236
|
+
"""
|
|
237
|
+
sudo apt-get install python-numpy libicu-dev
|
|
238
|
+
pip install -U git+https://github.com/aboSamoor/polyglot.git@master
|
|
239
|
+
"""
|
|
240
|
+
if not value: return None
|
|
241
|
+
|
|
242
|
+
if isinstance(value, list):
|
|
243
|
+
value = value[0]
|
|
244
|
+
|
|
245
|
+
if hasattr(value, '__value'):
|
|
246
|
+
value = value['__value']
|
|
247
|
+
if not value: return None
|
|
248
|
+
|
|
249
|
+
value = value.strip()
|
|
250
|
+
if not value: return None
|
|
251
|
+
|
|
252
|
+
if lang: return lang.lower()
|
|
253
|
+
|
|
254
|
+
if is_latin(value):
|
|
255
|
+
if default: return default
|
|
256
|
+
else: return 'la'
|
|
257
|
+
|
|
258
|
+
try:
|
|
259
|
+
lang = Detector(value, quiet=True).languages[0]
|
|
260
|
+
lang_code = lang.code.lower()
|
|
261
|
+
|
|
262
|
+
# manual corrections of lang detection mistakes
|
|
263
|
+
# bof !
|
|
264
|
+
if lang_code == 'tg': lang_code = 'uk'
|
|
265
|
+
|
|
266
|
+
if lang_code != 'un':
|
|
267
|
+
if len(opts):
|
|
268
|
+
if lang_code in opts:
|
|
269
|
+
return lang_code
|
|
270
|
+
else:
|
|
271
|
+
return lang_code
|
|
272
|
+
except Exception as e:
|
|
273
|
+
pass
|
|
274
|
+
|
|
275
|
+
if default:
|
|
276
|
+
return default.lower()
|
|
277
|
+
else:
|
|
278
|
+
return None
|
|
279
|
+
|
|
280
|
+
def is_latin(s):
|
|
281
|
+
try:
|
|
282
|
+
s.encode(encoding='utf-8').decode('ascii')
|
|
283
|
+
except UnicodeDecodeError:
|
|
284
|
+
return False
|
|
285
|
+
|
|
286
|
+
return True
|
|
287
|
+
|
|
288
|
+
def country_name2code(name):
|
|
289
|
+
if not name:
|
|
290
|
+
return None
|
|
291
|
+
|
|
292
|
+
name = name.strip().lower()
|
|
293
|
+
for code, country in countries.items():
|
|
294
|
+
if isinstance(country, list):
|
|
295
|
+
for syn in country:
|
|
296
|
+
if syn.lower() == name:
|
|
297
|
+
return code
|
|
298
|
+
else:
|
|
299
|
+
if country.lower() == name:
|
|
300
|
+
return code
|
|
301
|
+
return None
|
|
302
|
+
#raise Exception('[%s] country name is not mapped' % name)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def address_line2country_code(addr):
|
|
307
|
+
items = [a.strip() for a in addr.split(',')]
|
|
308
|
+
maybe_country_name = items[-1]
|
|
309
|
+
|
|
310
|
+
return country_name2code(maybe_country_name)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
# -----------------------
|
|
314
|
+
# internal engine helpers
|
|
315
|
+
# -----------------------
|
|
316
|
+
|
|
317
|
+
def first(value):
|
|
318
|
+
if isinstance(value, list):
|
|
319
|
+
return value[0]
|
|
320
|
+
return value
|
|
321
|
+
|
|
322
|
+
def last(value):
|
|
323
|
+
if isinstance(value, list):
|
|
324
|
+
return value[-1]
|
|
325
|
+
return value
|
|
326
|
+
|
|
327
|
+
def has_value(elem):
|
|
328
|
+
if not elem: return False
|
|
329
|
+
if not isinstance(elem, list):
|
|
330
|
+
elem = [elem]
|
|
331
|
+
|
|
332
|
+
for item in elem:
|
|
333
|
+
if hasattr(item, '__value'):
|
|
334
|
+
text = item.__value or ''
|
|
335
|
+
else:
|
|
336
|
+
text = item or ''
|
|
337
|
+
|
|
338
|
+
# remove emptyspaces, '.' & '-' and see
|
|
339
|
+
# if anything else is left
|
|
340
|
+
text = re.sub(r'[-,\.\s]', '', text)
|
|
341
|
+
|
|
342
|
+
if len(text): return True
|
|
343
|
+
|
|
344
|
+
return False
|
|
345
|
+
|
|
346
|
+
def get_value(elem):
|
|
347
|
+
if hasattr(elem, '__value'):
|
|
348
|
+
text = elem.__value or ''
|
|
349
|
+
else:
|
|
350
|
+
text = elem or ''
|
|
351
|
+
|
|
352
|
+
return text
|
|
353
|
+
|
|
354
|
+
def remove_numerics(text):
|
|
355
|
+
|
|
356
|
+
if hasattr(text, '__value'):
|
|
357
|
+
text = text.__value or ''
|
|
358
|
+
else:
|
|
359
|
+
text = text or ''
|
|
360
|
+
|
|
361
|
+
# remove emptyspaces, '.' & '-' and see
|
|
362
|
+
# if anything else is left
|
|
363
|
+
text = re.sub(r'[0-9]', '', text)
|
|
364
|
+
|
|
365
|
+
return text
|
|
366
|
+
|
|
367
|
+
def field_name(value):
|
|
368
|
+
"""
|
|
369
|
+
a place holder to identify field names
|
|
370
|
+
in order to suppress the automatic
|
|
371
|
+
yaml_filter
|
|
372
|
+
"""
|
|
373
|
+
return value
|
|
374
|
+
|
|
375
|
+
def matchpath(scope, path):
|
|
376
|
+
match = []
|
|
377
|
+
path_parts = path.split('.')
|
|
378
|
+
|
|
379
|
+
while(len(path_parts)):
|
|
380
|
+
part = path_parts.pop(0)
|
|
381
|
+
if(hasattr(scope, part) or (isinstance(scope, dict) and part in scope.keys())):
|
|
382
|
+
match = scope[part]
|
|
383
|
+
scope = match
|
|
384
|
+
else:
|
|
385
|
+
return []
|
|
386
|
+
if not isinstance(match, list):
|
|
387
|
+
return [match]
|
|
388
|
+
else:
|
|
389
|
+
return match
|
|
390
|
+
|
|
391
|
+
def yaml_filter(root):
|
|
392
|
+
if hasattr(root, '__value'):
|
|
393
|
+
return yaml_filter(root.__value)
|
|
394
|
+
if isinstance(root, bool):
|
|
395
|
+
return root
|
|
396
|
+
if isinstance(root, str):
|
|
397
|
+
if root.lower() in ['true', 'false']:
|
|
398
|
+
return bool(root)
|
|
399
|
+
root = root.replace('\\', '\\\\')
|
|
400
|
+
root = root.replace('"', '\\"')
|
|
401
|
+
root = '"%s"' % root
|
|
402
|
+
return root
|
|
403
|
+
|
|
404
|
+
def try_to_8bit(value):
|
|
405
|
+
if not value: return ''
|
|
406
|
+
value = str(value)
|
|
407
|
+
return unicodedata.normalize('NFKC', value)
|
|
408
|
+
|
|
409
|
+
def my_print(value):
|
|
410
|
+
print("++++++++++++")
|
|
411
|
+
print(value)
|
|
412
|
+
print("++++++++++++ %s" % len(value))
|
|
413
|
+
return value
|
|
414
|
+
|
|
415
|
+
def clean_number(number):
|
|
416
|
+
# very basic cleaning of number
|
|
417
|
+
return number.replace(" ", "")
|
|
418
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
render = 'YAML'
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import math
|
|
2
|
+
from pandas import Series
|
|
3
|
+
|
|
4
|
+
def first(series):
|
|
5
|
+
if isinstance(series, str) or isinstance(series, int) or isinstance(series, float):
|
|
6
|
+
return series
|
|
7
|
+
if series.empty:
|
|
8
|
+
return None
|
|
9
|
+
if len(series.to_list()) > 0:
|
|
10
|
+
return series.to_list()[0]
|
|
11
|
+
return None
|
|
12
|
+
|
|
13
|
+
jptm_rep_types = {
|
|
14
|
+
"0": "No Representative",
|
|
15
|
+
"1": "Representative",
|
|
16
|
+
"2": "Acting representative",
|
|
17
|
+
"3": "Designated representative",
|
|
18
|
+
"4": "Legal representative",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
jptm_status_country = {
|
|
22
|
+
"1": "Domestic registration", # LIVE registered?
|
|
23
|
+
"2": "Domestic application", # LIVE Pending ?
|
|
24
|
+
"3": "International registration", # LIVE Registered ?
|
|
25
|
+
"A": "Domestic registration", # DEAD Ended
|
|
26
|
+
"B": "Domestic registration", # DEAD Ended
|
|
27
|
+
"C": "International registration", # DEAD Ended
|
|
28
|
+
"None": "Unknown"}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def representative_type(rep_typ_code):
|
|
32
|
+
if isinstance(rep_typ_code, float) and math.isnan(rep_typ_code):
|
|
33
|
+
return
|
|
34
|
+
return jptm_rep_types[str(int(rep_typ_code))]
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
jptm_status_gbd = {
|
|
38
|
+
"1": "Registered",
|
|
39
|
+
"2": "Pending", # ??
|
|
40
|
+
"3": "Registered",
|
|
41
|
+
"A": "Ended", # ??
|
|
42
|
+
"B": "Ended", # ??
|
|
43
|
+
"C": "Ended", # ??
|
|
44
|
+
"None": "Unknown"
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def status_office(status):
|
|
49
|
+
code = first(status)
|
|
50
|
+
return jptm_status_country[str(code)]
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def status_gbd(status):
|
|
54
|
+
code = first(status)
|
|
55
|
+
return jptm_status_gbd[str(code)]
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
features = {
|
|
59
|
+
"0": "Not a special trademark",
|
|
60
|
+
"1": "Three dimensional",
|
|
61
|
+
"2": "Sound",
|
|
62
|
+
"3": "Motion",
|
|
63
|
+
"4": "Hologram",
|
|
64
|
+
"5": "Colour", # It is an application of a trademark consisting only of colors
|
|
65
|
+
"6": "Position",
|
|
66
|
+
"9": "Other",
|
|
67
|
+
'': "Undefined" }
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def make_feature(feature_code):
|
|
71
|
+
# print("Make Feature [", feature_code, "]", type(feature_code))
|
|
72
|
+
if feature_code is None:
|
|
73
|
+
return 'Undefined'
|
|
74
|
+
if isinstance(feature_code, bool):
|
|
75
|
+
return 'Undefined'
|
|
76
|
+
if isinstance(feature_code, Series) and feature_code.empty():
|
|
77
|
+
return 'Undefined'
|
|
78
|
+
if isinstance(feature_code, float) and math.isnan(feature_code):
|
|
79
|
+
return 'Undefined'
|
|
80
|
+
if isinstance(feature_code, float):
|
|
81
|
+
feature_code = int(feature_code)
|
|
82
|
+
|
|
83
|
+
return features[str(feature_code)]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
applicationNumber: {{tm.master.shutugan_no|first}}
|
|
2
|
+
applicationDate: {{tm.master.shutugan_bi|first|to_str|convertdate('%Y%m%d') }}
|
|
3
|
+
|
|
4
|
+
markFeature: {{ tm.master.rittaishohyo_umu |first| make_feature }}
|
|
5
|
+
|
|
6
|
+
{% if tm.goods.size > 0 %}
|
|
7
|
+
goodsServicesClassification:
|
|
8
|
+
class:
|
|
9
|
+
{% for g in tm.goods.itertuples() %}
|
|
10
|
+
- code: {{ g.rui | int }}
|
|
11
|
+
term:
|
|
12
|
+
{% for term in g.shohinekimumeisho|to_str|split_terms(',') %}
|
|
13
|
+
- {{ term }}
|
|
14
|
+
{% endfor %}
|
|
15
|
+
{% endfor %}
|
|
16
|
+
{% endif %}
|
|
17
|
+
|
|
18
|
+
{% if tm.prio.size > 0 %}
|
|
19
|
+
priorities:
|
|
20
|
+
{% for p in tm.prio.itertuples() %}
|
|
21
|
+
- countryCode: {{ p.yusenkenkuni_code |first}}
|
|
22
|
+
number: {{ p.yusenkenshutugan_no | first }}
|
|
23
|
+
date: {{ p.yusenkenshucho_bi|first}}
|
|
24
|
+
{% endfor %}
|
|
25
|
+
{% endif %}
|
|
26
|
+
|
|
27
|
+
{% if tm.reps.size > 0 %}
|
|
28
|
+
representatives:
|
|
29
|
+
{% for rep in tm.reps.itertuples() %}
|
|
30
|
+
- identifier: {{rep.shutugannindairinin_code | int}}
|
|
31
|
+
fullName: {{ rep.rep.shutugannindairinin_simei | try_to_8bit}}
|
|
32
|
+
fullAddress: {{ rep.shutugannindairinin_jusho | try_to_8bit}}
|
|
33
|
+
{%endfor %}
|
|
34
|
+
{% endif %}
|
|
35
|
+
|
|
36
|
+
extra:
|
|
37
|
+
divisionNumber: {{tm.master.split_num|first}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
render = 'YAML'
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import math
|
|
2
|
+
from pandas import Series
|
|
3
|
+
|
|
4
|
+
def first(series):
|
|
5
|
+
if isinstance(series, str) or isinstance(series, int) or isinstance(series, float):
|
|
6
|
+
return series
|
|
7
|
+
if series.empty:
|
|
8
|
+
return None
|
|
9
|
+
if len(series.to_list()) > 0:
|
|
10
|
+
return series.to_list()[0]
|
|
11
|
+
return None
|
|
12
|
+
|
|
13
|
+
def translate_kind(kind):
|
|
14
|
+
if kind == '1': return 'Collective'
|
|
15
|
+
return 'Individual'
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
jptm_rep_types = {
|
|
19
|
+
"0": "No Representative",
|
|
20
|
+
"1": "Representative",
|
|
21
|
+
"2": "Acting representative",
|
|
22
|
+
"3": "Designated representative",
|
|
23
|
+
"4": "Legal representative",
|
|
24
|
+
"None": "Unknown",
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
jptm_status_country = {
|
|
28
|
+
"1": "Domestic registration", # LIVE registered?
|
|
29
|
+
"2": "Domestic application", # LIVE Pending ?
|
|
30
|
+
"3": "International registration", # LIVE Registered ?
|
|
31
|
+
"A": "Domestic registration deletion case", # DEAD Ended
|
|
32
|
+
"B": "Domestic application deletion case", # DEAD Ended
|
|
33
|
+
"C": "International registration deletion case", # DEAD Ended
|
|
34
|
+
"None": "Unknown"}
|
|
35
|
+
|
|
36
|
+
# TODO
|
|
37
|
+
def is_international():
|
|
38
|
+
return False
|
|
39
|
+
|
|
40
|
+
def representative_type(rep_typ_code):
|
|
41
|
+
if isinstance(rep_typ_code, float) and math.isnan(rep_typ_code):
|
|
42
|
+
return
|
|
43
|
+
return jptm_rep_types[str(int(rep_typ_code))]
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
jptm_status_gbd = {
|
|
47
|
+
"1": "Registered",
|
|
48
|
+
"2": "Pending", # ??
|
|
49
|
+
"3": "Registered",
|
|
50
|
+
"A": "Delete", # ??
|
|
51
|
+
"B": "Delete", # ??
|
|
52
|
+
"C": "Delete", # ??
|
|
53
|
+
"None": "Unknown"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def status_office(status):
|
|
58
|
+
code = first(status)
|
|
59
|
+
return jptm_status_country[str(code)]
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def status_gbd(status):
|
|
64
|
+
code = first(status)
|
|
65
|
+
return jptm_status_gbd[str(code)]
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
features = {
|
|
69
|
+
"0": "Not a special trademark",
|
|
70
|
+
"1": "Three dimensional",
|
|
71
|
+
"2": "Sound",
|
|
72
|
+
"3": "Motion",
|
|
73
|
+
"4": "Hologram",
|
|
74
|
+
"5": "Colour",
|
|
75
|
+
"6": "Position",
|
|
76
|
+
"9": "Other",
|
|
77
|
+
"": "Undefined",
|
|
78
|
+
"None": "Undefined"}
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def make_feature(feature_code):
|
|
82
|
+
if feature_code is None:
|
|
83
|
+
return 'Undefined'
|
|
84
|
+
if isinstance(feature_code, bool):
|
|
85
|
+
return 'Undefined'
|
|
86
|
+
if isinstance(feature_code, Series) and feature_code.empty():
|
|
87
|
+
return 'Undefined'
|
|
88
|
+
if isinstance(feature_code, float) and math.isnan(feature_code):
|
|
89
|
+
return 'Undefined'
|
|
90
|
+
if isinstance(feature_code, float):
|
|
91
|
+
feature_code = int(feature_code)
|
|
92
|
+
|
|
93
|
+
return features[str(feature_code)]
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
kind: {{tm.base.app_typ_group|first|to_str|translate_kind}}
|
|
2
|
+
applicationNumber: {{tm.base.app_num|first}}
|
|
3
|
+
applicationDate: {{tm.base.app_dt|first|to_str|convertdate('%Y%m%d') }}
|
|
4
|
+
|
|
5
|
+
registrationNumber: {{tm.base.reg_num|first}}
|
|
6
|
+
registrationDate: {{tm.base.set_reg_dt|first|to_str|convertdate('%Y%m%d')}}
|
|
7
|
+
|
|
8
|
+
expiryDate: {{ tm.base.conti_prd_expire_dt|first|to_str|convertdate('%Y%m%d') }}
|
|
9
|
+
|
|
10
|
+
officeStatus: {{tm.base.rec_status_id|status_office}}
|
|
11
|
+
gbdStatus: {{tm.base.rec_status_id|status_gbd}}
|
|
12
|
+
|
|
13
|
+
statusDate: {{tm.base.rec_latest_updt_dt|first|to_str|convertdate('%Y%m%d') }}
|
|
14
|
+
|
|
15
|
+
reference:
|
|
16
|
+
{% if not tm.base.intl_reg_num|first|to_str == '0' %}
|
|
17
|
+
office: WO
|
|
18
|
+
registration:
|
|
19
|
+
- number: {{ tm.base.intl_reg_num|first|to_str }}
|
|
20
|
+
date: {{ tm.base.intl_reg_dt|first|to_str|convertdate('%Y%m%d') }}
|
|
21
|
+
{% endif %}
|
|
22
|
+
|
|
23
|
+
wordMarkSpecification:
|
|
24
|
+
{% if tm.txt_std_char.size > 0 %}
|
|
25
|
+
markVerbalElement:
|
|
26
|
+
{% for t in tm.txt_std_char.itertuples() %}
|
|
27
|
+
- {{ t.standard_char_t | try_to_8bit }}
|
|
28
|
+
{% endfor %}
|
|
29
|
+
{% endif %}
|
|
30
|
+
|
|
31
|
+
{% if tm.txt_search.size > 0 %}
|
|
32
|
+
markSignificantVerbalElement:
|
|
33
|
+
{% for t in tm.txt_search.itertuples() %}
|
|
34
|
+
- {{t.search_use_t | try_to_8bit }}
|
|
35
|
+
{% endfor %}
|
|
36
|
+
{% endif %}
|
|
37
|
+
|
|
38
|
+
{% if tm.txt_transliteration.size > 0 %}
|
|
39
|
+
markTransliteration:
|
|
40
|
+
{% for t in tm.txt_transliteration.itertuples() %}
|
|
41
|
+
- {{ t.dsgnt }}
|
|
42
|
+
{% endfor %}
|
|
43
|
+
{% endif %}
|
|
44
|
+
|
|
45
|
+
{% if tm.vienna.size > 0 %}
|
|
46
|
+
markImageDetails:
|
|
47
|
+
class:
|
|
48
|
+
{% for v in tm.vienna.itertuples() %}
|
|
49
|
+
- {{'%02d' % v.grphc_term_large_class }}.{{ '%02d' % v.grphc_term_mid_class}}.{{'%02d' % v.grphc_term_small_class}}
|
|
50
|
+
{% endfor %}
|
|
51
|
+
{% endif %}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
render = 'YAML'
|