kitconc 3.4.4__tar.gz → 4.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 (145) hide show
  1. kitconc-4.0.1/CHANGES.txt +101 -0
  2. {kitconc-3.4.4 → kitconc-4.0.1}/MANIFEST.in +4 -4
  3. kitconc-4.0.1/PKG-INFO +213 -0
  4. kitconc-4.0.1/README.txt +183 -0
  5. {kitconc-3.4.4 → kitconc-4.0.1}/embeddings/sqlite_vec_search.py +1 -1
  6. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/agent/actions.py +555 -32
  7. kitconc-4.0.1/kitconc/agent/corpus_tools.py +520 -0
  8. kitconc-4.0.1/kitconc/agent/expressions.py +465 -0
  9. kitconc-4.0.1/kitconc/agent/guides/expressions.md +42 -0
  10. kitconc-4.0.1/kitconc/agent/guides/measures.md +48 -0
  11. kitconc-4.0.1/kitconc/agent/guides/overview.md +58 -0
  12. kitconc-4.0.1/kitconc/agent/guides/pipelines.md +64 -0
  13. kitconc-4.0.1/kitconc/agent/guides/recipes.md +74 -0
  14. kitconc-4.0.1/kitconc/agent/guides/terminology.md +46 -0
  15. kitconc-4.0.1/kitconc/agent/jobs.py +210 -0
  16. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/agent/mcp_server.py +73 -4
  17. kitconc-4.0.1/kitconc/agent/pipeline.py +322 -0
  18. kitconc-4.0.1/kitconc/agent/progress.py +75 -0
  19. kitconc-4.0.1/kitconc/agent/recipes/collocation-entry.json +28 -0
  20. kitconc-4.0.1/kitconc/agent/recipes/compare-corpora.json +29 -0
  21. kitconc-4.0.1/kitconc/agent/recipes/corpus-profile.json +22 -0
  22. kitconc-4.0.1/kitconc/agent/recipes/corpus-qa.json +19 -0
  23. kitconc-4.0.1/kitconc/agent/recipes/glossary-candidates.json +25 -0
  24. kitconc-4.0.1/kitconc/agent/recipes/glossary-contrastive.json +31 -0
  25. kitconc-4.0.1/kitconc/agent/recipes/keyword-report.json +22 -0
  26. kitconc-4.0.1/kitconc/agent/recipes/lexical-bundles.json +23 -0
  27. kitconc-4.0.1/kitconc/agent/recipes/synonym-comparison.json +22 -0
  28. kitconc-4.0.1/kitconc/agent/recipes/word-frequency-comparison.json +19 -0
  29. kitconc-4.0.1/kitconc/agent/recipes/word-profile.json +25 -0
  30. kitconc-4.0.1/kitconc/agent/recipes.py +134 -0
  31. kitconc-4.0.1/kitconc/agent/resources.py +242 -0
  32. kitconc-4.0.1/kitconc/agent/result_ops.py +397 -0
  33. kitconc-4.0.1/kitconc/agent/results.py +263 -0
  34. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/agent/schemas.py +1 -0
  35. kitconc-4.0.1/kitconc/agent/skill/kitconc/SKILL.md +124 -0
  36. kitconc-4.0.1/kitconc/agent/skill/kitconc/references/expressions.md +51 -0
  37. kitconc-4.0.1/kitconc/agent/skill/kitconc/references/pipelines.md +99 -0
  38. kitconc-4.0.1/kitconc/agent/skill/kitconc/references/python-api.md +49 -0
  39. kitconc-4.0.1/kitconc/agent/skill/kitconc-recipe-author/SKILL.md +60 -0
  40. kitconc-4.0.1/kitconc/agent/skill_installer.py +78 -0
  41. kitconc-4.0.1/kitconc/agent/tagsets.py +221 -0
  42. kitconc-4.0.1/kitconc/agent/tool_cli.py +105 -0
  43. kitconc-4.0.1/kitconc/agent/tools.py +920 -0
  44. kitconc-4.0.1/kitconc/archive.py +123 -0
  45. kitconc-4.0.1/kitconc/data/pos_tagger_english.pickle +0 -0
  46. kitconc-4.0.1/kitconc/data/pos_tagger_portuguese.pickle +0 -0
  47. kitconc-4.0.1/kitconc/data/sent_tokenizer_english.pickle +0 -0
  48. kitconc-4.0.1/kitconc/data/sent_tokenizer_portuguese.pickle +0 -0
  49. kitconc-4.0.1/kitconc/data/word_tokenizer_english.pickle +0 -0
  50. kitconc-4.0.1/kitconc/data/word_tokenizer_portuguese.pickle +0 -0
  51. kitconc-4.0.1/kitconc/export_corpus.py +49 -0
  52. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_app.py +349 -552
  53. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_cmd.py +284 -84
  54. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_corpus.py +754 -124
  55. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_models.py +16 -17
  56. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_plots.py +133 -0
  57. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_tools.py +88 -1
  58. kitconc-4.0.1/kitconc/kit_util.py +575 -0
  59. kitconc-4.0.1/kitconc/nlp.py +91 -0
  60. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_collocates.py +18 -4
  61. kitconc-4.0.1/kitconc/py_extras.py +476 -0
  62. kitconc-4.0.1/kitconc/py_measures.py +264 -0
  63. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_ngrams.py +20 -15
  64. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_wordlist.py +10 -2
  65. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/tagged.py +14 -8
  66. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/tagging.py +15 -8
  67. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/version.py +1 -1
  68. kitconc-4.0.1/kitconc.egg-info/PKG-INFO +213 -0
  69. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc.egg-info/SOURCES.txt +45 -4
  70. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc.egg-info/entry_points.txt +2 -0
  71. kitconc-4.0.1/kitconc.egg-info/requires.txt +20 -0
  72. kitconc-4.0.1/kitconc.egg-info/top_level.txt +6 -0
  73. kitconc-4.0.1/pyproject.toml +71 -0
  74. kitconc-4.0.1/tests/test_agent_cli_and_skill.py +90 -0
  75. kitconc-4.0.1/tests/test_agent_mcp_server.py +238 -0
  76. kitconc-4.0.1/tests/test_agent_workflows.py +474 -0
  77. kitconc-4.0.1/tests/test_analysis_features.py +270 -0
  78. kitconc-4.0.1/tests/test_corpus_ingestion.py +104 -0
  79. kitconc-4.0.1/tests/test_legacy_reliability.py +128 -0
  80. kitconc-4.0.1/tests/test_nlp.py +23 -0
  81. kitconc-3.4.4/CHANGES.txt +0 -13
  82. kitconc-3.4.4/PKG-INFO +0 -167
  83. kitconc-3.4.4/README.txt +0 -130
  84. kitconc-3.4.4/kitconc/data/pos_tagger_english.pickle +0 -0
  85. kitconc-3.4.4/kitconc/data/pos_tagger_portuguese.pickle +0 -0
  86. kitconc-3.4.4/kitconc/data/sent_tokenizer_english.pickle +0 -0
  87. kitconc-3.4.4/kitconc/data/sent_tokenizer_portuguese.pickle +0 -0
  88. kitconc-3.4.4/kitconc/data/word_tokenizer_english.pickle +0 -0
  89. kitconc-3.4.4/kitconc/data/word_tokenizer_portuguese.pickle +0 -0
  90. kitconc-3.4.4/kitconc/export_corpus.py +0 -27
  91. kitconc-3.4.4/kitconc/kit_util.py +0 -328
  92. kitconc-3.4.4/kitconc.egg-info/PKG-INFO +0 -167
  93. kitconc-3.4.4/kitconc.egg-info/requires.txt +0 -17
  94. kitconc-3.4.4/kitconc.egg-info/top_level.txt +0 -3
  95. kitconc-3.4.4/pyproject.toml +0 -10
  96. kitconc-3.4.4/requirements.txt +0 -32
  97. kitconc-3.4.4/setup.py +0 -54
  98. kitconc-3.4.4/tests/__init__.py +0 -0
  99. kitconc-3.4.4/tests/conftest.py +0 -107
  100. kitconc-3.4.4/tests/test_agent_mcp_server.py +0 -62
  101. {kitconc-3.4.4 → kitconc-4.0.1}/LICENSE.txt +0 -0
  102. {kitconc-3.4.4 → kitconc-4.0.1}/embeddings/__init__.py +0 -0
  103. {kitconc-3.4.4 → kitconc-4.0.1}/embeddings/chunker.py +0 -0
  104. {kitconc-3.4.4 → kitconc-4.0.1}/embeddings/util.py +0 -0
  105. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/__init__.py +0 -0
  106. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/agent/__init__.py +0 -0
  107. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/cli_app.py +0 -0
  108. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/core.py +0 -0
  109. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/gui_lang.pickle +0 -0
  110. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/gui_lang_default.pickle +0 -0
  111. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/excel.png +0 -0
  112. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/python.png +0 -0
  113. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/python3.ico +0 -0
  114. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/python3_b.ico +0 -0
  115. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/python_b.png +0 -0
  116. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/script.png +0 -0
  117. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/text.png +0 -0
  118. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/images/tool.png +0 -0
  119. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/lemmas_english.tab +0 -0
  120. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/reflist_english.tab +0 -0
  121. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/reflist_no-tagging.tab +0 -0
  122. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/reflist_portuguese.tab +0 -0
  123. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/scripts/hello.py +0 -0
  124. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/stoplist_english.tab +0 -0
  125. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/stoplist_no-tagging.tab +0 -0
  126. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/stoplist_portuguese.tab +0 -0
  127. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/data/ubuntu.ttf +0 -0
  128. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/indexing.py +0 -0
  129. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_app_language.py +0 -0
  130. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_data.py +0 -0
  131. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/kit_spacy.py +0 -0
  132. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/npyarrays.py +0 -0
  133. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_clusters.py +0 -0
  134. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_concordance.py +0 -0
  135. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_dispersion.py +0 -0
  136. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_keywords.py +0 -0
  137. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_keywords_dispersion.py +0 -0
  138. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_kwic.py +0 -0
  139. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_wfreqinfiles.py +0 -0
  140. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc/py_wtfreq.py +0 -0
  141. {kitconc-3.4.4 → kitconc-4.0.1}/kitconc.egg-info/dependency_links.txt +0 -0
  142. {kitconc-3.4.4 → kitconc-4.0.1}/setup.cfg +0 -0
  143. {kitconc-3.4.4 → kitconc-4.0.1}/tests/test_py_keywords.py +0 -0
  144. {kitconc-3.4.4 → kitconc-4.0.1}/tests/test_py_ngrams.py +0 -0
  145. {kitconc-3.4.4 → kitconc-4.0.1}/tests/test_py_wordlist.py +0 -0
@@ -0,0 +1,101 @@
1
+ Version 4.0.1
2
+ -------------
3
+ - 2026-10-11
4
+ - Added the `kitconc-recipe-author` Agent Skill to guide users through designing, validating,
5
+ running, and saving custom recipes. `kitconc-skill install` now installs it alongside the
6
+ general Kitconc skill for Claude and Codex.
7
+ - Expanded recipe authoring documentation and included the new skill in source and wheel packages.
8
+
9
+ Version 4.0.0
10
+ -------------
11
+ - 2026-10-11
12
+ - Breaking (MCP): `kitconc-mcp` now exposes a curated, agent-oriented tool set instead of one tool per
13
+ `KitconcActions` method. Tools are grouped and renamed (`analyze_wordlist`, `corpus_create`, `result_export`...),
14
+ take an explicit `corpus` instead of a selected corpus, and return a `result_id` with one page of rows. Run
15
+ `kitconc-mcp --tool-set legacy` to keep the 3.x tools; see "Migrating from 3.x" in docs/MCP.md. The Python API
16
+ (`Corpus`, `KitconcActions`) is unchanged.
17
+ - MCP: analysis results are stored on the server (persisted in `<workspace>/.kitconc_results`) and can be paged,
18
+ filtered, derived with a safe expression language (`per_million`, `log_likelihood`, `log_ratio`, `c_value`...),
19
+ joined, combined, aggregated, enriched with corpus evidence (examples, definitions, dispersion, collocates) and
20
+ exported without sending rows through the conversation.
21
+ - MCP: new tools `corpus_tagset`, `corpus_qa`, `subcorpus_create`, `term_candidates` (tagset-agnostic term
22
+ extraction for Brown/Penn, Universal POS/spaCy, Mac-Morpho and untagged corpora), `context_mine` and `text_stats`.
23
+ - MCP: declarative pipelines (`pipeline_run`), 11 built-in editable recipes (glossary candidates, domain-specific
24
+ glossaries, corpus comparison, word profiles, near-synonyms, collocation entries, lexical bundles, keyword report,
25
+ corpus profile, word frequencies across corpora, corpus QA), user recipes and background jobs with progress and
26
+ cancellation.
27
+ - MCP: tool annotations, structured errors with hints, server instructions, resources (`kitconc://...`), one prompt
28
+ per recipe plus `plan-analysis`, argument completion, built-in guides, `--read-only`, `--disk-capacity` and
29
+ `--job-workers` options.
30
+ - Agents: `kitconc-tool` runs every agent tool from the command line (JSON in, JSON out), and
31
+ `kitconc-skill install` installs the Kitconc skill for Claude (~/.claude/skills) and Codex (~/.agents/skills).
32
+ - Redesigned README with the new logo and a guide to using Kitconc with AI assistants.
33
+ - Fixed corpus creation tokenizing binary files found in the source folder (e.g. SQLite databases); they are now
34
+ skipped with a warning.
35
+ - Fixed info.tab metadata written without a final newline, which merged fields such as
36
+ "encoding: utf-8Textfiles: 98"; existing files are repaired when read.
37
+ - Tabular `KitconcActions` methods also return `columns`.
38
+ - Updated pyjwt, pypdf, torch (optional "full" extra) and urllib3.
39
+ - Added a test workflow on every push and pull request (Ubuntu and Windows, Python 3.10 and 3.12).
40
+ - Added advanced analysis options (all optional; default results are unchanged):
41
+ - Keywords against another corpus of the workspace (`ref_corpus`), effect sizes (Log Ratio, Dice, LogDice, MI, MI3,
42
+ RRF, DRF, z, t, %DIFF, odds ratio), negative keywords (`polarity`), p-value thresholds with optional Bonferroni
43
+ correction, two-term log-likelihood, chi-square with Yates correction and Text Dispersion Keyness.
44
+ - Collocates with 13 association measures (`measure`), extra measure columns (`extra_measures`), `min_freq`,
45
+ stoplists and allowlists.
46
+ - KWIC/concordance wildcards (`* ? + | [a,b]`), context search (AND/OR, exclusion), random samples and KWIC
47
+ pattern frequency (`Kwic.kpf()`); `Kwic.hide_node()` for gap-fill exercises.
48
+ - Clusters of any size with the search word on the left or right (`position`).
49
+ - N-gram search filter and p-frames (n-grams with open slots, with variants, TTR and entropy).
50
+ - Dispersion statistics (Range, SD, CV, Juilland's D, Gries' DP) in `dispersion()` and `dispersion_measures()`;
51
+ optional RANGE/JUILLAND_D/DP columns in `wordlist(dispersion=True)`.
52
+ - Lemma lists (`lemmalist()`), file view (`fileview()`) and word clouds (`wordcloud()`).
53
+ - Stoplists/allowlists (lists, files or 'default') in wordlist, keywords, collocates, clusters and n-grams.
54
+ - New CLI commands `pframes`, `lemmalist`, `dispersion_measures`, `fileview` and `wordcloud`, new flags for existing
55
+ commands, and matching MCP tools.
56
+ - Corpus creation converts DOCX, ODT, EPUB, HTML/XHTML and XML files to text.
57
+ - Fixed `wordlist(lowercase=False)`, which raised an error.
58
+ - Fixed `dispersion()` for search terms without hits, which raised an error.
59
+ - Fixed the CLI/GUI `keywords --measure tf-idf`, which silently used log-likelihood.
60
+ - Added an MCP export tool for analysis results in `.tab`, `.tsv`, and `.xlsx` formats.
61
+ - Added MCP tools to build per-corpus semantic embedding indexes and inspect their status; semantic search now selects the active corpus index by default.
62
+ - Improved filesystem-based corpus creation for source paths containing spaces and rejected unsafe or colliding corpus names.
63
+ - Corpus processing now checks tagging and indexing process results, restores existing indexes after failure, cleans temporary files, and records text counts without duplicate metadata rows.
64
+ - Corpus imports now validate ZIP contents and extract through a temporary directory; remote imports enforce timeouts and download limits.
65
+ - Corpus exports are written atomically, and Tkinter corpus and analysis tasks now deliver results to the main UI thread.
66
+
67
+ Version 3.5.1
68
+ -------------
69
+ - 2026-09-05
70
+ - Migrated dependency management, development setup, CI, and Docker workflows to uv with a committed uv.lock file.
71
+
72
+ Version 3.5.0
73
+ 2026-09-05
74
+ - Replaced the NLTK-based tokenization and POS-tagging runtime with built-in components and converted bundled models.
75
+ - Added dependency-free NLP regression tests.
76
+
77
+ Version 3.4.6
78
+ 2026-09-05
79
+ - Updated Pillow and cryptography dependency floors to security-fixed releases.
80
+ - Replaced the NLTK-based corpus tokenization and tagging pipeline with built-in components.
81
+
82
+ Version 3.4.5
83
+ 2026-09-05
84
+ - Fixed MCP stdio regression coverage for Windows and other platforms.
85
+ - Declared the supported Python version in package metadata.
86
+ - Removed NumPy scalar-conversion deprecation warnings from n-gram processing.
87
+ - Added automated test execution to the release workflow.
88
+
89
+ Version 3.4.4
90
+ 2026-04-10
91
+ - Added Docker installation/runtime option (`Dockerfile` and `.dockerignore`).
92
+ - Expanded README with complete MCP tools reference, prompt suggestions, and usage flows.
93
+
94
+ Version 3.4.3
95
+ 2026-04-06
96
+ - Updated README requirements to match setup.py package dependencies.
97
+ - Documented additional full-environment dependencies from requirements.txt.
98
+
99
+ Version 3.0.3
100
+ 2025-04-21
101
+ - Added examples.
@@ -1,10 +1,10 @@
1
1
  include *.txt
2
- recursive-include docs *.txt
3
- include kitconc/*.c
4
2
  include kitconc/data/*.tab
5
- include kitconc/data/*.exe
6
3
  include kitconc/data/*.pickle
7
4
  include kitconc/data/*.ttf
8
5
  include kitconc/data/images/*.png
9
6
  include kitconc/data/images/*.ico
10
- include kitconc/data/scripts/*.py
7
+ include kitconc/data/scripts/*.py
8
+ include kitconc/agent/guides/*.md
9
+ include kitconc/agent/recipes/*.json
10
+ recursive-include kitconc/agent/skill *.md
kitconc-4.0.1/PKG-INFO ADDED
@@ -0,0 +1,213 @@
1
+ Metadata-Version: 2.4
2
+ Name: kitconc
3
+ Version: 4.0.1
4
+ Summary: A toolkit for Corpus Linguistics Analysis
5
+ Author-email: José Lopes Moreira Filho <jlopes@alumni.usp.br>
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/x-rst
9
+ License-File: LICENSE.txt
10
+ Requires-Dist: numpy<2.0.0,>=1.26.4
11
+ Requires-Dist: pandas<3.0.0,>=2.2.0
12
+ Requires-Dist: matplotlib<4.0.0,>=3.7.0
13
+ Requires-Dist: xlsxwriter<4.0.0,>=3.2.3
14
+ Requires-Dist: ttkbootstrap<2.0.0,>=1.12.0
15
+ Requires-Dist: pillow<13.0.0,>=12.3.0
16
+ Requires-Dist: requests<3.0.0,>=2.31.0
17
+ Requires-Dist: chardet<6.0.0,>=5.2.0
18
+ Requires-Dist: pypdf<7.0.0,>=4.0.0
19
+ Requires-Dist: cryptography<51.0.0,>=50.0.0
20
+ Requires-Dist: mcp<2.0.0,>=1.0.0
21
+ Provides-Extra: full
22
+ Requires-Dist: torch<2.14,>=2.6; extra == "full"
23
+ Requires-Dist: transformers<6.0.0,>=4.45; extra == "full"
24
+ Requires-Dist: sentence-transformers<6.0.0,>=3.0; extra == "full"
25
+ Requires-Dist: sqlite-vec<1.0.0,>=0.1.7; extra == "full"
26
+ Requires-Dist: fastapi<1.0.0,>=0.110; extra == "full"
27
+ Requires-Dist: uvicorn[standard]<1.0.0,>=0.27; extra == "full"
28
+ Requires-Dist: python-dotenv<2.0.0,>=1.0.0; extra == "full"
29
+ Dynamic: license-file
30
+
31
+ Kitconc 4.0.1
32
+ =============
33
+
34
+ Kitconc is a package for Corpus Linguistics and text analysis with Python.
35
+ It contains, among other things, tools for creating:
36
+
37
+ * Corpora;
38
+ * Frequency wordlists;
39
+ * Keywords (Log-Likelihood, Chi-Square, TF-IDF);
40
+ * Concordance lines;
41
+ * Collocates;
42
+ * N-gram lists;
43
+ * Dispersion plots;
44
+ * Excel data files;
45
+ * Semantic search with sentence embeddings.
46
+
47
+ The package is built on top of platforms and packages for scientific research:
48
+ numpy, pandas, XlsxWriter and matplotlib. Corpus tokenization and tagging use built-in dependency-free components.
49
+
50
+ Requirements
51
+ ============
52
+
53
+ Kitconc requires Python 3.10 or later.
54
+
55
+ Core dependencies (managed by uv):
56
+
57
+ numpy>=1.26.4,<2.0.0
58
+ pandas>=2.2.0,<3.0.0
59
+ matplotlib>=3.7.0,<4.0.0
60
+ xlsxwriter>=3.2.3,<4.0.0
61
+ ttkbootstrap>=1.12.0,<2.0.0
62
+ pillow>=12.3.0,<13.0.0
63
+ requests>=2.31.0,<3.0.0
64
+ chardet>=5.2.0,<6.0.0
65
+ pypdf>=4.0.0,<7.0.0
66
+ cryptography>=50.0.0,<51.0.0
67
+ mcp>=1.0.0,<2.0.0
68
+ setuptools>=70.0.0
69
+
70
+ Optional full dependencies (embeddings, API and local environment):
71
+
72
+ torch>=2.6,<2.10 (CPU wheels from the configured pytorch-cpu uv index)
73
+ transformers>=4.45,<6.0.0
74
+ sentence-transformers>=3.0,<6.0.0
75
+ sqlite-vec>=0.1.7,<1.0.0
76
+ fastapi>=0.110,<1.0.0
77
+ uvicorn[standard]>=0.27,<1.0.0
78
+ python-dotenv>=1.0.0,<2.0.0
79
+
80
+ Installation with uv
81
+ ====================
82
+
83
+ uv sync
84
+
85
+ For the complete local environment:
86
+
87
+ uv sync --all-extras
88
+
89
+ Run commands with uv run, for example:
90
+
91
+ uv run kitconc-mcp --transport stdio
92
+ uv run pytest
93
+
94
+ Kitconc App (graphical interface)
95
+ =================================
96
+
97
+ kitconc-app
98
+
99
+ The desktop app continues to use the filesystem workspace format (info.tab, corpus indexes, and output files). Corpus creation accepts source folders whose paths contain spaces. Corpus names may contain letters, numbers, underscores, dots, and hyphens, except . and ..
100
+
101
+ ZIP imports are validated and will not replace a corpus already present in the workspace. The default maximum expanded archive size is 2 GiB (KITCONC_MAX_IMPORT_BYTES); URL imports are limited to 512 MiB by default (KITCONC_MAX_DOWNLOAD_BYTES). Export creates or atomically replaces <corpus>.zip in the selected destination and continues to exclude Excel result files.
102
+
103
+ Agent Layer (internal actions)
104
+ ==============================
105
+
106
+ Kitconc now includes an internal action layer for agent/tool orchestration:
107
+
108
+ * kitconc.agent.actions.KitconcActions
109
+ * Full parity with shell commands from kit_cmd.py (do_*)
110
+ * Typed schemas in kitconc.agent.schemas
111
+ * Contract documentation in kitconc/agent/CONTRACT.md
112
+ * Semantic retrieval action: semantic_search(...)
113
+
114
+ Basic usage:
115
+
116
+ from kitconc.agent import KitconcActions
117
+ actions = KitconcActions("kitconc_workspace")
118
+ actions.create("ads", "kitconc_corpora/ads", "english")
119
+ actions.use("ads")
120
+ rows = actions.keywords(limit=10)
121
+
122
+ MCP Server (for agent integrations)
123
+ ===================================
124
+
125
+ kitconc-mcp --transport stdio
126
+
127
+ For HTTP clients (recommended):
128
+
129
+ kitconc-mcp --transport streamable-http --host 127.0.0.1 --port 8001
130
+
131
+ or (legacy SSE):
132
+
133
+ kitconc-mcp --transport sse --host 127.0.0.1 --port 8001
134
+
135
+ Semantic MCP tools::
136
+
137
+ semantic_index_status (corpus_name, db_path)
138
+ index_corpus (corpus_name, source_folder, db_path, model_name, chunk_size,
139
+ chunk_overlap, batch_size, rebuild)
140
+ semantic_search (query, top_k, db_path, model_name, corpus_name)
141
+ export_analysis_result (analysis_result, output_path, sheet_name)
142
+
143
+ Use index_corpus to create a per-corpus semantic index from TXT, Markdown,
144
+ RST, and PDF files in the source folder recorded in info.tab. Set source_folder
145
+ when that original path is unavailable. The index is stored under
146
+ <workspace>/.semantic_indexes/<corpus>.sqlite3. Existing indexes are retained
147
+ unless rebuild=True is requested. Then call semantic_search, optionally after
148
+ selecting the corpus with actions.use("name").
149
+
150
+ Install optional embedding dependencies with:
151
+ uv sync --extra full
152
+
153
+ To save an analysis result, pass its complete response object to
154
+ export_analysis_result and set output_path to a filename ending in .tab,
155
+ .tsv, or .xlsx. Only the response's rows are written; metadata such as total
156
+ is not exported. TAB and TSV files are UTF-8 tab-delimited; XLSX accepts an
157
+ optional sheet_name (1-31 characters; invalid characters: ``[]:*?/\\``). Files are written
158
+ atomically and replace an existing destination only after a successful
159
+ export. Parent directories are created when needed. The result reports the
160
+ resolved output_path, format, rows_written, and columns_written.
161
+
162
+ Example: pass the complete result from wordlist(corpus_name="ads") as
163
+ analysis_result, with output_path="C:/exports/wordlist.xlsx" and
164
+ sheet_name="Wordlist".
165
+
166
+ MCP runtime is included in package dependencies
167
+ (uv sync is enough).
168
+
169
+ Agent skills for Claude and Codex
170
+ =================================
171
+
172
+ Install the bundled Kitconc skills without a global pip installation (requires uv):
173
+
174
+ uvx --from kitconc kitconc-skill install
175
+
176
+ This installs the general corpus-analysis skill and the kitconc-recipe-author skill. The latter
177
+ guides an assistant to design a reusable recipe from a user's goal, validate the pipeline, run it
178
+ when useful, and save it to the active Kitconc workspace. To update an existing installation, add
179
+ --force. See the GitHub README for examples and the complete recipe-authoring guide.
180
+
181
+ What's new in 3.2.0
182
+ ====================
183
+
184
+ * Tkinter launcher command -- start GUI with kitconc-app
185
+ * Agent action layer -- kitconc.agent.actions.KitconcActions with command parity from kit_cmd.py
186
+ * Typed schemas -- available in kitconc.agent.schemas
187
+ * MCP server entrypoint -- run with kitconc-mcp
188
+ * Semantic search MCP tool -- semantic_search for sqlite-vec indexes
189
+ * MCP tools to build per-corpus embedding indexes and inspect index status
190
+ * Embedding index hardening -- transactional writes and thread-safe SQLite access
191
+ * Progress flag rename -- use verbose=True (replacing show_progress=True)
192
+
193
+ What's new in 3.1.0
194
+ ====================
195
+
196
+ * TF-IDF keywords -- third keyword extraction method alongside Log-Likelihood and Chi-Square
197
+ * Keyword filters -- ignore numbers, ignore words with strange characters, minimum word length
198
+ * PDF support -- add PDF files directly to a corpus
199
+ * Embeddings module -- semantic search with sentence-transformers and SQLite vector storage
200
+ * Dialog improvements -- dialog boxes now center correctly in fullscreen and large-window mode
201
+
202
+ Language resources
203
+ ==================
204
+
205
+ Kitconc comes with built-in language resources for Portuguese and English corpora.
206
+ It also provides functions for adding your own language resources.
207
+
208
+ Usage example
209
+ =============
210
+
211
+ See how easy it is to use Kitconc:
212
+
213
+ `https://ilexis.net.br/kitconc <https://ilexis.net.br/kitconc>`_
@@ -0,0 +1,183 @@
1
+ Kitconc 4.0.1
2
+ =============
3
+
4
+ Kitconc is a package for Corpus Linguistics and text analysis with Python.
5
+ It contains, among other things, tools for creating:
6
+
7
+ * Corpora;
8
+ * Frequency wordlists;
9
+ * Keywords (Log-Likelihood, Chi-Square, TF-IDF);
10
+ * Concordance lines;
11
+ * Collocates;
12
+ * N-gram lists;
13
+ * Dispersion plots;
14
+ * Excel data files;
15
+ * Semantic search with sentence embeddings.
16
+
17
+ The package is built on top of platforms and packages for scientific research:
18
+ numpy, pandas, XlsxWriter and matplotlib. Corpus tokenization and tagging use built-in dependency-free components.
19
+
20
+ Requirements
21
+ ============
22
+
23
+ Kitconc requires Python 3.10 or later.
24
+
25
+ Core dependencies (managed by uv):
26
+
27
+ numpy>=1.26.4,<2.0.0
28
+ pandas>=2.2.0,<3.0.0
29
+ matplotlib>=3.7.0,<4.0.0
30
+ xlsxwriter>=3.2.3,<4.0.0
31
+ ttkbootstrap>=1.12.0,<2.0.0
32
+ pillow>=12.3.0,<13.0.0
33
+ requests>=2.31.0,<3.0.0
34
+ chardet>=5.2.0,<6.0.0
35
+ pypdf>=4.0.0,<7.0.0
36
+ cryptography>=50.0.0,<51.0.0
37
+ mcp>=1.0.0,<2.0.0
38
+ setuptools>=70.0.0
39
+
40
+ Optional full dependencies (embeddings, API and local environment):
41
+
42
+ torch>=2.6,<2.10 (CPU wheels from the configured pytorch-cpu uv index)
43
+ transformers>=4.45,<6.0.0
44
+ sentence-transformers>=3.0,<6.0.0
45
+ sqlite-vec>=0.1.7,<1.0.0
46
+ fastapi>=0.110,<1.0.0
47
+ uvicorn[standard]>=0.27,<1.0.0
48
+ python-dotenv>=1.0.0,<2.0.0
49
+
50
+ Installation with uv
51
+ ====================
52
+
53
+ uv sync
54
+
55
+ For the complete local environment:
56
+
57
+ uv sync --all-extras
58
+
59
+ Run commands with uv run, for example:
60
+
61
+ uv run kitconc-mcp --transport stdio
62
+ uv run pytest
63
+
64
+ Kitconc App (graphical interface)
65
+ =================================
66
+
67
+ kitconc-app
68
+
69
+ The desktop app continues to use the filesystem workspace format (info.tab, corpus indexes, and output files). Corpus creation accepts source folders whose paths contain spaces. Corpus names may contain letters, numbers, underscores, dots, and hyphens, except . and ..
70
+
71
+ ZIP imports are validated and will not replace a corpus already present in the workspace. The default maximum expanded archive size is 2 GiB (KITCONC_MAX_IMPORT_BYTES); URL imports are limited to 512 MiB by default (KITCONC_MAX_DOWNLOAD_BYTES). Export creates or atomically replaces <corpus>.zip in the selected destination and continues to exclude Excel result files.
72
+
73
+ Agent Layer (internal actions)
74
+ ==============================
75
+
76
+ Kitconc now includes an internal action layer for agent/tool orchestration:
77
+
78
+ * kitconc.agent.actions.KitconcActions
79
+ * Full parity with shell commands from kit_cmd.py (do_*)
80
+ * Typed schemas in kitconc.agent.schemas
81
+ * Contract documentation in kitconc/agent/CONTRACT.md
82
+ * Semantic retrieval action: semantic_search(...)
83
+
84
+ Basic usage:
85
+
86
+ from kitconc.agent import KitconcActions
87
+ actions = KitconcActions("kitconc_workspace")
88
+ actions.create("ads", "kitconc_corpora/ads", "english")
89
+ actions.use("ads")
90
+ rows = actions.keywords(limit=10)
91
+
92
+ MCP Server (for agent integrations)
93
+ ===================================
94
+
95
+ kitconc-mcp --transport stdio
96
+
97
+ For HTTP clients (recommended):
98
+
99
+ kitconc-mcp --transport streamable-http --host 127.0.0.1 --port 8001
100
+
101
+ or (legacy SSE):
102
+
103
+ kitconc-mcp --transport sse --host 127.0.0.1 --port 8001
104
+
105
+ Semantic MCP tools::
106
+
107
+ semantic_index_status (corpus_name, db_path)
108
+ index_corpus (corpus_name, source_folder, db_path, model_name, chunk_size,
109
+ chunk_overlap, batch_size, rebuild)
110
+ semantic_search (query, top_k, db_path, model_name, corpus_name)
111
+ export_analysis_result (analysis_result, output_path, sheet_name)
112
+
113
+ Use index_corpus to create a per-corpus semantic index from TXT, Markdown,
114
+ RST, and PDF files in the source folder recorded in info.tab. Set source_folder
115
+ when that original path is unavailable. The index is stored under
116
+ <workspace>/.semantic_indexes/<corpus>.sqlite3. Existing indexes are retained
117
+ unless rebuild=True is requested. Then call semantic_search, optionally after
118
+ selecting the corpus with actions.use("name").
119
+
120
+ Install optional embedding dependencies with:
121
+ uv sync --extra full
122
+
123
+ To save an analysis result, pass its complete response object to
124
+ export_analysis_result and set output_path to a filename ending in .tab,
125
+ .tsv, or .xlsx. Only the response's rows are written; metadata such as total
126
+ is not exported. TAB and TSV files are UTF-8 tab-delimited; XLSX accepts an
127
+ optional sheet_name (1-31 characters; invalid characters: ``[]:*?/\\``). Files are written
128
+ atomically and replace an existing destination only after a successful
129
+ export. Parent directories are created when needed. The result reports the
130
+ resolved output_path, format, rows_written, and columns_written.
131
+
132
+ Example: pass the complete result from wordlist(corpus_name="ads") as
133
+ analysis_result, with output_path="C:/exports/wordlist.xlsx" and
134
+ sheet_name="Wordlist".
135
+
136
+ MCP runtime is included in package dependencies
137
+ (uv sync is enough).
138
+
139
+ Agent skills for Claude and Codex
140
+ =================================
141
+
142
+ Install the bundled Kitconc skills without a global pip installation (requires uv):
143
+
144
+ uvx --from kitconc kitconc-skill install
145
+
146
+ This installs the general corpus-analysis skill and the kitconc-recipe-author skill. The latter
147
+ guides an assistant to design a reusable recipe from a user's goal, validate the pipeline, run it
148
+ when useful, and save it to the active Kitconc workspace. To update an existing installation, add
149
+ --force. See the GitHub README for examples and the complete recipe-authoring guide.
150
+
151
+ What's new in 3.2.0
152
+ ====================
153
+
154
+ * Tkinter launcher command -- start GUI with kitconc-app
155
+ * Agent action layer -- kitconc.agent.actions.KitconcActions with command parity from kit_cmd.py
156
+ * Typed schemas -- available in kitconc.agent.schemas
157
+ * MCP server entrypoint -- run with kitconc-mcp
158
+ * Semantic search MCP tool -- semantic_search for sqlite-vec indexes
159
+ * MCP tools to build per-corpus embedding indexes and inspect index status
160
+ * Embedding index hardening -- transactional writes and thread-safe SQLite access
161
+ * Progress flag rename -- use verbose=True (replacing show_progress=True)
162
+
163
+ What's new in 3.1.0
164
+ ====================
165
+
166
+ * TF-IDF keywords -- third keyword extraction method alongside Log-Likelihood and Chi-Square
167
+ * Keyword filters -- ignore numbers, ignore words with strange characters, minimum word length
168
+ * PDF support -- add PDF files directly to a corpus
169
+ * Embeddings module -- semantic search with sentence-transformers and SQLite vector storage
170
+ * Dialog improvements -- dialog boxes now center correctly in fullscreen and large-window mode
171
+
172
+ Language resources
173
+ ==================
174
+
175
+ Kitconc comes with built-in language resources for Portuguese and English corpora.
176
+ It also provides functions for adding your own language resources.
177
+
178
+ Usage example
179
+ =============
180
+
181
+ See how easy it is to use Kitconc:
182
+
183
+ `https://ilexis.net.br/kitconc <https://ilexis.net.br/kitconc>`_
@@ -32,7 +32,7 @@ import sqlite3
32
32
  import threading
33
33
  import numpy as np
34
34
 
35
- import sqlite_vec # pip install sqlite-vec
35
+ import sqlite_vec # provided by the optional full uv extra
36
36
  from sentence_transformers import SentenceTransformer
37
37
  from dotenv import load_dotenv, find_dotenv
38
38