tenderkit 0.1.0__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.
- tenderkit-0.1.0/CHANGELOG.md +20 -0
- tenderkit-0.1.0/LICENSE +202 -0
- tenderkit-0.1.0/MANIFEST.in +4 -0
- tenderkit-0.1.0/PKG-INFO +219 -0
- tenderkit-0.1.0/README.md +200 -0
- tenderkit-0.1.0/docs/plugins.md +56 -0
- tenderkit-0.1.0/examples/oprogramowanie.toml +3 -0
- tenderkit-0.1.0/pyproject.toml +32 -0
- tenderkit-0.1.0/setup.cfg +4 -0
- tenderkit-0.1.0/src/tenderkit/__init__.py +9 -0
- tenderkit-0.1.0/src/tenderkit/__main__.py +5 -0
- tenderkit-0.1.0/src/tenderkit/cli.py +248 -0
- tenderkit-0.1.0/src/tenderkit/documents.py +260 -0
- tenderkit-0.1.0/src/tenderkit/errors.py +52 -0
- tenderkit-0.1.0/src/tenderkit/http.py +94 -0
- tenderkit-0.1.0/src/tenderkit/interfaces.py +42 -0
- tenderkit-0.1.0/src/tenderkit/limits.py +7 -0
- tenderkit-0.1.0/src/tenderkit/mcp.py +221 -0
- tenderkit-0.1.0/src/tenderkit/model.py +78 -0
- tenderkit-0.1.0/src/tenderkit/pdf_ocr.py +78 -0
- tenderkit-0.1.0/src/tenderkit/platforms/__init__.py +33 -0
- tenderkit-0.1.0/src/tenderkit/platforms/backends.py +163 -0
- tenderkit-0.1.0/src/tenderkit/platforms/base.py +79 -0
- tenderkit-0.1.0/src/tenderkit/platforms/bk.py +78 -0
- tenderkit-0.1.0/src/tenderkit/platforms/ezamowienia.py +85 -0
- tenderkit-0.1.0/src/tenderkit/platforms/html.py +67 -0
- tenderkit-0.1.0/src/tenderkit/platforms/marketplanet_html.py +128 -0
- tenderkit-0.1.0/src/tenderkit/platforms/public_documents.py +206 -0
- tenderkit-0.1.0/src/tenderkit/platforms/pz_html.py +127 -0
- tenderkit-0.1.0/src/tenderkit/platforms/session.py +114 -0
- tenderkit-0.1.0/src/tenderkit/profile.py +216 -0
- tenderkit-0.1.0/src/tenderkit/profiles/__init__.py +13 -0
- tenderkit-0.1.0/src/tenderkit/profiles/leki.toml +5 -0
- tenderkit-0.1.0/src/tenderkit/profiles/oprogramowanie.toml +4 -0
- tenderkit-0.1.0/src/tenderkit/profiles/wyroby-medyczne.toml +4 -0
- tenderkit-0.1.0/src/tenderkit/queue.py +126 -0
- tenderkit-0.1.0/src/tenderkit/read_document.py +309 -0
- tenderkit-0.1.0/src/tenderkit/serialization.py +63 -0
- tenderkit-0.1.0/src/tenderkit/service.py +164 -0
- tenderkit-0.1.0/src/tenderkit/sources/__init__.py +1 -0
- tenderkit-0.1.0/src/tenderkit/sources/bk.py +145 -0
- tenderkit-0.1.0/src/tenderkit/sources/bzp.py +142 -0
- tenderkit-0.1.0/src/tenderkit/sources/mapping.py +264 -0
- tenderkit-0.1.0/src/tenderkit/sources/ted.py +116 -0
- tenderkit-0.1.0/src/tenderkit/sources/ted_xml.py +97 -0
- tenderkit-0.1.0/src/tenderkit/store/__init__.py +1 -0
- tenderkit-0.1.0/src/tenderkit/store/documents.py +168 -0
- tenderkit-0.1.0/src/tenderkit/store/state.py +202 -0
- tenderkit-0.1.0/src/tenderkit/ui.py +243 -0
- tenderkit-0.1.0/src/tenderkit/watch.py +247 -0
- tenderkit-0.1.0/src/tenderkit/web/index.html +59 -0
- tenderkit-0.1.0/src/tenderkit/web/style.css +221 -0
- tenderkit-0.1.0/src/tenderkit.egg-info/PKG-INFO +219 -0
- tenderkit-0.1.0/src/tenderkit.egg-info/SOURCES.txt +77 -0
- tenderkit-0.1.0/src/tenderkit.egg-info/dependency_links.txt +1 -0
- tenderkit-0.1.0/src/tenderkit.egg-info/entry_points.txt +2 -0
- tenderkit-0.1.0/src/tenderkit.egg-info/requires.txt +13 -0
- tenderkit-0.1.0/src/tenderkit.egg-info/top_level.txt +1 -0
- tenderkit-0.1.0/tests/__init__.py +0 -0
- tenderkit-0.1.0/tests/fixtures/tenderkit/platforms/marketplanet.json +412 -0
- tenderkit-0.1.0/tests/fixtures/tenderkit/platforms/native.json +18 -0
- tenderkit-0.1.0/tests/fixtures/tenderkit/platforms/pz.json +531 -0
- tenderkit-0.1.0/tests/fixtures/tenderkit/results/bzp-awarded-multilot.json +39 -0
- tenderkit-0.1.0/tests/fixtures/tenderkit/results/bzp-cancelled.json +32 -0
- tenderkit-0.1.0/tests/tenderkit/__init__.py +0 -0
- tenderkit-0.1.0/tests/tenderkit/test_bk.py +99 -0
- tenderkit-0.1.0/tests/tenderkit/test_boundary.py +33 -0
- tenderkit-0.1.0/tests/tenderkit/test_cli_database.py +50 -0
- tenderkit-0.1.0/tests/tenderkit/test_f1.py +229 -0
- tenderkit-0.1.0/tests/tenderkit/test_f2.py +395 -0
- tenderkit-0.1.0/tests/tenderkit/test_f3.py +77 -0
- tenderkit-0.1.0/tests/tenderkit/test_legacy_office.py +141 -0
- tenderkit-0.1.0/tests/tenderkit/test_mcp.py +166 -0
- tenderkit-0.1.0/tests/tenderkit/test_pdf_ocr.py +87 -0
- tenderkit-0.1.0/tests/tenderkit/test_platform_fixtures.py +56 -0
- tenderkit-0.1.0/tests/tenderkit/test_profile.py +102 -0
- tenderkit-0.1.0/tests/tenderkit/test_public_documents.py +101 -0
- tenderkit-0.1.0/tests/tenderkit/test_results.py +240 -0
- tenderkit-0.1.0/tests/tenderkit/test_watch.py +155 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
- Fetch Polish procurement notices from BZP and TED, store them in SQLite and filter them with TOML profiles.
|
|
6
|
+
- Fetch notices from Baza Konkurencyjności (BK2021) with `--source BK`. The adapter validates search totals and supports on-demand downloads of public attachments.
|
|
7
|
+
- Report new and revised profile matches with `tenderkit watch`. Watch history is stored in SQLite. Events are available as JSON Lines, through an optional webhook, and through the MCP `watch_updates` tool.
|
|
8
|
+
- Use one per-user default database for CLI, browser UI and MCP on Windows, macOS and Linux. Override it with `--db` or `TENDERKIT_DB`.
|
|
9
|
+
- Exclude CPV codes or prefixes with `exclude_cpv` in a profile or in MCP `search_notices`. The built-in `leki` profile leaves out laboratory reagents (`33696*`) and disinfectants (`336316*`).
|
|
10
|
+
- Match keyword prefixes and phrases in titles, descriptions and available lot titles. Use `*term*` for substring matching. Results can identify the matched keyword and field. `exclude_cpv` lists CPV codes or prefixes that never count towards a match; the `leki` profile uses it to leave out laboratory reagents (`33696*`) and disinfectants (`336316*`).
|
|
11
|
+
- Browse saved notices with `tenderkit ui`. Choose profiles at startup, search by title or buyer, filter by source, CPV and dates, and sort the results.
|
|
12
|
+
- Export matching notices as JSON Lines. The CLI help lists commands and examples.
|
|
13
|
+
- Fetch formal result notices with `fetch --results` and read them with `results` or the MCP `procedure_results` and `search_results` tools. Results include the contractor, selected price, bid count and status per lot and link to the contract notice through `procedure_id`.
|
|
14
|
+
- List and download public procurement documents on supported platforms: e-Zamówienia, platformazakupowa.pl, Marketplanet (OnePlace), e-ProPublico, eB2B and LogIntrade. Download documents for every notice that matches a profile with `download --profile`. A document the platform refuses for good (HTTP 400, 404 or 410) is marked unavailable and skipped by later whole-procedure downloads, and a store path that Windows would refuse fails with `PATH_TOO_LONG` instead of a bare file error. Document listings mark bid-opening information with `kind: "bid_opening"` based on the filename.
|
|
15
|
+
- A document the platform refuses for good, such as a withdrawn attachment that answers HTTP 400, no longer fails the download. It is listed as `unavailable` and skipped by later whole-procedure downloads.
|
|
16
|
+
- On Windows, document file names are shortened to keep store paths under 260 characters. A store directory that is too deep fails with `PATH_TOO_LONG` instead of an unexplained `FileNotFoundError`.
|
|
17
|
+
- Read PDF, DOCX and XLSX text with document provenance. Read legacy XLS with the `documents` extra (xlrd) and legacy DOC with `antiword` or LibreOffice. Detect PDF pages without embedded text and opt in to local Polish OCR with `--ocr` or MCP `ocr: true`. OCR text is cached per document and page.
|
|
18
|
+
- Expose search, notice details and document tools through an optional MCP server over stdio, with the `analyze_it_tender` and `compare_public_bids` prompts.
|
|
19
|
+
- Test on Linux, Windows and macOS in CI. The README documents the Debian/Ubuntu install with a virtual environment or `pipx`.
|
|
20
|
+
- Register notice sources and document platforms through Python entry points.
|
tenderkit-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
tenderkit-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tenderkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Collect, filter and read Polish public procurement notices and documents
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Repository, https://github.com/pjagielski/tenderkit
|
|
7
|
+
Requires-Python: >=3.11
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: tzdata; sys_platform == "win32"
|
|
11
|
+
Provides-Extra: mcp
|
|
12
|
+
Requires-Dist: mcp<3,>=2.3; extra == "mcp"
|
|
13
|
+
Provides-Extra: documents
|
|
14
|
+
Requires-Dist: PyMuPDF<2,>=1.26; extra == "documents"
|
|
15
|
+
Requires-Dist: xlrd<3,>=2.0.1; extra == "documents"
|
|
16
|
+
Provides-Extra: ocr
|
|
17
|
+
Requires-Dist: PyMuPDF<2,>=1.26; extra == "ocr"
|
|
18
|
+
Dynamic: license-file
|
|
19
|
+
|
|
20
|
+
# tenderkit
|
|
21
|
+
|
|
22
|
+
Collect Polish procurement notices from BZP and TED, filter them with TOML profiles, and keep the results in SQLite. Use the CLI to export notices, list public documents, and read selected files. The optional MCP server exposes the same local state to MCP clients.
|
|
23
|
+
|
|
24
|
+
## Install and search
|
|
25
|
+
|
|
26
|
+
Requires Python 3.11 or newer.
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
python -m pip install tenderkit
|
|
30
|
+
tenderkit profiles
|
|
31
|
+
tenderkit fetch --profile oprogramowanie
|
|
32
|
+
tenderkit filter --profile oprogramowanie --limit 20
|
|
33
|
+
tenderkit export --profile oprogramowanie --format jsonl
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
On Debian and Ubuntu, the system Python ships without `venv` and `pip` and refuses system-wide `pip install` (PEP 668). Install both packages, then install tenderkit in a virtual environment, or use `pipx install tenderkit`. `poppler-utils` provides `pdftotext` for PDF reading, as an alternative to the `documents` extra, and `antiword` reads legacy `.doc` files.
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
sudo apt install python3-venv python3-pip poppler-utils antiword
|
|
40
|
+
python3 -m venv ~/.venvs/tenderkit
|
|
41
|
+
~/.venvs/tenderkit/bin/python -m pip install tenderkit
|
|
42
|
+
~/.venvs/tenderkit/bin/tenderkit profiles
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The default fetch window covers 30 calendar days including today in Warsaw. Use `--from` and `--to` for an inclusive window or repeat `--source` to select adapters. Publication date and bid deadline are separate filters.
|
|
46
|
+
|
|
47
|
+
All commands, including the UI and MCP server, use the same default database for your account, independent of the working directory.
|
|
48
|
+
|
|
49
|
+
| System | Default database |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| Windows | `%LOCALAPPDATA%\tenderkit\state.sqlite3` |
|
|
52
|
+
| macOS | `~/Library/Application Support/tenderkit/state.sqlite3` |
|
|
53
|
+
| Linux | `${XDG_DATA_HOME:-$HOME/.local/share}/tenderkit/state.sqlite3` |
|
|
54
|
+
|
|
55
|
+
To keep using an existing database, such as `.notices.sqlite3` or `.tenderkit/state.sqlite3`, set `TENDERKIT_DB` to its absolute path. An explicit `--db` takes precedence over both. In PowerShell, the first line sets the path for the current shell and the second saves it for future sessions under your account.
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
$env:TENDERKIT_DB = 'C:\path\to\.notices.sqlite3'
|
|
59
|
+
[Environment]::SetEnvironmentVariable('TENDERKIT_DB', $env:TENDERKIT_DB, 'User')
|
|
60
|
+
tenderkit status
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Add `--results` to fetch formal result notices next to contract notices. Built-in profiles stay contract-only so the default notice set does not change.
|
|
64
|
+
|
|
65
|
+
Built-in profiles include `leki` (medicines), `oprogramowanie` (software), and `wyroby-medyczne` (medical devices). Pass a TOML file to `--profile` for a custom profile:
|
|
66
|
+
|
|
67
|
+
```toml
|
|
68
|
+
name = "software-mazowieckie"
|
|
69
|
+
cpv = ["72*", "48*"]
|
|
70
|
+
notice_types = ["ContractNotice", "cn-standard"]
|
|
71
|
+
regions = ["14"]
|
|
72
|
+
deadline_days = { min = 1, max = 60 }
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Region codes refer to the buyer's location. A CPV ending in `*` matches a prefix. `exclude_cpv` lists codes or prefixes that never count: a notice matches only if one of its main or lot codes is in `cpv` and not excluded. The built-in `leki` profile excludes laboratory reagents (`33696*`) and disinfectants (`336316*`), which share the `336` branch. Required keywords and CPV restrictions are applied together, and exclusions take precedence.
|
|
76
|
+
|
|
77
|
+
`keywords_any` and `exclude_keywords` search the notice title, description and available lot titles. Matching ignores case and diacritics. A term starts at a word boundary, so `lek` matches `Leki` and `leków`. Phrases such as `system informatyczn` match consecutive text and allow an inflected ending. Wrap a term in stars, such as `*lek*`, to match it anywhere within a word as in earlier versions.
|
|
78
|
+
|
|
79
|
+
CLI filter, export and watch records and MCP search results include `keyword_matches` when inclusion keywords are configured. Each match names the configured keyword and the field (`title`, `description` or `lot_title`), with a lot number when the source identifies it. Cached records use the source fields they already contain. Older TED records gain descriptions and lot titles when refreshed.
|
|
80
|
+
|
|
81
|
+
## Daily watch
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
tenderkit watch --profile oprogramowanie
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Each invocation refreshes the selected sources once. The first run reports the matching notices in its 30-day publication window. Later runs report first-time matches and revisions of reported notices, including a changed deadline that takes the notice out of the profile's date filter. Matching and reporting history are stored in SQLite under the profile's `name`. Use distinct names for distinct watch profiles.
|
|
88
|
+
|
|
89
|
+
The default window overlaps the last 30 days and extends back to any unfinished interval per source. A failed source writes a diagnostic to stderr and makes the command exit with status 1. Other sources can still produce events. The next default run retries the failed window. `--from` and `--to` run a bounded backfill with the same reporting history. Repeat the same backfill to retry its failures.
|
|
90
|
+
|
|
91
|
+
Stdout contains one JSON object per event, with `event_id`, `profile`, `event` (`new` or `updated`), `changes` (`version` and/or `deadline`) and `notice`. An unchanged successful run prints nothing and exits 0. BZP amendments are linked by the original notice number and include an `amendment` reference. TED eForms amendments use the published previous-notice identifier. TED deadline comparisons use the earliest bid date in the notice's Search API fields. [TED field list](https://docs.ted.europa.eu/ODS/latest/reuse/field-list.html)
|
|
92
|
+
|
|
93
|
+
With `--webhook URL`, tenderkit POSTs `{"events": [...]}` in batches of up to 100 before writing each batch to stdout. On delivery failure, the batch is retained. Run with the same webhook option to retry that delivery. Use `event_id` to deduplicate retries if delivery succeeded but the process stopped before recording it.
|
|
94
|
+
|
|
95
|
+
For a daily cron job at 08:00, use absolute paths to the executable and any custom profile file.
|
|
96
|
+
|
|
97
|
+
```cron
|
|
98
|
+
0 8 * * * /home/me/.venv/bin/tenderkit watch --profile /home/me/oprogramowanie.toml >> /home/me/notices.jsonl
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
In Windows Task Scheduler, add a daily trigger and a **Start a program** action. Use the absolute path to `tenderkit.exe` as **Program/script** and these **Add arguments** values.
|
|
102
|
+
|
|
103
|
+
```text
|
|
104
|
+
watch --profile "C:\path\to\oprogramowanie.toml"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Run the job under the same user account to share the default database. If you use an alternate database, add its absolute path with `--db` before `watch` in the scheduler arguments. To capture stdout, run the command with redirection from a PowerShell script and schedule that script.
|
|
108
|
+
|
|
109
|
+
## Baza Konkurencyjności
|
|
110
|
+
|
|
111
|
+
Fetch BK2021 explicitly with `--source BK`. The software profile accepts BK notices under the type `BKAnnouncement`; use that type in custom profiles that restrict notice types.
|
|
112
|
+
|
|
113
|
+
```sh
|
|
114
|
+
tenderkit fetch --source BK --profile oprogramowanie --from 2026-11-12 --to 2026-11-12
|
|
115
|
+
tenderkit filter --source BK --profile oprogramowanie
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
BK uses the portal's anonymous search and detail endpoints. The operator has no published integration specification or request quota that we could verify. Tenderkit uses sequential, paced requests and checks each search's reported count, including all public statuses. Start with short date windows because each returned notice requires a detail request. An incomplete refresh fails before storing its results. BK attribution includes the Ministry name, retrieval timestamp, processing note, and original link. Public attachments linked by a notice can be retrieved on demand with the regular document commands. [Access, terms and verification](docs/bk-access.md)
|
|
119
|
+
|
|
120
|
+
## Results
|
|
121
|
+
|
|
122
|
+
Formal awards are available per lot, linked to their procedure through `procedure_id`:
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
tenderkit fetch --profile oprogramowanie --results
|
|
126
|
+
tenderkit results --source BZP --number '2026/BZP …/01'
|
|
127
|
+
tenderkit results --buyer 'Kraków' --cpv '72*'
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`results --number` returns the contract and result notices of one procedure plus the latest award for each lot: contractor name and identifier, selected price and currency, bid count, date and status (`AWARDED` or `CANCELLED`). `results --buyer` and `--cpv` search stored awards, one latest record per procedure and lot.
|
|
131
|
+
|
|
132
|
+
BZP results come from `TenderResultNotice` sections. TED results come from `can-standard` notices; per-lot winners and prices are read from the public notice XML because the Search API arrays carry no lot join. One XML request is made per award notice at a conservative pace, so a run with more than 1000 award notices fails and asks for a narrower window. Only formal source facts are mapped: extracting prices from bid forms stays in the industry project. In `list-documents`, the bid-opening information is marked with `kind: "bid_opening"` from its filename; the content is never parsed there.
|
|
133
|
+
|
|
134
|
+
## Local browser view
|
|
135
|
+
|
|
136
|
+
```sh
|
|
137
|
+
tenderkit ui --profile examples/oprogramowanie.toml
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Open `http://127.0.0.1:8765/` to browse saved notices, switch profiles,
|
|
141
|
+
and search by title or buyer. The UI opens the database in read-only mode.
|
|
142
|
+
Pass each profile you want to see with `--profile`, using a name or a TOML
|
|
143
|
+
path. The first profile opens by default. Use `--port 8766` if the default port
|
|
144
|
+
is in use.
|
|
145
|
+
|
|
146
|
+
## Documents
|
|
147
|
+
|
|
148
|
+
```sh
|
|
149
|
+
tenderkit list-documents --source BZP --number '2026/BZP …/01'
|
|
150
|
+
tenderkit download --source BZP --number '2026/BZP …/01' --key '<document key>'
|
|
151
|
+
tenderkit read-document '<SHA-256>'
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Use a notice number returned by the filter and a key returned by the listing. The store verifies content by SHA-256 and retains document provenance. Tenderkit downloads public documents from native e-Zamówienia, platformazakupowa.pl, Marketplanet, Baza Konkurencyjności, e-ProPublico, eB2B and LogIntrade. For platformazakupowa.pl, consult the [platform terms](https://platformazakupowa.pl/strona/regulamin) and [official CSV export](https://platformazakupowa.pl/strona/api).
|
|
155
|
+
|
|
156
|
+
e-ProPublico and LogIntrade use the direct procedure link. On `eb2b.com.pl` hosts, Tenderkit can also resolve an exact reference number and lists public, active and current organizer attachments. These adapters use the portals' anonymous document routes and the existing paced HTTP session. The linked regulations describe portal use. We found no published attachment API contract or request quota for these routes. [e-ProPublico terms](https://e-propublico.pl/documents/Regulamin%20e-ProPublico.pdf) · [eB2B terms](https://mail.api.eb2b.com.pl/cms/page/id/terms-and-conditions) · [LogIntrade terms](https://platforma.logintrade.net/rejestracja/regulamin.html)
|
|
157
|
+
|
|
158
|
+
A document that the platform refuses with a permanent HTTP error (400, 404, 410 and other 4xx except 401, 403, 408 and 429) does not fail the procedure. Typically it is a withdrawn or replaced attachment. The job finishes with the other files, counts the document under `summary.unavailable`, and `list-documents` shows it with `unavailable: {error, checked_at}`. Later downloads of the whole procedure skip it. Pass its `--key` to try it again. A job still fails if it stores none of the requested documents, or on throttling, server errors and access blocks. Native e-Zamówienia, platformazakupowa.pl and Marketplanet implement document downloads. For platformazakupowa.pl, consult the [platform terms](https://platformazakupowa.pl/strona/regulamin) and [official CSV export](https://platformazakupowa.pl/strona/api).
|
|
159
|
+
|
|
160
|
+
On Windows, store paths must stay under 260 characters. Tenderkit shortens the readable part of linked file names to fit. When the document directory itself is too deep, the job fails with `PATH_TOO_LONG`. In that case choose a shorter `--documents-dir` or `TENDERKIT_DOCUMENT_DIR`. Native e-Zamówienia, platformazakupowa.pl and Marketplanet implement document downloads. For platformazakupowa.pl, consult the [platform terms](https://platformazakupowa.pl/strona/regulamin) and [official CSV export](https://platformazakupowa.pl/strona/api).
|
|
161
|
+
|
|
162
|
+
To download documents for saved notices matching a profile, run:
|
|
163
|
+
|
|
164
|
+
```sh
|
|
165
|
+
tenderkit download --profile oprogramowanie --limit 10
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
The command uses the same matches and ordering as `filter`. Use `--source`, `--from` and `--to` to narrow the selection. Each call takes up to 20 matches. If the response includes a `next_offset`, pass it as `--offset` with the same filters. The response includes a job per processed notice and a reason for each skipped notice. Use `--enqueue-only` to prepare jobs for `download --run-queued --max-jobs 20`. An unfinished job or a conflict with an active download selection produces exit status 1 for a direct run.
|
|
169
|
+
|
|
170
|
+
The native e-Zamówienia adapter downloads published attachments on request using the portal's public document route. The platform allows access to its public area without signing in. The integration guide documents a rate limit for the BZP notice API. We found no published quota or integration contract for the attachment route. Tenderkit spaces requests by 2.1 seconds and caps downloads at 200 MB per file and 1 GB per job. [Platform terms](https://ezamowienia.gov.pl/pl/regulamin/) · [Integration guide](https://ezamowienia.gov.pl/pl/integracja/)
|
|
171
|
+
|
|
172
|
+
DOCX and XLSX reading uses the standard library. Legacy XLS reading needs the `documents` extra (xlrd); formula cells give their cached values. Legacy DOC reading needs `antiword` or LibreOffice (`soffice`) on PATH, or `TENDERKIT_ANTIWORD` / `TENDERKIT_SOFFICE` naming one; tenderkit tries antiword first and falls back to LibreOffice for files antiword cannot read, such as RTF saved as `.doc`. A `.doc` or `.xls` that is really DOCX or XLSX is read as such. PDF text extraction needs `pdftotext` on PATH or the `documents` extra, which installs the PyMuPDF CLI. Each PDF page reports `text_layer: false` when extraction finds no embedded text, as with scanned or blank pages.
|
|
173
|
+
|
|
174
|
+
### OCR for scanned PDFs
|
|
175
|
+
|
|
176
|
+
Install `tenderkit[ocr]` and place the official Tesseract `pol.traineddata` in a local directory. Set `TESSDATA_PREFIX` to that directory in the shell or MCP server environment. The PyMuPDF wheel provides the OCR engine. [Polish language data](https://github.com/tesseract-ocr/tessdata_fast/blob/4.1.0/pol.traineddata) · [PyMuPDF OCR documentation](https://pymupdf.readthedocs.io/en/latest/installation.html)
|
|
177
|
+
|
|
178
|
+
```sh
|
|
179
|
+
python -m pip install 'tenderkit[ocr]'
|
|
180
|
+
tenderkit read-document '<SHA-256>' --page 1 --pages 2 --ocr
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
In MCP, pass `ocr: true` to `read_document`. OCR is opt-in per call and processes only the requested pages without embedded text. OCR pages retain `text_layer: false` and report `text_source: "ocr"`. Text is cached per document SHA-256 and page beside the stored PDF. The reader accepts up to five pages, with a 30-second OCR budget across those pages in addition to the regular PDF extraction budget.
|
|
184
|
+
|
|
185
|
+
## MCP
|
|
186
|
+
|
|
187
|
+
```sh
|
|
188
|
+
python -m pip install 'tenderkit[mcp,documents]'
|
|
189
|
+
tenderkit mcp
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Configure your client with the absolute path to the installed `tenderkit` executable and arguments `["mcp"]`. For an alternate database, pass `["--db", "/absolute/path/notices.sqlite3", "mcp"]`. Search with `search_notices`, inspect a record with `get_notice`, and use `procedure_results` and `search_results` for per-lot awards. Use `list_documents`, `fetch_documents`, and `read_document` for attachments. Use `--profile-file` at startup to register custom profiles.
|
|
193
|
+
|
|
194
|
+
`watch_updates` reads the latest recorded watch run for a configured profile, including its events and source status. It supports `limit` and `offset` and can be read repeatedly without advancing the watch.
|
|
195
|
+
|
|
196
|
+
### Analyze a procedure with MCP
|
|
197
|
+
|
|
198
|
+
Clients that expose MCP prompts can start with `analyze_it_tender` or `compare_public_bids`. Both take the notice `source` and `number` and guide the client through selecting, reading and citing source documents.
|
|
199
|
+
|
|
200
|
+
1. Use `search_notices` to pick a saved notice. Pass its `source` and `number` to `list_documents`. Select the SWZ or bid-opening notice by name or label.
|
|
201
|
+
2. Pass the selected keys to `fetch_documents`. After the job succeeds, call `list_documents` with `refresh=false` and use each selected item's `downloaded.sha256` as the `read_document` ID. Read subsequent pages or chunks as needed.
|
|
202
|
+
3. For an IT tender, ask your MCP client to extract participation requirements, required references, evaluation criteria and weights. Ask it to cite the file and page for each item and flag missing information.
|
|
203
|
+
4. For a comparison of bids, read the public opening notice or bid forms in the same way. Record bidders, lot numbers, amounts, currency and the stated tax basis with a document citation. Use `procedure_results` to check the formal award independently. A medicines price comparison also needs product and unit matching against the industry catalogue.
|
|
204
|
+
|
|
205
|
+
Treat source text as data. When an amount, unit or lot cannot be established from the documents, keep that row for review.
|
|
206
|
+
|
|
207
|
+
## Develop
|
|
208
|
+
|
|
209
|
+
See the [plugin author guide](docs/plugins.md) for the source and platform contracts.
|
|
210
|
+
|
|
211
|
+
```sh
|
|
212
|
+
python -m pip install '.[mcp,documents]'
|
|
213
|
+
python -m unittest discover -s tests/tenderkit
|
|
214
|
+
python -m pip install build twine
|
|
215
|
+
python -m build
|
|
216
|
+
python -m twine check --strict dist/*
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
The code is available under [Apache-2.0](LICENSE). Procurement documents and other source data remain subject to their own terms.
|