kernpy 1.0.0__tar.gz → 1.0.1__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.1}/CONTRIBUTING.md +56 -2
  2. {kernpy-1.0.0 → kernpy-1.0.1}/License +3 -4
  3. {kernpy-1.0.0 → kernpy-1.0.1}/PKG-INFO +76 -80
  4. {kernpy-1.0.0 → kernpy-1.0.1}/README.md +75 -79
  5. {kernpy-1.0.0 → kernpy-1.0.1}/docs/get-started.md +2 -2
  6. {kernpy-1.0.0 → kernpy-1.0.1}/docs/index.md +1 -1
  7. kernpy-1.0.1/kernpy/__init__.py +30 -0
  8. kernpy-1.0.1/kernpy/__main__.py +127 -0
  9. {kernpy-1.0.0 → kernpy-1.0.1}/pyproject.toml +1 -1
  10. kernpy-1.0.1/test/test_main_cli_api.py +120 -0
  11. kernpy-1.0.0/kernpy/__init__.py +0 -215
  12. kernpy-1.0.0/kernpy/__main__.py +0 -217
  13. {kernpy-1.0.0 → kernpy-1.0.1}/.github/workflows/publish-pypi.yml +0 -0
  14. {kernpy-1.0.0 → kernpy-1.0.1}/.github/workflows/run-tests.yml +0 -0
  15. {kernpy-1.0.0 → kernpy-1.0.1}/.github/workflows/update-docs.yml +0 -0
  16. {kernpy-1.0.0 → kernpy-1.0.1}/.gitignore +0 -0
  17. {kernpy-1.0.0 → kernpy-1.0.1}/antlr-4.13.1-complete.jar +0 -0
  18. {kernpy-1.0.0 → kernpy-1.0.1}/antlr4.sh +0 -0
  19. {kernpy-1.0.0 → kernpy-1.0.1}/docs/about.md +0 -0
  20. {kernpy-1.0.0 → kernpy-1.0.1}/docs/assets/001.svg +0 -0
  21. {kernpy-1.0.0 → kernpy-1.0.1}/docs/assets/book.svg +0 -0
  22. {kernpy-1.0.0 → kernpy-1.0.1}/docs/assets/learn.svg +0 -0
  23. {kernpy-1.0.0 → kernpy-1.0.1}/docs/assets/meeting.svg +0 -0
  24. {kernpy-1.0.0 → kernpy-1.0.1}/docs/assets/running.svg +0 -0
  25. {kernpy-1.0.0 → kernpy-1.0.1}/docs/css/extra.css +0 -0
  26. {kernpy-1.0.0 → kernpy-1.0.1}/docs/docs_requirements.txt +0 -0
  27. {kernpy-1.0.0 → kernpy-1.0.1}/docs/get-started/tutorial.md +0 -0
  28. {kernpy-1.0.0 → kernpy-1.0.1}/docs/how-to-guides.md +0 -0
  29. {kernpy-1.0.0 → kernpy-1.0.1}/docs/overrides/partials/footer.html +0 -0
  30. {kernpy-1.0.0 → kernpy-1.0.1}/docs/reference.md +0 -0
  31. {kernpy-1.0.0 → kernpy-1.0.1}/docs/requirements.txt +0 -0
  32. {kernpy-1.0.0 → kernpy-1.0.1}/gen/kernLexer.interp +0 -0
  33. {kernpy-1.0.0 → kernpy-1.0.1}/gen/kernLexer.java +0 -0
  34. {kernpy-1.0.0 → kernpy-1.0.1}/gen/kernLexer.tokens +0 -0
  35. {kernpy-1.0.0 → kernpy-1.0.1}/kern/kernSpineLexer.g4 +0 -0
  36. {kernpy-1.0.0 → kernpy-1.0.1}/kern/kernSpineLexer.tokens +0 -0
  37. {kernpy-1.0.0 → kernpy-1.0.1}/kern/kernSpineParser.g4 +0 -0
  38. {kernpy-1.0.0 → kernpy-1.0.1}/kern/kernSpineParser.tokens +0 -0
  39. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/__init__.py +0 -0
  40. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/_io.py +0 -0
  41. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/base_antlr_importer.py +0 -0
  42. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/base_antlr_spine_parser_listener.py +0 -0
  43. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/basic_spine_importer.py +0 -0
  44. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/document.py +0 -0
  45. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/dyn_importer.py +0 -0
  46. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/dynam_spine_importer.py +0 -0
  47. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/error_listener.py +0 -0
  48. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/exporter.py +0 -0
  49. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/fing_spine_importer.py +0 -0
  50. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineLexer.interp +0 -0
  51. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineLexer.py +0 -0
  52. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineLexer.tokens +0 -0
  53. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineParser.interp +0 -0
  54. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineParser.py +0 -0
  55. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineParser.tokens +0 -0
  56. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineParserListener.py +0 -0
  57. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generated/kernSpineParserVisitor.py +0 -0
  58. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/generic.py +0 -0
  59. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/gkern.py +0 -0
  60. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/graphviz_exporter.py +0 -0
  61. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/harm_spine_importer.py +0 -0
  62. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/import_humdrum_old.py +0 -0
  63. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/importer.py +0 -0
  64. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/importer_factory.py +0 -0
  65. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/kern_spine_importer.py +0 -0
  66. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/mens_spine_importer.py +0 -0
  67. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/mhxm_spine_importer.py +0 -0
  68. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/pitch_models.py +0 -0
  69. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/root_spine_importer.py +0 -0
  70. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/spine_importer.py +0 -0
  71. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/text_spine_importer.py +0 -0
  72. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/tokenizers.py +0 -0
  73. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/tokens.py +0 -0
  74. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/core/transposer.py +0 -0
  75. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/io/__init__.py +0 -0
  76. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/io/public.py +0 -0
  77. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/polish_scores/__init__.py +0 -0
  78. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/polish_scores/download_polish_dataset.py +0 -0
  79. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/polish_scores/iiif.py +0 -0
  80. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/test_grammar.sh +0 -0
  81. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/util/__init__.py +0 -0
  82. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/util/helpers.py +0 -0
  83. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/util/store_cache.py +0 -0
  84. {kernpy-1.0.0 → kernpy-1.0.1}/kernpy/visualize_analysis.sh +0 -0
  85. {kernpy-1.0.0 → kernpy-1.0.1}/legacy-parsers-not-used/kernLexer.g4 +0 -0
  86. {kernpy-1.0.0 → kernpy-1.0.1}/legacy-parsers-not-used/kernParser.g4 +0 -0
  87. {kernpy-1.0.0 → kernpy-1.0.1}/mkdocs.yml +0 -0
  88. {kernpy-1.0.0 → kernpy-1.0.1}/requirements.txt +0 -0
  89. {kernpy-1.0.0 → kernpy-1.0.1}/test/__init__.py +0 -0
  90. {kernpy-1.0.0 → kernpy-1.0.1}/test/pytest.ini +0 -0
  91. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/all.krn +0 -0
  92. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/all_less_decorators.krn +0 -0
  93. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/all_less_durations.krn +0 -0
  94. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/all_less_note_rest.krn +0 -0
  95. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/all_less_pitches.krn +0 -0
  96. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/concerto-piano-12-allegro_with_all.krn +0 -0
  97. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/concerto-piano-12-allegro_without_barlines.krn +0 -0
  98. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/concerto-piano-12-allegro_without_harmony.krn +0 -0
  99. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/concerto-piano-12-allegro_without_only_signatures.krn +0 -0
  100. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/empty.krn +0 -0
  101. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/only_barlines.krn +0 -0
  102. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/only_decorators.krn +0 -0
  103. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/only_durations.krn +0 -0
  104. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/categories/only_pitches.krn +0 -0
  105. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_0.krn +0 -0
  106. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_0_merged.krn +0 -0
  107. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_1.krn +0 -0
  108. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_10.krn +0 -0
  109. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_10_merged.krn +0 -0
  110. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_11.krn +0 -0
  111. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_11_merged.krn +0 -0
  112. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_1_merged.krn +0 -0
  113. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_2.krn +0 -0
  114. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_2_merged.krn +0 -0
  115. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_3.krn +0 -0
  116. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_3_merged.krn +0 -0
  117. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_4.krn +0 -0
  118. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_4_merged.krn +0 -0
  119. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_5.krn +0 -0
  120. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_5_merged.krn +0 -0
  121. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_6.krn +0 -0
  122. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_7.krn +0 -0
  123. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_7_merged.krn +0 -0
  124. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_8.krn +0 -0
  125. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_8_merged.krn +0 -0
  126. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_9.krn +0 -0
  127. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/concat/0_9_merged.krn +0 -0
  128. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/input/sub/chor001.krn +0 -0
  129. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/input/sub/chor002.krn +0 -0
  130. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-1-to-3.krn +0 -0
  131. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-10-to-12.krn +0 -0
  132. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-11-to-13.krn +0 -0
  133. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-12-to-14.krn +0 -0
  134. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-13-to-15.krn +0 -0
  135. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-14-to-16.krn +0 -0
  136. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-15-to-17.krn +0 -0
  137. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-16-to-18.krn +0 -0
  138. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-17-to-19.krn +0 -0
  139. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-18-to-20.krn +0 -0
  140. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-19-to-21.krn +0 -0
  141. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-2-to-4.krn +0 -0
  142. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-20-to-22.krn +0 -0
  143. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-21-to-23.krn +0 -0
  144. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-22-to-24.krn +0 -0
  145. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-3-to-5.krn +0 -0
  146. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-4-to-6.krn +0 -0
  147. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-5-to-7.krn +0 -0
  148. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-6-to-8.krn +0 -0
  149. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-7-to-9.krn +0 -0
  150. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-8-to-10.krn +0 -0
  151. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor001/from-9-to-11.krn +0 -0
  152. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor002/from-1-to-5.krn +0 -0
  153. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor002/from-2-to-6.krn +0 -0
  154. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor002/from-3-to-7.krn +0 -0
  155. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor002/from-4-to-8.krn +0 -0
  156. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/fragments/output/chor002/from-5-to-9.krn +0 -0
  157. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/grandstaff/5901766-m24-to-m28.ekrn +0 -0
  158. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/grandstaff/5901766.krn +0 -0
  159. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/hierarchy/tree.txt +0 -0
  160. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/kern-scores/beethoven_sonata_12_4.krn +0 -0
  161. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/base_tuplet.ekrn +0 -0
  162. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/base_tuplet.krn +0 -0
  163. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/base_tuplet_longer.krn +0 -0
  164. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/base_tuplet_longer_m2-m4.ekrn +0 -0
  165. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/base_tuplet_longer_m2-m4.krn +0 -0
  166. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/base_tuplet_longer_m3-m3.krn +0 -0
  167. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/base_tuplet_longer_plus_octave.krn +0 -0
  168. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001-all_tokens.txt +0 -0
  169. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001-m1-to-m3.ekrn +0 -0
  170. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001-metadata-generic.txt +0 -0
  171. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001-unique_tokens.txt +0 -0
  172. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001-unique_tokens_with_category.txt +0 -0
  173. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001-unique_tokens_without_measure_numbers.txt +0 -0
  174. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001.ekrn +0 -0
  175. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor001.krn +0 -0
  176. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor009.krn +0 -0
  177. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/chor048.krn +0 -0
  178. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide02-example2-1.ekrn +0 -0
  179. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide02-example2-1.krn +0 -0
  180. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide02-example2-2.ekrn +0 -0
  181. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide02-example2-3.ekrn +0 -0
  182. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide02-example2-3.krn +0 -0
  183. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide02-example2-4.ekrn +0 -0
  184. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide02-example2-4.krn +0 -0
  185. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide06-example6-1.ekrn +0 -0
  186. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide06-example6-1.krn +0 -0
  187. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide06-example6-2.ekrn +0 -0
  188. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/guide06-example6-2.krn +0 -0
  189. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/kern2ekern.ekrn +0 -0
  190. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/kern2ekern.krn +0 -0
  191. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/spines_lexer.ekrn +0 -0
  192. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/spines_lexer.krn +0 -0
  193. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/spline_split.krn +0 -0
  194. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/spline_split_piston070.ekrn +0 -0
  195. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/legacy/spline_split_piston070.krn +0 -0
  196. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/metadata/frequency.json +0 -0
  197. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/mozart/concerto-piano-12-allegro-left-hand.krn +0 -0
  198. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/mozart/concerto-piano-12-allegro-right-hand-and-dyn.krn +0 -0
  199. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/mozart/concerto-piano-12-allegro-right-hand.krn +0 -0
  200. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/mozart/concerto-piano-12-allegro.krn +0 -0
  201. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/mozart/divertimento-quartet.krn +0 -0
  202. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pages/10.ekrn +0 -0
  203. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pages/10.jpg +0 -0
  204. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pages/11.ekrn +0 -0
  205. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pages/11.jpg +0 -0
  206. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pages/9.ekrn +0 -0
  207. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pages/9.jpg +0 -0
  208. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m16.ekrn +0 -0
  209. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m2.ekrn +0 -0
  210. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante-m1-to-m3.ekrn +0 -0
  211. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/polish/test1/pl-wn--mus-iii-118-771--003_badarzewska-tekla--mazurka-brillante.krn +0 -0
  212. {kernpy-1.0.0 → kernpy-1.0.1}/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
  213. {kernpy-1.0.0 → kernpy-1.0.1}/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
  214. {kernpy-1.0.0 → kernpy-1.0.1}/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
  215. {kernpy-1.0.0 → kernpy-1.0.1}/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
  216. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/any_header.krn +0 -0
  217. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/bach-brandenburg-bwv1050a.krn +0 -0
  218. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/bach-chorale-chor205.krn +0 -0
  219. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/corelli-op01n12d.krn +0 -0
  220. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/harmonized-song-erk052.krn +0 -0
  221. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/haydn-quartet-op54n2-01.krn +0 -0
  222. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/haydn-sonate-15_1-original.krn +0 -0
  223. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/haydn-sonate-15_1-output.krn +0 -0
  224. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/jazzmus_with_mxhm.krn +0 -0
  225. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/permutations_of_2.bb-_ .krn +0 -0
  226. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/piano-beethoven-sonata21-3.krn +0 -0
  227. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/piano-chopin-prelude28-17.krn +0 -0
  228. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/piano-hummel-prelude67-15.krn +0 -0
  229. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/piano-joplin-bethena.krn +0 -0
  230. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/piano-mozart-sonata07-3.krn +0 -0
  231. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/piano-scarlatti-L523K205.krn +0 -0
  232. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/quartet-beethoven-quartet13-6.krn +0 -0
  233. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/quartet-mozart-k590-04.krn +0 -0
  234. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/score_with_dividing_one_spine.krn +0 -0
  235. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/score_with_dividing_one_spine_m9-m13.krn +0 -0
  236. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/score_with_dividing_two_spines.krn +0 -0
  237. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/score_with_dividing_two_spines_m49-m56.krn +0 -0
  238. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/unaccompanied-songs-nova073.krn +0 -0
  239. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/unexpected_header.krn +0 -0
  240. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/wrong_header.krn +0 -0
  241. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/wrong_number_of_columns.krn +0 -0
  242. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/samples/wrong_number_of_columns_fixed.krn +0 -0
  243. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/1.krn +0 -0
  244. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/2-m2-to-m2.ekrn +0 -0
  245. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/2.krn +0 -0
  246. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/3.krn +0 -0
  247. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/4.krn +0 -0
  248. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/5.krn +0 -0
  249. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/concerto-piano-12-allegro_only_kern_and_harm.krn +0 -0
  250. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/non_stacked_ends.krn +0 -0
  251. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/non_stacked_ends_2.krn +0 -0
  252. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/spines-from-piano-joplin-bethena-start.krn +0 -0
  253. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/spines/spines-piano-hummel-prelude67-15.krn +0 -0
  254. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/accidentals.krn +0 -0
  255. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/accidentals_alteration_display.krn +0 -0
  256. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/articulations.krn +0 -0
  257. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/auto_beaming.krn +0 -0
  258. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/bars.krn +0 -0
  259. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/beaming.krn +0 -0
  260. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/chords.krn +0 -0
  261. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/clefs.krn +0 -0
  262. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/headers.krn +0 -0
  263. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/key.krn +0 -0
  264. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/key_designation.krn +0 -0
  265. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/mensurations.krn +0 -0
  266. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/minimal.krn +0 -0
  267. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/minimal_incorrect.krn +0 -0
  268. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/modal.krn +0 -0
  269. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/octaves.krn +0 -0
  270. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/ornaments.krn +0 -0
  271. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/rests.krn +0 -0
  272. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/rhythm.krn +0 -0
  273. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/slurs.krn +0 -0
  274. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/ties.krn +0 -0
  275. {kernpy-1.0.0 → kernpy-1.0.1}/test/resource_dir/unit/time.krn +0 -0
  276. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_deprecated.py +0 -0
  277. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_document.py +0 -0
  278. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_download_polish_scores.py +0 -0
  279. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_export_options.py +0 -0
  280. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_exporter.py +0 -0
  281. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_generic.py +0 -0
  282. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_gkern.py +0 -0
  283. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_humdrum_importer.py +0 -0
  284. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_importer.py +0 -0
  285. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_root_spine_root.py +0 -0
  286. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_imoprter_dynam.py +0 -0
  287. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_importer_basic.py +0 -0
  288. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_importer_dyn.py +0 -0
  289. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_importer_fing.py +0 -0
  290. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_importer_harm.py +0 -0
  291. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_importer_kern.py +0 -0
  292. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_importer_mxhm.py +0 -0
  293. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_spine_importer_text.py +0 -0
  294. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_token.py +0 -0
  295. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_tokenizer.py +0 -0
  296. {kernpy-1.0.0 → kernpy-1.0.1}/test/test_transposer.py +0 -0
  297. {kernpy-1.0.0 → kernpy-1.0.1}/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.1
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,6 +169,9 @@ 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
177
  - Use `tokenizer` to select how the categories are split. By default, the `normalizedKern` tokenizer is used.
@@ -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,6 +150,9 @@ 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
158
  - Use `tokenizer` to select how the categories are split. By default, the `normalizedKern` tokenizer is used.
@@ -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
@@ -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
 
@@ -1,7 +1,7 @@
1
1
  <h1>
2
2
  <b>kernpy documentation</b>
3
3
  </h1>
4
- <b>Date:</b> <script>document.write(new Date().toLocaleDateString("en-US", {year: 'numeric', month: 'short', day: '2-digit'}));</script> &nbsp;|&nbsp; <b>Version:</b> 0.1.2
4
+ <b>Date:</b> <script>document.write(new Date().toLocaleDateString("en-US", {year: 'numeric', month: 'short', day: '2-digit'}));</script> &nbsp;
5
5
 
6
6
  <b>Download documentation:</b> [Zipped HTML](https://github.com/OMR-PRAIG-UA-ES/kernpy/archive/refs/heads/gh-pages.zip)
7
7
 
@@ -0,0 +1,30 @@
1
+ """
2
+ # kernpy
3
+
4
+ =====
5
+
6
+
7
+ Python Humdrum **kern and **mens utilities package.
8
+
9
+
10
+
11
+ Execute the following command to run **kernpy** as a module:
12
+ ```shell
13
+ python -m kernpy --help
14
+ python -m kernpy <command> <options>
15
+ ```
16
+ """
17
+
18
+
19
+ from .core import *
20
+
21
+ from .io import *
22
+
23
+ from .util import *
24
+
25
+ from .polish_scores import *
26
+
27
+
28
+
29
+
30
+
@@ -0,0 +1,127 @@
1
+ """
2
+ This module contains the main function for the kernpy package.
3
+
4
+ Usage:
5
+ python -m kernpy
6
+ """
7
+
8
+ import argparse
9
+ import sys
10
+ from pathlib import Path
11
+
12
+ from kernpy import polish_scores, ekern_to_krn, kern_to_ekern
13
+
14
+
15
+ def create_parser() -> argparse.ArgumentParser:
16
+ parser = argparse.ArgumentParser(description="kernpy CLI tool")
17
+
18
+ parser.add_argument('--verbose', type=int, default=1, help='Verbosity level')
19
+
20
+ group = parser.add_mutually_exclusive_group(required=True)
21
+ group.add_argument('--ekern2kern', action='store_true', help='Convert files from ekern to kern')
22
+ group.add_argument('--kern2ekern', action='store_true', help='Convert files from kern to ekern')
23
+ group.add_argument('--polish', action='store_true', help='Run Polish Exporter')
24
+ group.add_argument('--generate_fragments', action='store_true', help='Generate Fragments')
25
+
26
+ parser.add_argument('--input_path', type=str, help='Input file or directory')
27
+ parser.add_argument('--output_path', type=str, help='Output file or directory')
28
+ parser.add_argument('-r', '--recursive', action='store_true', help='Enable recursive directory processing')
29
+
30
+ # Polish Exporter
31
+ parser.add_argument('--input_directory', type=str, help='Polish: Input directory')
32
+ parser.add_argument('--output_directory', type=str, help='Polish: Output directory')
33
+ parser.add_argument('--instrument', type=str, help='Polish: Instrument name')
34
+ parser.add_argument('--kern_type', type=str, help='Polish: "krn" or "ekrn"')
35
+ parser.add_argument('--kern_spines_filter', type=str, help='Polish: Filter for number of kern spines')
36
+ parser.add_argument('--remove_empty_dirs', action='store_true', help='Polish: Remove empty directories')
37
+
38
+
39
+ return parser
40
+
41
+
42
+ def find_files(directory: Path, patterns: list[str], recursive: bool = False) -> list[Path]:
43
+ files = []
44
+ for pattern in patterns:
45
+ if recursive:
46
+ files.extend(directory.rglob(pattern))
47
+ else:
48
+ files.extend(directory.glob(pattern))
49
+ return files
50
+
51
+
52
+ def handle_ekern2kern(args):
53
+ input_path = Path(args.input_path)
54
+ output_path = Path(args.output_path) if args.output_path else None
55
+
56
+ if input_path.is_file():
57
+ out = output_path or input_path.with_suffix(".krn")
58
+ ekern_to_krn(str(input_path), str(out))
59
+ if args.verbose:
60
+ print(f"Converted: {input_path} → {out}")
61
+ return
62
+
63
+ files = find_files(input_path, ["*.ekrn", "*.ekern"], recursive=args.recursive)
64
+ for file in files:
65
+ out = file.with_suffix(".krn")
66
+ try:
67
+ ekern_to_krn(str(file), str(out))
68
+ if args.verbose:
69
+ print(f"Converted: {file} → {out}")
70
+ except Exception as e:
71
+ print(f"Error converting {file}: {e}", file=sys.stderr)
72
+
73
+
74
+ def handle_kern2ekern(args):
75
+ input_path = Path(args.input_path)
76
+ output_path = Path(args.output_path) if args.output_path else None
77
+
78
+ if input_path.is_file():
79
+ out = output_path or input_path.with_suffix(".ekrn")
80
+ kern_to_ekern(str(input_path), str(out))
81
+ if args.verbose:
82
+ print(f"Converted: {input_path} → {out}")
83
+ return
84
+
85
+ files = find_files(input_path, ["*.krn", "*.kern"], recursive=args.recursive)
86
+ for file in files:
87
+ out = file.with_suffix(".ekrn")
88
+ try:
89
+ kern_to_ekern(str(file), str(out))
90
+ if args.verbose:
91
+ print(f"Converted: {file} → {out}")
92
+ except Exception as e:
93
+ print(f"Error converting {file}: {e}", file=sys.stderr)
94
+
95
+
96
+ def handle_polish_exporter(args):
97
+ if args.verbose:
98
+ print(f"Running Polish Exporter on {args.input_directory} → {args.output_directory}")
99
+
100
+ polish_scores.download_polish_dataset.main(
101
+ input_directory=args.input_directory,
102
+ output_directory=args.output_directory,
103
+ kern_spines_filter=args.kern_spines_filter,
104
+ exporter_kern_type=args.kern_type,
105
+ remove_empty_directories=args.remove_empty_dirs,
106
+ )
107
+
108
+
109
+ def main():
110
+ parser = create_parser()
111
+ args = parser.parse_args()
112
+
113
+ if args.verbose > 2:
114
+ print("Arguments:")
115
+ for key, val in vars(args).items():
116
+ print(f" {key}: {val}")
117
+
118
+ if args.ekern2kern:
119
+ handle_ekern2kern(args)
120
+ elif args.kern2ekern:
121
+ handle_kern2ekern(args)
122
+ elif args.polish:
123
+ handle_polish_exporter(args)
124
+
125
+
126
+ if __name__ == "__main__":
127
+ main()