kernpy 1.0.0__tar.gz → 1.0.2__tar.gz

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.
Files changed (297) hide show
  1. {kernpy-1.0.0 → kernpy-1.0.2}/CONTRIBUTING.md +56 -2
  2. {kernpy-1.0.0 → kernpy-1.0.2}/License +3 -4
  3. {kernpy-1.0.0 → kernpy-1.0.2}/PKG-INFO +86 -90
  4. {kernpy-1.0.0 → kernpy-1.0.2}/README.md +85 -89
  5. {kernpy-1.0.0 → kernpy-1.0.2}/docs/get-started/tutorial.md +8 -8
  6. {kernpy-1.0.0 → kernpy-1.0.2}/docs/get-started.md +2 -2
  7. {kernpy-1.0.0 → kernpy-1.0.2}/docs/index.md +1 -1
  8. kernpy-1.0.2/kernpy/__init__.py +30 -0
  9. kernpy-1.0.2/kernpy/__main__.py +127 -0
  10. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/exporter.py +2 -2
  11. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/tokenizers.py +1 -1
  12. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/io/public.py +17 -15
  13. {kernpy-1.0.0 → kernpy-1.0.2}/pyproject.toml +1 -1
  14. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_exporter.py +1 -1
  15. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_humdrum_importer.py +4 -4
  16. kernpy-1.0.2/test/test_main_cli_api.py +120 -0
  17. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_tokenizer.py +14 -14
  18. kernpy-1.0.0/kernpy/__init__.py +0 -215
  19. kernpy-1.0.0/kernpy/__main__.py +0 -217
  20. {kernpy-1.0.0 → kernpy-1.0.2}/.github/workflows/publish-pypi.yml +0 -0
  21. {kernpy-1.0.0 → kernpy-1.0.2}/.github/workflows/run-tests.yml +0 -0
  22. {kernpy-1.0.0 → kernpy-1.0.2}/.github/workflows/update-docs.yml +0 -0
  23. {kernpy-1.0.0 → kernpy-1.0.2}/.gitignore +0 -0
  24. {kernpy-1.0.0 → kernpy-1.0.2}/antlr-4.13.1-complete.jar +0 -0
  25. {kernpy-1.0.0 → kernpy-1.0.2}/antlr4.sh +0 -0
  26. {kernpy-1.0.0 → kernpy-1.0.2}/docs/about.md +0 -0
  27. {kernpy-1.0.0 → kernpy-1.0.2}/docs/assets/001.svg +0 -0
  28. {kernpy-1.0.0 → kernpy-1.0.2}/docs/assets/book.svg +0 -0
  29. {kernpy-1.0.0 → kernpy-1.0.2}/docs/assets/learn.svg +0 -0
  30. {kernpy-1.0.0 → kernpy-1.0.2}/docs/assets/meeting.svg +0 -0
  31. {kernpy-1.0.0 → kernpy-1.0.2}/docs/assets/running.svg +0 -0
  32. {kernpy-1.0.0 → kernpy-1.0.2}/docs/css/extra.css +0 -0
  33. {kernpy-1.0.0 → kernpy-1.0.2}/docs/docs_requirements.txt +0 -0
  34. {kernpy-1.0.0 → kernpy-1.0.2}/docs/how-to-guides.md +0 -0
  35. {kernpy-1.0.0 → kernpy-1.0.2}/docs/overrides/partials/footer.html +0 -0
  36. {kernpy-1.0.0 → kernpy-1.0.2}/docs/reference.md +0 -0
  37. {kernpy-1.0.0 → kernpy-1.0.2}/docs/requirements.txt +0 -0
  38. {kernpy-1.0.0 → kernpy-1.0.2}/gen/kernLexer.interp +0 -0
  39. {kernpy-1.0.0 → kernpy-1.0.2}/gen/kernLexer.java +0 -0
  40. {kernpy-1.0.0 → kernpy-1.0.2}/gen/kernLexer.tokens +0 -0
  41. {kernpy-1.0.0 → kernpy-1.0.2}/kern/kernSpineLexer.g4 +0 -0
  42. {kernpy-1.0.0 → kernpy-1.0.2}/kern/kernSpineLexer.tokens +0 -0
  43. {kernpy-1.0.0 → kernpy-1.0.2}/kern/kernSpineParser.g4 +0 -0
  44. {kernpy-1.0.0 → kernpy-1.0.2}/kern/kernSpineParser.tokens +0 -0
  45. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/__init__.py +0 -0
  46. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/_io.py +0 -0
  47. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/base_antlr_importer.py +0 -0
  48. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/base_antlr_spine_parser_listener.py +0 -0
  49. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/basic_spine_importer.py +0 -0
  50. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/document.py +0 -0
  51. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/dyn_importer.py +0 -0
  52. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/dynam_spine_importer.py +0 -0
  53. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/error_listener.py +0 -0
  54. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/fing_spine_importer.py +0 -0
  55. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineLexer.interp +0 -0
  56. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineLexer.py +0 -0
  57. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineLexer.tokens +0 -0
  58. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParser.interp +0 -0
  59. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParser.py +0 -0
  60. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParser.tokens +0 -0
  61. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParserListener.py +0 -0
  62. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generated/kernSpineParserVisitor.py +0 -0
  63. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/generic.py +0 -0
  64. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/gkern.py +0 -0
  65. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/graphviz_exporter.py +0 -0
  66. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/harm_spine_importer.py +0 -0
  67. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/import_humdrum_old.py +0 -0
  68. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/importer.py +0 -0
  69. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/importer_factory.py +0 -0
  70. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/kern_spine_importer.py +0 -0
  71. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/mens_spine_importer.py +0 -0
  72. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/mhxm_spine_importer.py +0 -0
  73. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/pitch_models.py +0 -0
  74. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/root_spine_importer.py +0 -0
  75. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/spine_importer.py +0 -0
  76. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/text_spine_importer.py +0 -0
  77. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/tokens.py +0 -0
  78. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/core/transposer.py +0 -0
  79. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/io/__init__.py +0 -0
  80. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/polish_scores/__init__.py +0 -0
  81. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/polish_scores/download_polish_dataset.py +0 -0
  82. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/polish_scores/iiif.py +0 -0
  83. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/test_grammar.sh +0 -0
  84. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/util/__init__.py +0 -0
  85. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/util/helpers.py +0 -0
  86. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/util/store_cache.py +0 -0
  87. {kernpy-1.0.0 → kernpy-1.0.2}/kernpy/visualize_analysis.sh +0 -0
  88. {kernpy-1.0.0 → kernpy-1.0.2}/legacy-parsers-not-used/kernLexer.g4 +0 -0
  89. {kernpy-1.0.0 → kernpy-1.0.2}/legacy-parsers-not-used/kernParser.g4 +0 -0
  90. {kernpy-1.0.0 → kernpy-1.0.2}/mkdocs.yml +0 -0
  91. {kernpy-1.0.0 → kernpy-1.0.2}/requirements.txt +0 -0
  92. {kernpy-1.0.0 → kernpy-1.0.2}/test/__init__.py +0 -0
  93. {kernpy-1.0.0 → kernpy-1.0.2}/test/pytest.ini +0 -0
  94. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/all.krn +0 -0
  95. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/all_less_decorators.krn +0 -0
  96. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/all_less_durations.krn +0 -0
  97. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/all_less_note_rest.krn +0 -0
  98. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/all_less_pitches.krn +0 -0
  99. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_with_all.krn +0 -0
  100. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_without_barlines.krn +0 -0
  101. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_without_harmony.krn +0 -0
  102. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/concerto-piano-12-allegro_without_only_signatures.krn +0 -0
  103. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/empty.krn +0 -0
  104. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/only_barlines.krn +0 -0
  105. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/only_decorators.krn +0 -0
  106. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/only_durations.krn +0 -0
  107. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/categories/only_pitches.krn +0 -0
  108. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_0.krn +0 -0
  109. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_0_merged.krn +0 -0
  110. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_1.krn +0 -0
  111. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_10.krn +0 -0
  112. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_10_merged.krn +0 -0
  113. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_11.krn +0 -0
  114. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_11_merged.krn +0 -0
  115. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_1_merged.krn +0 -0
  116. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_2.krn +0 -0
  117. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_2_merged.krn +0 -0
  118. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_3.krn +0 -0
  119. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_3_merged.krn +0 -0
  120. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_4.krn +0 -0
  121. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_4_merged.krn +0 -0
  122. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_5.krn +0 -0
  123. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_5_merged.krn +0 -0
  124. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_6.krn +0 -0
  125. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_7.krn +0 -0
  126. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_7_merged.krn +0 -0
  127. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_8.krn +0 -0
  128. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_8_merged.krn +0 -0
  129. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_9.krn +0 -0
  130. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/concat/0_9_merged.krn +0 -0
  131. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/input/sub/chor001.krn +0 -0
  132. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/input/sub/chor002.krn +0 -0
  133. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-1-to-3.krn +0 -0
  134. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-10-to-12.krn +0 -0
  135. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-11-to-13.krn +0 -0
  136. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-12-to-14.krn +0 -0
  137. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-13-to-15.krn +0 -0
  138. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-14-to-16.krn +0 -0
  139. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-15-to-17.krn +0 -0
  140. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-16-to-18.krn +0 -0
  141. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-17-to-19.krn +0 -0
  142. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-18-to-20.krn +0 -0
  143. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-19-to-21.krn +0 -0
  144. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-2-to-4.krn +0 -0
  145. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-20-to-22.krn +0 -0
  146. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-21-to-23.krn +0 -0
  147. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-22-to-24.krn +0 -0
  148. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-3-to-5.krn +0 -0
  149. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-4-to-6.krn +0 -0
  150. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-5-to-7.krn +0 -0
  151. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-6-to-8.krn +0 -0
  152. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-7-to-9.krn +0 -0
  153. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-8-to-10.krn +0 -0
  154. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor001/from-9-to-11.krn +0 -0
  155. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-1-to-5.krn +0 -0
  156. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-2-to-6.krn +0 -0
  157. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-3-to-7.krn +0 -0
  158. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-4-to-8.krn +0 -0
  159. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/fragments/output/chor002/from-5-to-9.krn +0 -0
  160. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/grandstaff/5901766-m24-to-m28.ekrn +0 -0
  161. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/grandstaff/5901766.krn +0 -0
  162. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/hierarchy/tree.txt +0 -0
  163. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/kern-scores/beethoven_sonata_12_4.krn +0 -0
  164. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet.ekrn +0 -0
  165. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet.krn +0 -0
  166. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer.krn +0 -0
  167. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_m2-m4.ekrn +0 -0
  168. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_m2-m4.krn +0 -0
  169. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_m3-m3.krn +0 -0
  170. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/base_tuplet_longer_plus_octave.krn +0 -0
  171. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-all_tokens.txt +0 -0
  172. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-m1-to-m3.ekrn +0 -0
  173. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-metadata-generic.txt +0 -0
  174. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-unique_tokens.txt +0 -0
  175. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-unique_tokens_with_category.txt +0 -0
  176. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001-unique_tokens_without_measure_numbers.txt +0 -0
  177. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001.ekrn +0 -0
  178. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor001.krn +0 -0
  179. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor009.krn +0 -0
  180. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/chor048.krn +0 -0
  181. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-1.ekrn +0 -0
  182. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-1.krn +0 -0
  183. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-2.ekrn +0 -0
  184. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-3.ekrn +0 -0
  185. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-3.krn +0 -0
  186. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-4.ekrn +0 -0
  187. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide02-example2-4.krn +0 -0
  188. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-1.ekrn +0 -0
  189. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-1.krn +0 -0
  190. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-2.ekrn +0 -0
  191. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/guide06-example6-2.krn +0 -0
  192. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/kern2ekern.ekrn +0 -0
  193. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/kern2ekern.krn +0 -0
  194. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/spines_lexer.ekrn +0 -0
  195. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/spines_lexer.krn +0 -0
  196. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/spline_split.krn +0 -0
  197. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/spline_split_piston070.ekrn +0 -0
  198. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/legacy/spline_split_piston070.krn +0 -0
  199. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/metadata/frequency.json +0 -0
  200. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro-left-hand.krn +0 -0
  201. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro-right-hand-and-dyn.krn +0 -0
  202. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro-right-hand.krn +0 -0
  203. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/mozart/concerto-piano-12-allegro.krn +0 -0
  204. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/mozart/divertimento-quartet.krn +0 -0
  205. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/10.ekrn +0 -0
  206. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/10.jpg +0 -0
  207. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/11.ekrn +0 -0
  208. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/11.jpg +0 -0
  209. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/9.ekrn +0 -0
  210. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pages/9.jpg +0 -0
  211. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m16.ekrn +0 -0
  212. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m2.ekrn +0 -0
  213. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m3.ekrn +0 -0
  214. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante.krn +0 -0
  215. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test2/pl-wn--mus-iii-123-982--001-004_wieniawski-henryk--l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10-4-le-staccato-m0-to-m1.ekrn +0 -0
  216. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test2/pl-wn--mus-iii-123-982--001-004_wieniawski-henryk--l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10-4-le-staccato-m1-to-m2.ekrn +0 -0
  217. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test2/pl-wn--mus-iii-123-982--001-004_wieniawski-henryk--l-ecole-moderne-etudes-caprices-pour-violon-seul-op-10-4-le-staccato.krn +0 -0
  218. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/polish/test3/pl-wn--sd-xvi-qu-273--001-020_gomolka-mikolaj--melodiae-na-psalterz-polski-xx-wsiadaj-z-dobrym-sercem-o-krolu-cnotliwy.krn +0 -0
  219. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/any_header.krn +0 -0
  220. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/bach-brandenburg-bwv1050a.krn +0 -0
  221. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/bach-chorale-chor205.krn +0 -0
  222. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/corelli-op01n12d.krn +0 -0
  223. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/harmonized-song-erk052.krn +0 -0
  224. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/haydn-quartet-op54n2-01.krn +0 -0
  225. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/haydn-sonate-15_1-original.krn +0 -0
  226. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/haydn-sonate-15_1-output.krn +0 -0
  227. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/jazzmus_with_mxhm.krn +0 -0
  228. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/permutations_of_2.bb-_ .krn +0 -0
  229. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/piano-beethoven-sonata21-3.krn +0 -0
  230. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/piano-chopin-prelude28-17.krn +0 -0
  231. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/piano-hummel-prelude67-15.krn +0 -0
  232. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/piano-joplin-bethena.krn +0 -0
  233. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/piano-mozart-sonata07-3.krn +0 -0
  234. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/piano-scarlatti-L523K205.krn +0 -0
  235. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/quartet-beethoven-quartet13-6.krn +0 -0
  236. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/quartet-mozart-k590-04.krn +0 -0
  237. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_one_spine.krn +0 -0
  238. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_one_spine_m9-m13.krn +0 -0
  239. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_two_spines.krn +0 -0
  240. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/score_with_dividing_two_spines_m49-m56.krn +0 -0
  241. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/unaccompanied-songs-nova073.krn +0 -0
  242. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/unexpected_header.krn +0 -0
  243. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/wrong_header.krn +0 -0
  244. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/wrong_number_of_columns.krn +0 -0
  245. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/samples/wrong_number_of_columns_fixed.krn +0 -0
  246. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/1.krn +0 -0
  247. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/2-m2-to-m2.ekrn +0 -0
  248. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/2.krn +0 -0
  249. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/3.krn +0 -0
  250. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/4.krn +0 -0
  251. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/5.krn +0 -0
  252. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/concerto-piano-12-allegro_only_kern_and_harm.krn +0 -0
  253. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/non_stacked_ends.krn +0 -0
  254. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/non_stacked_ends_2.krn +0 -0
  255. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/spines-from-piano-joplin-bethena-start.krn +0 -0
  256. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/spines/spines-piano-hummel-prelude67-15.krn +0 -0
  257. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/accidentals.krn +0 -0
  258. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/accidentals_alteration_display.krn +0 -0
  259. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/articulations.krn +0 -0
  260. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/auto_beaming.krn +0 -0
  261. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/bars.krn +0 -0
  262. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/beaming.krn +0 -0
  263. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/chords.krn +0 -0
  264. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/clefs.krn +0 -0
  265. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/headers.krn +0 -0
  266. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/key.krn +0 -0
  267. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/key_designation.krn +0 -0
  268. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/mensurations.krn +0 -0
  269. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/minimal.krn +0 -0
  270. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/minimal_incorrect.krn +0 -0
  271. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/modal.krn +0 -0
  272. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/octaves.krn +0 -0
  273. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/ornaments.krn +0 -0
  274. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/rests.krn +0 -0
  275. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/rhythm.krn +0 -0
  276. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/slurs.krn +0 -0
  277. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/ties.krn +0 -0
  278. {kernpy-1.0.0 → kernpy-1.0.2}/test/resource_dir/unit/time.krn +0 -0
  279. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_deprecated.py +0 -0
  280. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_document.py +0 -0
  281. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_download_polish_scores.py +0 -0
  282. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_export_options.py +0 -0
  283. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_generic.py +0 -0
  284. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_gkern.py +0 -0
  285. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_importer.py +0 -0
  286. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_root_spine_root.py +0 -0
  287. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_imoprter_dynam.py +0 -0
  288. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_importer_basic.py +0 -0
  289. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_importer_dyn.py +0 -0
  290. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_importer_fing.py +0 -0
  291. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_importer_harm.py +0 -0
  292. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_importer_kern.py +0 -0
  293. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_importer_mxhm.py +0 -0
  294. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_spine_importer_text.py +0 -0
  295. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_token.py +0 -0
  296. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_transposer.py +0 -0
  297. {kernpy-1.0.0 → kernpy-1.0.2}/test/test_util_store_cache.py +0 -0
@@ -1,9 +1,13 @@
1
1
  # Contributing to kernpy
2
2
 
3
+ >
4
+ > Go to [Developer Notes](#developer-notes) for specific guidelines for developers.
5
+ >
6
+
3
7
  We welcome your contributions to `kernpy`‼️
4
8
  Our goal is to make contributing as easy and transparent as possible. Whether you're fixing bugs, improving documentation, or adding new features, or creating new tests, thank you for helping improve `kernpy`!
5
9
 
6
- ## How to Contribute
10
+ <br>
7
11
 
8
12
  ## Step-by-Step Guide 📖
9
13
  1. Fork the Repository
@@ -44,4 +48,54 @@ Testing: Every change must pass the build tests. Run tests locally using the pro
44
48
 
45
49
  By contributing to `kernpy`, you agree that your contributions will be licensed under the terms specified in the LICENSE file at the root of this project.
46
50
 
47
- Happy coding and thank you for contributing! 🚀
51
+ Happy coding and thank you for contributing! 🚀
52
+
53
+
54
+ # Developer notes
55
+
56
+ > [!IMPORTANT]
57
+ > - Add the development dependencies to the `requirements.txt` file.
58
+ > - Add the production dependencies to the `pyproject.toml` file.
59
+ > - After every change in the grammar, the next steps are mandatory:
60
+ > - - Run the `antlr4.sh` script (JAVA required).
61
+ > - - Commit & push the changes to the repository.
62
+
63
+
64
+ - Generate antrl4 grammar:
65
+ - For generating the Python code required for parsing the **kern files, the shell script `antlr4.sh` inside the `kernpy` package must be run.
66
+
67
+ ```shell
68
+ ./antlr4.sh
69
+ ```
70
+
71
+ Install all the dependencies using the `requirements.txt` file:
72
+ ```shell
73
+ pip install -r requirements.txt
74
+ ```
75
+
76
+ Otherwise, install the required packages manually:
77
+
78
+
79
+ - It requires the `antlr4` package to be installed using:
80
+ ```shell
81
+ pip install antlr4-python3-runtime
82
+ ```
83
+
84
+
85
+ - For visualizing the bounding boxes, the library, the `Pillow` library is required:
86
+ ```shell
87
+ pip install Pillow
88
+ ```
89
+
90
+ - To parse a IIIF (International Image Interoperability Framework) manifest in Python, we use the `requests` library to fetch the manifest file:
91
+ ```shell
92
+ pip install requests
93
+ ```
94
+
95
+ - If fetching data from `https` fails, install the following version of `urllib`:
96
+ ```shell
97
+ pip install urllib3==1.26.6
98
+ ```
99
+
100
+ It has been tested with version 4.13.1 of the package.
101
+
@@ -629,13 +629,12 @@ to attach them to the start of each source file to most effectively
629
629
  state the exclusion of warranty; and each file should have at least
630
630
  the "copyright" line and a pointer to where the full notice is found.
631
631
 
632
- <one line to give the program's name and a brief idea of what it does.>
633
- Copyright (C) <year> <name of author>
632
+ Python package that provides comprehensive tools for working with symbolic modern and mensural notations in Humdrum format. kernpy is a fully open-source project open to contributions.
633
+ Copyright (C) 2025 [Joan Cerveto-Serrano, David Rizo, Jorge Calvo-Zaragoza]
634
634
 
635
635
  This program is free software: you can redistribute it and/or modify
636
636
  it under the terms of the GNU Affero General Public License as published by
637
- the Free Software Foundation, either version 3 of the License, or
638
- (at your option) any later version.
637
+ the Free Software Foundation, either version 3 of the License any later version.
639
638
 
640
639
  This program is distributed in the hope that it will be useful,
641
640
  but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: kernpy
3
- Version: 1.0.0
3
+ Version: 1.0.2
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
@@ -19,9 +19,18 @@ Description-Content-Type: text/markdown
19
19
 
20
20
  # Python Humdrum **kern and **mens utilities
21
21
 
22
- ## Documentation: <a target="_blank" href="https://kernpy.pages.dev/">https://kernpy.pages.dev/</a>
22
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg?style=for-the-badge)](https://www.gnu.org/licenses/agpl-3.0)
23
+ ![Python Version](https://img.shields.io/badge/Python-3.9+-3776AB?logo=python&logoColor=white&style=for-the-badge)
24
+ [![PyPI](https://img.shields.io/pypi/v/kernpy?color=brightgreen&label=PyPI&style=for-the-badge&logo=pypi)](https://pypi.org/project/kernpy/)
25
+ [![Docs](https://img.shields.io/badge/docs-available-blue?style=for-the-badge&logo=readthedocs)](https://kernpy.pages.dev)
26
+ [![Tests](https://img.shields.io/badge/tests-passing-brightgreen?style=for-the-badge&logo=pytest)](https://github.com/kernpy/kernpy/actions)
27
+ [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange?style=for-the-badge&logo=github)](CONTRIBUTING.md)
23
28
 
24
- ![kernpy logo](https://static.wixstatic.com/media/7a8a67_90be144dbf384480908c3327b93ba97a~mv2.jpg/v1/fill/w_461,h_354,fp_0.46_0.20,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/mending-the-sail-1896_jpg!Large.jpg)
29
+
30
+ Python package that provides comprehensive tools for working with symbolic modern and mensural notations in Humdrum format. kernpy is a fully open-source project open to contributions.
31
+
32
+ ## Documentation
33
+ Visit the online website: <a target="_blank" href="https://kernpy.pages.dev/">https://kernpy.pages.dev/</a>
25
34
 
26
35
  ## Index:
27
36
  - [Code examples](#code-examples)
@@ -71,18 +80,74 @@ Only use the specified spines in `spine_types`.
71
80
  ```python
72
81
  import kernpy as kp
73
82
 
83
+ # only export the **kern spines
74
84
  kp.dump(document, "newfile_core.krn",
75
85
  spine_types=['**kern'])
86
+
87
+ # only export the **text spines
76
88
  kp.dump(document, "newfile_lyrics.krn",
77
89
  spine_types=['**text])
90
+
91
+ # only export **kern and **text spines
78
92
  kp.dump(document, "newfile_core_and_lyrics.krn",
79
93
  spine_types=['*+text'])
80
94
  ```
81
95
 
96
+ - The categories are hierarchically defined in the `TokenCategory` class.
97
+ See the hierarchy as a tree
98
+ ```python
99
+ import kernpy as kp
100
+
101
+
102
+ print(kp.TokenCategory.tree())
103
+ ```
104
+ Tree:
105
+ ```txt
106
+ .
107
+ ├── STRUCTURAL
108
+ │ ├── HEADER
109
+ │ └── SPINE_OPERATION
110
+ ├── CORE
111
+ │ ├── NOTE_REST
112
+ │ │ ├── DURATION
113
+ │ │ ├── NOTE
114
+ │ │ │ ├── PITCH
115
+ │ │ │ ├── DECORATION
116
+ │ │ │ └── ALTERATION
117
+ │ │ └── REST
118
+ │ ├── CHORD
119
+ │ ├── EMPTY
120
+ │ └── ERROR
121
+ ├── SIGNATURES
122
+ │ ├── CLEF
123
+ │ ├── TIME_SIGNATURE
124
+ │ ├── METER_SYMBOL
125
+ │ ├── KEY_SIGNATURE
126
+ │ └── KEY_TOKEN
127
+ ├── ENGRAVED_SYMBOLS
128
+ ├── OTHER_CONTEXTUAL
129
+ ├── BARLINES
130
+ ├── COMMENTS
131
+ │ ├── FIELD_COMMENTS
132
+ │ └── LINE_COMMENTS
133
+ ├── DYNAMICS
134
+ ├── HARMONY
135
+ ├── FINGERING
136
+ ├── LYRICS
137
+ ├── INSTRUMENTS
138
+ ├── IMAGE_ANNOTATIONS
139
+ │ ├── BOUNDING_BOXES
140
+ │ └── LINE_BREAK
141
+ ├── OTHER
142
+ ├── MHXM
143
+ └── ROOT
144
+ ```
145
+
82
146
  - Use `include` for selecting the **kern semantic categories **to use**. The output only contains what is passed. By default, all the categories are included.
83
147
  ```python
84
148
  import kernpy as kp
85
149
 
150
+
86
151
  kp.dump(document, "newfile_only_clefs.krn",
87
152
  include={kp.TokenCategory.CLEF})
88
153
  kp.dump(document, "newfile_only_durations_and_bounding_boxes.krn",
@@ -104,34 +169,37 @@ import kernpy as kp
104
169
  kp.dump(document, "newfile_custom.krn",
105
170
  include=kp.BEKERN_CATEGORIES, # Preloaded set of simple categories
106
171
  exclude={kp.TokenCategory.PITCH})
172
+
173
+ # Inspect the BEKERN preloaded categories
174
+ print(kp.BEKERN_CATEGORIES)
107
175
  ```
108
176
 
109
- - Use `tokenizer` to select how the categories are split. By default, the `normalizedKern` tokenizer is used.
177
+ - Use `encoding` to select how the categories are split. By default, the `normalizedKern` encoding is used.
110
178
 
111
179
  ```python
112
180
  import kernpy as kp
113
181
 
114
182
  kp.dump(document, "newfile_normalized.krn",
115
- tokenizer=kp.Encoding.normalizedKern) # Default tokenizer
183
+ encoding=kp.Encoding.normalizedKern) # Default encoding
116
184
  ```
117
- Select the proper Humdrum **kern tokenizer:
185
+ Select the proper Humdrum **kern encoding:
118
186
 
119
- `kernpy` provides different tokenizers to export the content each symbol in different formats.
187
+ `kernpy` provides different encodings to export the content each symbol in different formats.
120
188
 
121
- | Encoding | Tokenized | Description |
189
+ | Encoding | Output | Description |
122
190
  |----------|--------------|----------------------------------------|
123
191
  | kern | 2.bb-_L | Traditional Humdrum **kern encoding |
124
192
  | ekern | 2@.@bb@-·_·L | Extended Humdrum **kern encoding |
125
193
 
126
- Use the `Encoding` enum class to select the tokenizer:
194
+ Use the `Encoding` enum class to select the encoding:
127
195
 
128
196
  ```python
129
197
  import kernpy as kp
130
198
 
131
199
  doc, _ = kp.load('resource_dir/legacy/chor048.krn')
132
200
 
133
- kern_content = kp.dumps(doc, tokenizer=kp.Encoding.normalizedKern)
134
- ekern_content = kp.dumps(doc, tokenizer=kp.Encoding.eKern)
201
+ kern_content = kp.dumps(doc, encoding=kp.Encoding.normalizedKern)
202
+ ekern_content = kp.dumps(doc, encoding=kp.Encoding.eKern)
135
203
  ```
136
204
 
137
205
  - Use `from_measure` and `to_measure` to select the measures to export. By default, all the measures are exported.
@@ -168,7 +236,7 @@ kp.dump(document, "newfile.krn",
168
236
  spine_types=['**kern'], # Export only the **kern spines
169
237
  include=kp.BEKERN_CATEGORIES, # Token categories to include
170
238
  exclude={kp.TokenCategory.PITCH}, # Token categories to exclude
171
- tokenizer=kp.Encoding.eKern, # Kern encoding
239
+ encoding=kp.Encoding.eKern, # Kern encoding
172
240
  from_measure=1, # First from measure 1
173
241
  to_measure=10, # Last measure exported
174
242
  spine_ids=[0, 1], # Export only the first and the second spine
@@ -271,7 +339,7 @@ for page_label, bounding_box_measure in doc.page_bounding_boxes.items():
271
339
  kp.dump(doc, f"foo_{page_label}.ekrn",
272
340
  spine_types=['**kern'],
273
341
  token_categories=kp.BEKERN_CATEGORIES,
274
- tokenizer=kp.Encoding.eKern,
342
+ encoding=kp.Encoding.eKern,
275
343
  from_measure=bounding_box_measure.from_measure,
276
344
  to_measure=bounding_box_measure.to_measure - 1 # TODO: Check bounds
277
345
  )
@@ -382,8 +450,10 @@ kp.graph(document, '/tmp/graph.dot')
382
450
  ### Production version:
383
451
  Just install the last version of **kernpy** using pip:
384
452
  ```shell
385
- pip3 uninstall kernpy # Uninstall the previous version before installing the new one
386
- pip3 install git+https://github.com/OMR-PRAIG-UA-ES/kernpy.git
453
+ pip3 install kernpy
454
+
455
+ # ensure you have the latest version
456
+ pip3 install kernpy --upgrade
387
457
  ```
388
458
 
389
459
  > [!NOTE]
@@ -391,55 +461,6 @@ pip3 install git+https://github.com/OMR-PRAIG-UA-ES/kernpy.git
391
461
 
392
462
  <hr>
393
463
 
394
- ### Development version:
395
-
396
- > [!IMPORTANT]
397
- > - Add the development dependencies to the `requirements.txt` file.
398
- > - Add the production dependencies to the `pyproject.toml` file.
399
- > - After every change in the grammar, the next steps are mandatory:
400
- > - - Run the `antlr4.sh` script (JAVA required).
401
- > - - Commit & push the changes to the repository.
402
-
403
-
404
- - Generate antrl4 grammar:
405
- - For generating the Python code required for parsing the **kern files, the shell script `antlr4.sh` inside the `kernpy` package must be run.
406
-
407
- ```shell
408
- ./antlr4.sh
409
- ```
410
-
411
- Install all the dependencies using the `requirements.txt` file:
412
- ```shell
413
- pip install -r requirements.txt
414
- ```
415
-
416
- Otherwise, install the required packages manually:
417
-
418
-
419
- - It requires the `antlr4` package to be installed using:
420
- ```shell
421
- pip install antlr4-python3-runtime
422
- ```
423
-
424
-
425
- - For visualizing the bounding boxes, the library, the `Pillow` library is required:
426
- ```shell
427
- pip install Pillow
428
- ```
429
-
430
- - To parse a IIIF (International Image Interoperability Framework) manifest in Python, we use the `requests` library to fetch the manifest file:
431
- ```shell
432
- pip install requests
433
- ```
434
-
435
- - If fetching data from `https` fails, install the following version of `urllib`:
436
- ```shell
437
- pip install urllib3==1.26.6
438
- ```
439
-
440
- It has been tested with version 4.13.1 of the package.
441
-
442
-
443
464
  ## Documentation
444
465
  Documentation available at [https://kernpy.pages.dev/](https://kernpy.pages.dev/)
445
466
 
@@ -461,32 +482,7 @@ cd tests && python -m pytest
461
482
 
462
483
  We welcome contributions from the community! If you'd like to contribute to the project, please follow these steps:
463
484
 
464
- 1. Fork the Repository from GitHub.
465
- 2. Clone your own fork repository.
466
- ```bash
467
- git clone ...
468
- cd ...
469
- ```
470
- 3. Create a Branch:
471
- 4. Create a new branch for your feature or bug fix:
472
- ```bash
473
- git checkout -b feature/your-feature-name
474
- ```
475
- 5. Commit Your Changes:
476
- Commit your changes with a descriptive message:
477
- ```bash
478
- git commit -m "feat: add your feature or fix"
479
- ```
480
-
481
- 6. Push to Your Branch:
482
- Push your changes to your forked repository:
483
- ```bash
484
- git push origin feature/your-feature-name
485
- ```
486
-
487
- 7. Create a Pull Request:
488
- Open a pull request to the main repository, describing your changes.
489
-
485
+ Go to the file [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to contribute.
490
486
 
491
487
  ## Citation:
492
488
  ```bibtex
@@ -1,8 +1,17 @@
1
1
  # Python Humdrum **kern and **mens utilities
2
2
 
3
- ## Documentation: <a target="_blank" href="https://kernpy.pages.dev/">https://kernpy.pages.dev/</a>
3
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg?style=for-the-badge)](https://www.gnu.org/licenses/agpl-3.0)
4
+ ![Python Version](https://img.shields.io/badge/Python-3.9+-3776AB?logo=python&logoColor=white&style=for-the-badge)
5
+ [![PyPI](https://img.shields.io/pypi/v/kernpy?color=brightgreen&label=PyPI&style=for-the-badge&logo=pypi)](https://pypi.org/project/kernpy/)
6
+ [![Docs](https://img.shields.io/badge/docs-available-blue?style=for-the-badge&logo=readthedocs)](https://kernpy.pages.dev)
7
+ [![Tests](https://img.shields.io/badge/tests-passing-brightgreen?style=for-the-badge&logo=pytest)](https://github.com/kernpy/kernpy/actions)
8
+ [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-orange?style=for-the-badge&logo=github)](CONTRIBUTING.md)
4
9
 
5
- ![kernpy logo](https://static.wixstatic.com/media/7a8a67_90be144dbf384480908c3327b93ba97a~mv2.jpg/v1/fill/w_461,h_354,fp_0.46_0.20,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/mending-the-sail-1896_jpg!Large.jpg)
10
+
11
+ Python package that provides comprehensive tools for working with symbolic modern and mensural notations in Humdrum format. kernpy is a fully open-source project open to contributions.
12
+
13
+ ## Documentation
14
+ Visit the online website: <a target="_blank" href="https://kernpy.pages.dev/">https://kernpy.pages.dev/</a>
6
15
 
7
16
  ## Index:
8
17
  - [Code examples](#code-examples)
@@ -52,18 +61,74 @@ Only use the specified spines in `spine_types`.
52
61
  ```python
53
62
  import kernpy as kp
54
63
 
64
+ # only export the **kern spines
55
65
  kp.dump(document, "newfile_core.krn",
56
66
  spine_types=['**kern'])
67
+
68
+ # only export the **text spines
57
69
  kp.dump(document, "newfile_lyrics.krn",
58
70
  spine_types=['**text])
71
+
72
+ # only export **kern and **text spines
59
73
  kp.dump(document, "newfile_core_and_lyrics.krn",
60
74
  spine_types=['*+text'])
61
75
  ```
62
76
 
77
+ - The categories are hierarchically defined in the `TokenCategory` class.
78
+ See the hierarchy as a tree
79
+ ```python
80
+ import kernpy as kp
81
+
82
+
83
+ print(kp.TokenCategory.tree())
84
+ ```
85
+ Tree:
86
+ ```txt
87
+ .
88
+ ├── STRUCTURAL
89
+ │ ├── HEADER
90
+ │ └── SPINE_OPERATION
91
+ ├── CORE
92
+ │ ├── NOTE_REST
93
+ │ │ ├── DURATION
94
+ │ │ ├── NOTE
95
+ │ │ │ ├── PITCH
96
+ │ │ │ ├── DECORATION
97
+ │ │ │ └── ALTERATION
98
+ │ │ └── REST
99
+ │ ├── CHORD
100
+ │ ├── EMPTY
101
+ │ └── ERROR
102
+ ├── SIGNATURES
103
+ │ ├── CLEF
104
+ │ ├── TIME_SIGNATURE
105
+ │ ├── METER_SYMBOL
106
+ │ ├── KEY_SIGNATURE
107
+ │ └── KEY_TOKEN
108
+ ├── ENGRAVED_SYMBOLS
109
+ ├── OTHER_CONTEXTUAL
110
+ ├── BARLINES
111
+ ├── COMMENTS
112
+ │ ├── FIELD_COMMENTS
113
+ │ └── LINE_COMMENTS
114
+ ├── DYNAMICS
115
+ ├── HARMONY
116
+ ├── FINGERING
117
+ ├── LYRICS
118
+ ├── INSTRUMENTS
119
+ ├── IMAGE_ANNOTATIONS
120
+ │ ├── BOUNDING_BOXES
121
+ │ └── LINE_BREAK
122
+ ├── OTHER
123
+ ├── MHXM
124
+ └── ROOT
125
+ ```
126
+
63
127
  - Use `include` for selecting the **kern semantic categories **to use**. The output only contains what is passed. By default, all the categories are included.
64
128
  ```python
65
129
  import kernpy as kp
66
130
 
131
+
67
132
  kp.dump(document, "newfile_only_clefs.krn",
68
133
  include={kp.TokenCategory.CLEF})
69
134
  kp.dump(document, "newfile_only_durations_and_bounding_boxes.krn",
@@ -85,34 +150,37 @@ import kernpy as kp
85
150
  kp.dump(document, "newfile_custom.krn",
86
151
  include=kp.BEKERN_CATEGORIES, # Preloaded set of simple categories
87
152
  exclude={kp.TokenCategory.PITCH})
153
+
154
+ # Inspect the BEKERN preloaded categories
155
+ print(kp.BEKERN_CATEGORIES)
88
156
  ```
89
157
 
90
- - Use `tokenizer` to select how the categories are split. By default, the `normalizedKern` tokenizer is used.
158
+ - Use `encoding` to select how the categories are split. By default, the `normalizedKern` encoding is used.
91
159
 
92
160
  ```python
93
161
  import kernpy as kp
94
162
 
95
163
  kp.dump(document, "newfile_normalized.krn",
96
- tokenizer=kp.Encoding.normalizedKern) # Default tokenizer
164
+ encoding=kp.Encoding.normalizedKern) # Default encoding
97
165
  ```
98
- Select the proper Humdrum **kern tokenizer:
166
+ Select the proper Humdrum **kern encoding:
99
167
 
100
- `kernpy` provides different tokenizers to export the content each symbol in different formats.
168
+ `kernpy` provides different encodings to export the content each symbol in different formats.
101
169
 
102
- | Encoding | Tokenized | Description |
170
+ | Encoding | Output | Description |
103
171
  |----------|--------------|----------------------------------------|
104
172
  | kern | 2.bb-_L | Traditional Humdrum **kern encoding |
105
173
  | ekern | 2@.@bb@-·_·L | Extended Humdrum **kern encoding |
106
174
 
107
- Use the `Encoding` enum class to select the tokenizer:
175
+ Use the `Encoding` enum class to select the encoding:
108
176
 
109
177
  ```python
110
178
  import kernpy as kp
111
179
 
112
180
  doc, _ = kp.load('resource_dir/legacy/chor048.krn')
113
181
 
114
- kern_content = kp.dumps(doc, tokenizer=kp.Encoding.normalizedKern)
115
- ekern_content = kp.dumps(doc, tokenizer=kp.Encoding.eKern)
182
+ kern_content = kp.dumps(doc, encoding=kp.Encoding.normalizedKern)
183
+ ekern_content = kp.dumps(doc, encoding=kp.Encoding.eKern)
116
184
  ```
117
185
 
118
186
  - Use `from_measure` and `to_measure` to select the measures to export. By default, all the measures are exported.
@@ -149,7 +217,7 @@ kp.dump(document, "newfile.krn",
149
217
  spine_types=['**kern'], # Export only the **kern spines
150
218
  include=kp.BEKERN_CATEGORIES, # Token categories to include
151
219
  exclude={kp.TokenCategory.PITCH}, # Token categories to exclude
152
- tokenizer=kp.Encoding.eKern, # Kern encoding
220
+ encoding=kp.Encoding.eKern, # Kern encoding
153
221
  from_measure=1, # First from measure 1
154
222
  to_measure=10, # Last measure exported
155
223
  spine_ids=[0, 1], # Export only the first and the second spine
@@ -252,7 +320,7 @@ for page_label, bounding_box_measure in doc.page_bounding_boxes.items():
252
320
  kp.dump(doc, f"foo_{page_label}.ekrn",
253
321
  spine_types=['**kern'],
254
322
  token_categories=kp.BEKERN_CATEGORIES,
255
- tokenizer=kp.Encoding.eKern,
323
+ encoding=kp.Encoding.eKern,
256
324
  from_measure=bounding_box_measure.from_measure,
257
325
  to_measure=bounding_box_measure.to_measure - 1 # TODO: Check bounds
258
326
  )
@@ -363,8 +431,10 @@ kp.graph(document, '/tmp/graph.dot')
363
431
  ### Production version:
364
432
  Just install the last version of **kernpy** using pip:
365
433
  ```shell
366
- pip3 uninstall kernpy # Uninstall the previous version before installing the new one
367
- pip3 install git+https://github.com/OMR-PRAIG-UA-ES/kernpy.git
434
+ pip3 install kernpy
435
+
436
+ # ensure you have the latest version
437
+ pip3 install kernpy --upgrade
368
438
  ```
369
439
 
370
440
  > [!NOTE]
@@ -372,55 +442,6 @@ pip3 install git+https://github.com/OMR-PRAIG-UA-ES/kernpy.git
372
442
 
373
443
  <hr>
374
444
 
375
- ### Development version:
376
-
377
- > [!IMPORTANT]
378
- > - Add the development dependencies to the `requirements.txt` file.
379
- > - Add the production dependencies to the `pyproject.toml` file.
380
- > - After every change in the grammar, the next steps are mandatory:
381
- > - - Run the `antlr4.sh` script (JAVA required).
382
- > - - Commit & push the changes to the repository.
383
-
384
-
385
- - Generate antrl4 grammar:
386
- - For generating the Python code required for parsing the **kern files, the shell script `antlr4.sh` inside the `kernpy` package must be run.
387
-
388
- ```shell
389
- ./antlr4.sh
390
- ```
391
-
392
- Install all the dependencies using the `requirements.txt` file:
393
- ```shell
394
- pip install -r requirements.txt
395
- ```
396
-
397
- Otherwise, install the required packages manually:
398
-
399
-
400
- - It requires the `antlr4` package to be installed using:
401
- ```shell
402
- pip install antlr4-python3-runtime
403
- ```
404
-
405
-
406
- - For visualizing the bounding boxes, the library, the `Pillow` library is required:
407
- ```shell
408
- pip install Pillow
409
- ```
410
-
411
- - To parse a IIIF (International Image Interoperability Framework) manifest in Python, we use the `requests` library to fetch the manifest file:
412
- ```shell
413
- pip install requests
414
- ```
415
-
416
- - If fetching data from `https` fails, install the following version of `urllib`:
417
- ```shell
418
- pip install urllib3==1.26.6
419
- ```
420
-
421
- It has been tested with version 4.13.1 of the package.
422
-
423
-
424
445
  ## Documentation
425
446
  Documentation available at [https://kernpy.pages.dev/](https://kernpy.pages.dev/)
426
447
 
@@ -442,32 +463,7 @@ cd tests && python -m pytest
442
463
 
443
464
  We welcome contributions from the community! If you'd like to contribute to the project, please follow these steps:
444
465
 
445
- 1. Fork the Repository from GitHub.
446
- 2. Clone your own fork repository.
447
- ```bash
448
- git clone ...
449
- cd ...
450
- ```
451
- 3. Create a Branch:
452
- 4. Create a new branch for your feature or bug fix:
453
- ```bash
454
- git checkout -b feature/your-feature-name
455
- ```
456
- 5. Commit Your Changes:
457
- Commit your changes with a descriptive message:
458
- ```bash
459
- git commit -m "feat: add your feature or fix"
460
- ```
461
-
462
- 6. Push to Your Branch:
463
- Push your changes to your forked repository:
464
- ```bash
465
- git push origin feature/your-feature-name
466
- ```
467
-
468
- 7. Create a Pull Request:
469
- Open a pull request to the main repository, describing your changes.
470
-
466
+ Go to the file [CONTRIBUTING.md](CONTRIBUTING.md) for more information on how to contribute.
471
467
 
472
468
  ## Citation:
473
469
  ```bibtex
@@ -117,15 +117,15 @@ kp.dump(document, "newfile_custom.krn",
117
117
  exclude={kp.TokenCategory.PITCH})
118
118
  ```
119
119
 
120
- - Use `tokenizer` to select how the categories are split. By default, the `normalizedKern` tokenizer is used.
120
+ - Use `encoding` to select how the categories are split. By default, the `normalizedKern` encoding is used.
121
121
 
122
122
  ```python
123
123
  import kernpy as kp
124
124
 
125
125
  kp.dump(document, "newfile_normalized.krn",
126
- tokenizer=kp.Encoding.normalizedKern) # Default tokenizer
126
+ encoding=kp.Encoding.normalizedKern) # Default encoding
127
127
  ```
128
- Select the proper Humdrum **kern tokenizer:
128
+ Select the proper Humdrum **kern encoding:
129
129
 
130
130
  `kernpy` provides different tokenizers to export the content each symbol in different formats.
131
131
 
@@ -134,15 +134,15 @@ Select the proper Humdrum **kern tokenizer:
134
134
  | kern | 2.bb-_L | Traditional Humdrum **kern encoding |
135
135
  | ekern | 2@.@bb@-·_·L | Extended Humdrum **kern encoding |
136
136
 
137
- Use the `Encoding` enum class to select the tokenizer:
137
+ Use the `Encoding` enum class to select the encoding:
138
138
 
139
139
  ```python
140
140
  import kernpy as kp
141
141
 
142
142
  doc, _ = kp.load('resource_dir/legacy/chor048.krn')
143
143
 
144
- kern_content = kp.dumps(doc, tokenizer=kp.Encoding.normalizedKern)
145
- ekern_content = kp.dumps(doc, tokenizer=kp.Encoding.eKern)
144
+ kern_content = kp.dumps(doc, encoding=kp.Encoding.normalizedKern)
145
+ ekern_content = kp.dumps(doc, encoding=kp.Encoding.eKern)
146
146
  ```
147
147
 
148
148
  - Use `from_measure` and `to_measure` to select the measures to export. By default, all the measures are exported.
@@ -179,7 +179,7 @@ kp.dump(document, "newfile.krn",
179
179
  spine_types=['**kern'], # Export only the **kern spines
180
180
  include=kp.BEKERN_CATEGORIES, # Token categories to include
181
181
  exclude={kp.TokenCategory.PITCH}, # Token categories to exclude
182
- tokenizer=kp.Encoding.eKern, # Kern encoding
182
+ encoding=kp.Encoding.eKern, # Kern encoding
183
183
  from_measure=1, # First from measure 1
184
184
  to_measure=10, # Last measure exported
185
185
  spine_ids=[0, 1], # Export only the first and the second spine
@@ -282,7 +282,7 @@ for page_label, bounding_box_measure in doc.page_bounding_boxes.items():
282
282
  kp.dump(doc, f"foo_{page_label}.ekrn",
283
283
  spine_types=['**kern'],
284
284
  token_categories=kp.BEKERN_CATEGORIES,
285
- tokenizer=kp.Encoding.eKern,
285
+ encoding=kp.Encoding.eKern,
286
286
  from_measure=bounding_box_measure.from_measure,
287
287
  to_measure=bounding_box_measure.to_measure - 1 # TODO: Check bounds
288
288
  )
@@ -4,10 +4,10 @@
4
4
 
5
5
  Instructions for installing `kernpy` are provided below.
6
6
 
7
- ### Install `kernpy` using `pip`
7
+ ### Install the last version of `kernpy` using `pip`
8
8
 
9
9
  ```bash
10
- pip install kernpy
10
+ pip3 install kernpy --upgrade
11
11
  ```
12
12
 
13
13