kernpy 1.0.2__py3-none-any.whl → 1.0.3__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.
@@ -24,8 +24,11 @@ class BasicSpineImporter(SpineImporter):
24
24
  def import_token(self, encoding: str) -> Token:
25
25
  self._raise_error_if_wrong_input(encoding)
26
26
 
27
- kern_spine_importer = KernSpineImporter()
28
- token = kern_spine_importer.import_token(encoding)
27
+ try:
28
+ kern_spine_importer = KernSpineImporter()
29
+ token = kern_spine_importer.import_token(encoding)
30
+ except Exception as e:
31
+ return SimpleToken(encoding, TokenCategory.OTHER)
29
32
 
30
33
  ACCEPTED_CATEGORIES = {
31
34
  TokenCategory.STRUCTURAL,
@@ -23,8 +23,11 @@ class DynamSpineImporter(SpineImporter):
23
23
  def import_token(self, encoding: str) -> Token:
24
24
  self._raise_error_if_wrong_input(encoding)
25
25
 
26
- kern_spine_importer = KernSpineImporter()
27
- token = kern_spine_importer.import_token(encoding)
26
+ try:
27
+ kern_spine_importer = KernSpineImporter()
28
+ token = kern_spine_importer.import_token(encoding)
29
+ except Exception as e:
30
+ return SimpleToken(encoding, TokenCategory.DYNAMICS)
28
31
 
29
32
  ACCEPTED_CATEGORIES = {
30
33
  TokenCategory.STRUCTURAL,
@@ -24,8 +24,11 @@ class FingSpineImporter(SpineImporter):
24
24
  def import_token(self, encoding: str) -> Token:
25
25
  self._raise_error_if_wrong_input(encoding)
26
26
 
27
- kern_spine_importer = KernSpineImporter()
28
- token = kern_spine_importer.import_token(encoding)
27
+ try:
28
+ kern_spine_importer = KernSpineImporter()
29
+ token = kern_spine_importer.import_token(encoding)
30
+ except Exception as e:
31
+ return SimpleToken(encoding, TokenCategory.FINGERING)
29
32
 
30
33
  ACCEPTED_CATEGORIES = {
31
34
  TokenCategory.STRUCTURAL,
@@ -23,8 +23,11 @@ class HarmSpineImporter(SpineImporter):
23
23
  def import_token(self, encoding: str) -> Token:
24
24
  self._raise_error_if_wrong_input(encoding)
25
25
 
26
- kern_spine_importer = KernSpineImporter()
27
- token = kern_spine_importer.import_token(encoding)
26
+ try:
27
+ kern_spine_importer = KernSpineImporter()
28
+ token = kern_spine_importer.import_token(encoding)
29
+ except Exception as e:
30
+ return SimpleToken(encoding, TokenCategory.HARMONY)
28
31
 
29
32
  ACCEPTED_CATEGORIES = {
30
33
  TokenCategory.STRUCTURAL,
@@ -4,7 +4,7 @@ from typing import Optional
4
4
  from .kern_spine_importer import KernSpineListener, KernSpineImporter
5
5
  from .base_antlr_spine_parser_listener import BaseANTLRSpineParserListener
6
6
  from .spine_importer import SpineImporter
7
- from .tokens import MHXMToken, Token, TokenCategory
7
+ from .tokens import MHXMToken, Token, TokenCategory, SimpleToken
8
8
 
9
9
 
10
10
  class MxhmSpineImporter(SpineImporter):
@@ -23,8 +23,11 @@ class MxhmSpineImporter(SpineImporter):
23
23
  def import_token(self, encoding: str) -> Token:
24
24
  self._raise_error_if_wrong_input(encoding)
25
25
 
26
- kern_spine_importer = KernSpineImporter()
27
- token = kern_spine_importer.import_token(encoding)
26
+ try:
27
+ kern_spine_importer = KernSpineImporter()
28
+ token = kern_spine_importer.import_token(encoding)
29
+ except Exception as e:
30
+ return SimpleToken(encoding, TokenCategory.HARMONY)
28
31
 
29
32
  ACCEPTED_CATEGORIES = {
30
33
  TokenCategory.STRUCTURAL,
@@ -39,6 +42,3 @@ class MxhmSpineImporter(SpineImporter):
39
42
  return SimpleToken(encoding, TokenCategory.HARMONY)
40
43
 
41
44
  return token
42
-
43
- return MHXMToken(encoding)
44
-
@@ -24,8 +24,11 @@ class TextSpineImporter(SpineImporter):
24
24
  def import_token(self, encoding: str) -> Token:
25
25
  self._raise_error_if_wrong_input(encoding)
26
26
 
27
- kern_spine_importer = KernSpineImporter()
28
- token = kern_spine_importer.import_token(encoding)
27
+ try:
28
+ kern_spine_importer = KernSpineImporter()
29
+ token = kern_spine_importer.import_token(encoding)
30
+ except Exception as e:
31
+ return SimpleToken(encoding, TokenCategory.LYRICS)
29
32
 
30
33
  ACCEPTED_CATEGORIES = {
31
34
  TokenCategory.STRUCTURAL,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kernpy
3
- Version: 1.0.2
3
+ Version: 1.0.3
4
4
  Summary: Python Humdrum **kern and **mens utilities
5
5
  Project-URL: Homepage, https://github.com/OMR-PRAIG-UA-ES/kernpy
6
6
  Project-URL: Documentation, https://github.com/OMR-PRAIG-UA-ES/kernpy#readme
@@ -190,6 +190,8 @@ Select the proper Humdrum **kern encoding:
190
190
  |----------|--------------|----------------------------------------|
191
191
  | kern | 2.bb-_L | Traditional Humdrum **kern encoding |
192
192
  | ekern | 2@.@bb@-·_·L | Extended Humdrum **kern encoding |
193
+ | bkern | 2.bb- | Basic Humdrum **kern encoding |
194
+ | bekern | 2@.@bb@- | Basic Extended Humdrum **kern encoding |
193
195
 
194
196
  Use the `Encoding` enum class to select the encoding:
195
197
 
@@ -200,6 +202,8 @@ doc, _ = kp.load('resource_dir/legacy/chor048.krn')
200
202
 
201
203
  kern_content = kp.dumps(doc, encoding=kp.Encoding.normalizedKern)
202
204
  ekern_content = kp.dumps(doc, encoding=kp.Encoding.eKern)
205
+ bkern_content = kp.dumps(doc, encoding=kp.KernTypeExporter.bKern)
206
+ bekern_content = kp.dumps(doc, encoding=kp.KernTypeExporter.bEkern)
203
207
  ```
204
208
 
205
209
  - Use `from_measure` and `to_measure` to select the measures to export. By default, all the measures are exported.
@@ -6,27 +6,27 @@ kernpy/core/__init__.py,sha256=gIbOKMWcPcQc4c6QpslWnAw9XkcMJ6OvedHANyDABbs,2581
6
6
  kernpy/core/_io.py,sha256=WqH30iDjfzGRCIzlqrAE9Oi_nfyleUpp8xGK8xZPh_w,1208
7
7
  kernpy/core/base_antlr_importer.py,sha256=2pPJ7sdWWCBU9Vw2ZAx-j-674DlSp82ajapeex-pF2I,1475
8
8
  kernpy/core/base_antlr_spine_parser_listener.py,sha256=HqKYACgzdiIc1fAoSaiLzfogkv7pAuiqUHlIRF8c--c,9837
9
- kernpy/core/basic_spine_importer.py,sha256=aYceG5wxlm7qTrd0KTR6-P4v4VVlYYPEe8omd3vmC0I,1523
9
+ kernpy/core/basic_spine_importer.py,sha256=NMVyjK6B8qGDzU8inW8IJO1vc1s-TuZ-P-RbXWMTdIQ,1637
10
10
  kernpy/core/document.py,sha256=Y_Wpwc-t1GkaGr2QVU0hqLRFJv9wJ_Nm6UitgwAlT8w,34892
11
11
  kernpy/core/dyn_importer.py,sha256=dKgZqVIdEELUu8HY63ClLJAMQXXItjHmaYxxOwFZRiY,1025
12
- kernpy/core/dynam_spine_importer.py,sha256=crg4LwsWr56VZ6GLYAO1CDnLuum9f1tlX_pXCqKemEc,1450
12
+ kernpy/core/dynam_spine_importer.py,sha256=Efw1g9J4Y1LvINsrEJnw7RDi9-cmwcM5RrkamIDa8iI,1567
13
13
  kernpy/core/error_listener.py,sha256=bTlAZvVIQx_6BLZ3oRut_pn24JnV8_7GnNONiwoMMPU,1516
14
14
  kernpy/core/exporter.py,sha256=t2Ep-qe_r1CvEmPb3KoMpzHd2W3SfEcjY8XhFOUqGxs,21369
15
- kernpy/core/fing_spine_importer.py,sha256=5GLPPakmZVRcNbbaoCn1p1cQdat5QttflbpKu3AytQU,1382
15
+ kernpy/core/fing_spine_importer.py,sha256=hrP0lipiBFnfq_NpsF91uv6Xj0Z-LXDzzy6ls8dKR0c,1500
16
16
  kernpy/core/generic.py,sha256=9OTDE2t49laVk6fgtydK5yZh7SCfZwViP_dZUJlskA8,10967
17
17
  kernpy/core/gkern.py,sha256=nRYFLFJ0uOLJwio0DKxQ0YIqLixy6-qCM-eY8DNdxfM,16332
18
18
  kernpy/core/graphviz_exporter.py,sha256=lzeJ0sJoKCDYam1oLJ4pjnlf_NHBJFH0V9w0Pjic5SI,3447
19
- kernpy/core/harm_spine_importer.py,sha256=L2eVxW4-tMG3JCtCwLVx6En-ulSn9S90wdUoffj_U5s,1379
19
+ kernpy/core/harm_spine_importer.py,sha256=88JplRAtgKi39z0u4Mpv_QR0Di4YMPdapNHU6Nk7INY,1495
20
20
  kernpy/core/import_humdrum_old.py,sha256=NZTQgANQc2BCYJRbGG6AyxcGHxjyy8XXa9dz88zrnMk,35304
21
21
  kernpy/core/importer.py,sha256=Rg4vIvEl2yhMwYrN5NenhdQG4_2dNByCRvHCEBJgWI8,13684
22
22
  kernpy/core/importer_factory.py,sha256=mXYWaAMyd8q1o2hJg5m0gxpBHX-nX6KGPyWl-zjrX7o,1570
23
23
  kernpy/core/kern_spine_importer.py,sha256=9jKDTDDcH81U4Vws4x5msUDq89QzwbdEGYb6uHt-cDI,2581
24
24
  kernpy/core/mens_spine_importer.py,sha256=GGutGL3qeatIkdHZxiOJNcT5mc70acJ728xu-VVLkOU,692
25
- kernpy/core/mhxm_spine_importer.py,sha256=45QhuqIgXKkLMFkZYk17sdgOH8dfzK08mWE24fGZ-n4,1410
25
+ kernpy/core/mhxm_spine_importer.py,sha256=uLcwfahqAhTWqW8-YOpRKgevh-uuklgv6EiCtbBVAS0,1502
26
26
  kernpy/core/pitch_models.py,sha256=TpSt1uxGYhbhXs0viB1dNo4jiGxyCOHWseyRHTpfH-0,9730
27
27
  kernpy/core/root_spine_importer.py,sha256=w7oFbMeXakHF9OAlgKWm_HaGJoNq6u7BE_JUnvLiLnU,1893
28
28
  kernpy/core/spine_importer.py,sha256=_VoWcVGfDMhxDn-hCu18g_29Aw2c2bjLnaXuvW2Fbsc,1430
29
- kernpy/core/text_spine_importer.py,sha256=mz1qX2nviJs0VsGsN87jk6BVWCIE7mmB9IxEx4RdhT8,1522
29
+ kernpy/core/text_spine_importer.py,sha256=AhLeLC-obEEQ5cuuk8bpdQ-GlFVFIbeVzoW6thbxYlA,1637
30
30
  kernpy/core/tokenizers.py,sha256=-m-isPSvWbikTLj5pfzG-4UCLrjxPfqHJD7s4znLHCo,7898
31
31
  kernpy/core/tokens.py,sha256=0XhbYm6F9NDfYpP5gbrgzZL3qB_xWs74faTwAZghpyM,66515
32
32
  kernpy/core/transposer.py,sha256=EqsEy7Z3bWIXdxUTruBrg8z9sWdJ3Cd_KIzo_6ZuNNA,9352
@@ -46,6 +46,6 @@ kernpy/polish_scores/iiif.py,sha256=yITdrQbMsGmm8qag8TSousjCjS2io148Jk9xwEKa3B4,
46
46
  kernpy/util/__init__.py,sha256=dfW3nRSMkGQS7p7YebM271_0H8_pVw4IiDKeINs_LI8,152
47
47
  kernpy/util/helpers.py,sha256=Xbj3nWNyErdOpLHYd4uVyfwleXvmC5_FlYEhxaeTtS8,1549
48
48
  kernpy/util/store_cache.py,sha256=AA7SFCGQ6ryy-c02wbLy8gIQ2C-VdM1JSWFoWIK_KLA,1186
49
- kernpy-1.0.2.dist-info/METADATA,sha256=Uj7S-i6JIAMSEA4eyc-PTACGQX-hch51Ze2fnOJH1C4,15085
50
- kernpy-1.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
- kernpy-1.0.2.dist-info/RECORD,,
49
+ kernpy-1.0.3.dist-info/METADATA,sha256=NIFoh9en6RHm59sa5VvC5EPez0TnltGLHL7xXjx9ttM,15357
50
+ kernpy-1.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
51
+ kernpy-1.0.3.dist-info/RECORD,,
File without changes