mikomi 0.1.0a1__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.
- mikomi-0.1.0a1/.gitignore +34 -0
- mikomi-0.1.0a1/LICENSE +202 -0
- mikomi-0.1.0a1/NOTICE +3 -0
- mikomi-0.1.0a1/PKG-INFO +95 -0
- mikomi-0.1.0a1/README.md +58 -0
- mikomi-0.1.0a1/docs/user/en/configuration.md +236 -0
- mikomi-0.1.0a1/docs/user/en/getting-started.md +115 -0
- mikomi-0.1.0a1/docs/user/en/index.md +57 -0
- mikomi-0.1.0a1/docs/user/en/install.md +81 -0
- mikomi-0.1.0a1/docs/user/en/storage.md +132 -0
- mikomi-0.1.0a1/examples/README.md +32 -0
- mikomi-0.1.0a1/examples/check_mappings.py +93 -0
- mikomi-0.1.0a1/examples/credits/manual.toml +52 -0
- mikomi-0.1.0a1/examples/csv/examplegpu/billing.csv +5 -0
- mikomi-0.1.0a1/examples/csv/examplegpu/mappings/allocations.sql +14 -0
- mikomi-0.1.0a1/examples/csv/examplegpu/mappings/balances.sql +12 -0
- mikomi-0.1.0a1/examples/csv/examplegpu/mappings/costs.sql +14 -0
- mikomi-0.1.0a1/examples/csv/examplegpu/mappings/grants.sql +14 -0
- mikomi-0.1.0a1/examples/csv/examplegpu-focus/billing.csv +2 -0
- mikomi-0.1.0a1/examples/csv/examplegpu-focus/mappings/focus.sql +26 -0
- mikomi-0.1.0a1/examples/focus/focus-1.4-sample.csv +2 -0
- mikomi-0.1.0a1/examples/mikomi.toml +93 -0
- mikomi-0.1.0a1/examples/preview/examplegpu-expected.json +37 -0
- mikomi-0.1.0a1/pyproject.toml +133 -0
- mikomi-0.1.0a1/src/mikomi/__init__.py +5 -0
- mikomi-0.1.0a1/src/mikomi/__main__.py +7 -0
- mikomi-0.1.0a1/src/mikomi/_version.py +3 -0
- mikomi-0.1.0a1/src/mikomi/cli.py +528 -0
- mikomi-0.1.0a1/src/mikomi/config.py +624 -0
- mikomi-0.1.0a1/src/mikomi/connectors/__init__.py +34 -0
- mikomi-0.1.0a1/src/mikomi/connectors/base.py +333 -0
- mikomi-0.1.0a1/src/mikomi/connectors/manual.py +57 -0
- mikomi-0.1.0a1/src/mikomi/doctor.py +166 -0
- mikomi-0.1.0a1/src/mikomi/errors.py +23 -0
- mikomi-0.1.0a1/src/mikomi/logging.py +126 -0
- mikomi-0.1.0a1/src/mikomi/py.typed +0 -0
- mikomi-0.1.0a1/src/mikomi/storage/__init__.py +1 -0
- mikomi-0.1.0a1/src/mikomi/storage/catalog.py +91 -0
- mikomi-0.1.0a1/src/mikomi/storage/reader.py +278 -0
- mikomi-0.1.0a1/src/mikomi/storage/sandbox.py +111 -0
- mikomi-0.1.0a1/src/mikomi/storage/tables.py +984 -0
- mikomi-0.1.0a1/src/mikomi/storage/writer.py +249 -0
- mikomi-0.1.0a1/src/mikomi/templates.py +199 -0
- mikomi-0.1.0a1/src/mikomi/workspace.py +297 -0
- mikomi-0.1.0a1/tests/_guard.py +106 -0
- mikomi-0.1.0a1/tests/_sitecustomize/sitecustomize.py +19 -0
- mikomi-0.1.0a1/tests/conftest.py +204 -0
- mikomi-0.1.0a1/tests/e2e_cli/golden/doctor.txt +9 -0
- mikomi-0.1.0a1/tests/e2e_cli/golden/init.txt +7 -0
- mikomi-0.1.0a1/tests/e2e_cli/golden/query-schemas.json +43 -0
- mikomi-0.1.0a1/tests/e2e_cli/golden/query-tables.txt +30 -0
- mikomi-0.1.0a1/tests/e2e_cli/golden/query-versions.csv +7 -0
- mikomi-0.1.0a1/tests/e2e_cli/test_cli.py +177 -0
- mikomi-0.1.0a1/tests/fixtures/tables.json +602 -0
- mikomi-0.1.0a1/tests/integration/test_storage.py +418 -0
- mikomi-0.1.0a1/tests/integration/test_workspace.py +251 -0
- mikomi-0.1.0a1/tests/test_docs.py +319 -0
- mikomi-0.1.0a1/tests/test_website.py +286 -0
- mikomi-0.1.0a1/tests/unit/test_catalog.py +95 -0
- mikomi-0.1.0a1/tests/unit/test_cli_parser.py +127 -0
- mikomi-0.1.0a1/tests/unit/test_config.py +309 -0
- mikomi-0.1.0a1/tests/unit/test_logging.py +69 -0
- mikomi-0.1.0a1/tests/unit/test_raw_store.py +137 -0
- mikomi-0.1.0a1/tests/unit/test_sandbox.py +122 -0
- mikomi-0.1.0a1/tests/unit/test_tables.py +161 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
.venv/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
.ruff_cache/
|
|
7
|
+
.mypy_cache/
|
|
8
|
+
*.egg-info/
|
|
9
|
+
dist/
|
|
10
|
+
|
|
11
|
+
# Secrets: never committed, never read by agents (AGENTS.md).
|
|
12
|
+
.env
|
|
13
|
+
.env.*
|
|
14
|
+
!.env.example
|
|
15
|
+
|
|
16
|
+
# A local workspace used for development: `mikomi init .local` or any `*.duckdb`.
|
|
17
|
+
.local/
|
|
18
|
+
*.duckdb
|
|
19
|
+
*.duckdb.wal
|
|
20
|
+
|
|
21
|
+
# Test and UI-test output
|
|
22
|
+
.coverage
|
|
23
|
+
coverage/
|
|
24
|
+
test-results/
|
|
25
|
+
playwright-report/
|
|
26
|
+
|
|
27
|
+
# The built website (website/build.py).
|
|
28
|
+
website/dist/
|
|
29
|
+
|
|
30
|
+
# Agents' worktrees are copies of the repository, not the repository.
|
|
31
|
+
.claude/worktrees/
|
|
32
|
+
|
|
33
|
+
# OS noise
|
|
34
|
+
.DS_Store
|
mikomi-0.1.0a1/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.
|
mikomi-0.1.0a1/NOTICE
ADDED
mikomi-0.1.0a1/PKG-INFO
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: mikomi
|
|
3
|
+
Version: 0.1.0a1
|
|
4
|
+
Summary: Open-source FinOps for startups: cloud and AI costs and credits as Apache Iceberg tables, processed with DuckDB, with the provenance behind every number.
|
|
5
|
+
Project-URL: Homepage, https://mikomi.dev
|
|
6
|
+
Project-URL: Repository, https://github.com/kaitencloud/mikomi
|
|
7
|
+
Project-URL: Issues, https://github.com/kaitencloud/mikomi/issues
|
|
8
|
+
Author-email: KAITEN INC <support@kaiten.sh>
|
|
9
|
+
License-Expression: Apache-2.0
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
License-File: NOTICE
|
|
12
|
+
Keywords: cloud-costs,credits,duckdb,finops,focus,iceberg
|
|
13
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
17
|
+
Classifier: Operating System :: POSIX
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: Database
|
|
23
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
24
|
+
Classifier: Typing :: Typed
|
|
25
|
+
Requires-Python: >=3.12
|
|
26
|
+
Requires-Dist: boto3>=1.35
|
|
27
|
+
Requires-Dist: duckdb>=1.4
|
|
28
|
+
Requires-Dist: fastapi>=0.115
|
|
29
|
+
Requires-Dist: httpx>=0.28
|
|
30
|
+
Requires-Dist: jinja2>=3.1.4
|
|
31
|
+
Requires-Dist: pydantic<3,>=2.11
|
|
32
|
+
Requires-Dist: pyiceberg[pyarrow,pyiceberg-core,sql-sqlite]>=0.10
|
|
33
|
+
Requires-Dist: uvicorn>=0.32
|
|
34
|
+
Provides-Extra: databricks
|
|
35
|
+
Requires-Dist: databricks-sql-connector>=4.0; extra == 'databricks'
|
|
36
|
+
Description-Content-Type: text/markdown
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<picture>
|
|
40
|
+
<source srcset="docs/design/brand/wordmark/mikomi-lockup-stacked-dark.svg" media="(prefers-color-scheme: dark)">
|
|
41
|
+
<img src="docs/design/brand/wordmark/mikomi-lockup-stacked-light.svg" alt="Mikomi" width="220">
|
|
42
|
+
</picture>
|
|
43
|
+
</p>
|
|
44
|
+
|
|
45
|
+
# Mikomi
|
|
46
|
+
|
|
47
|
+
**Mikomi** (見込み, *outlook*) is an open-source FinOps tool for startups, by
|
|
48
|
+
[Kaiten](https://kaiten.sh): it collects cloud and AI costs and credits, keeps them as Apache
|
|
49
|
+
Iceberg tables in the [FOCUS](https://focus.finops.org) format next to a credit ledger,
|
|
50
|
+
processes them with DuckDB, and shows how much runway the credits really give, with the
|
|
51
|
+
provenance behind every number.
|
|
52
|
+
|
|
53
|
+
> **Status: under construction, V1 in progress.** This pre-release creates a workspace, its
|
|
54
|
+
> Iceberg catalog and every table, checks it (`mikomi doctor`) and queries it
|
|
55
|
+
> (`mikomi query`); collecting costs and credits comes next. The first release will come with
|
|
56
|
+
> its documentation at mikomi.dev. Until then this repository is where the work happens, in
|
|
57
|
+
> the open.
|
|
58
|
+
|
|
59
|
+
## Try it
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
uv sync
|
|
63
|
+
uv run mikomi init demo
|
|
64
|
+
cd demo && uv run mikomi doctor
|
|
65
|
+
uv run mikomi query "select table_name from information_schema.tables order by 1"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The user documentation is in [`docs/user/en/`](docs/user/en/index.md).
|
|
69
|
+
|
|
70
|
+
## Toolchain
|
|
71
|
+
|
|
72
|
+
Python ≥ 3.12, [uv](https://docs.astral.sh/uv/), DuckDB for compute, Apache Iceberg
|
|
73
|
+
(PyIceberg) for storage. One command, `mikomi`.
|
|
74
|
+
|
|
75
|
+
## Repository
|
|
76
|
+
|
|
77
|
+
| Path | What |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `src/mikomi/` | the package: configuration, workspace, storage (catalog, tables, writer, reader), connectors, CLI |
|
|
80
|
+
| `tests/` | unit, integration and CLI end-to-end tests, the docs and website tests; `tests/fixtures/tables.json` pins the tables |
|
|
81
|
+
| `docs/user/` | the user documentation, held to the code by `tests/test_docs.py` |
|
|
82
|
+
| `website/` | the static site of mikomi.dev: `website/build.py` builds it into `website/dist/` |
|
|
83
|
+
| `examples/` | configuration, FOCUS and CSV samples, SQL mappings, manual credits — the fixtures of the test suite |
|
|
84
|
+
| `docs/design/brand/` | the mascot, its states, the lock-ups, the favicons and the design tokens |
|
|
85
|
+
| `AGENTS.md`, `CLAUDE.md` | standing rules for agents working here |
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
Mikomi is open source and licensed under the [Apache License, Version 2.0](./LICENSE).
|
|
90
|
+
|
|
91
|
+
By contributing, you agree to certify your contribution under the
|
|
92
|
+
[Developer Certificate of Origin 1.1](./DCO.md).
|
|
93
|
+
|
|
94
|
+
The Kaiten and Mikomi names and logos are not licensed under Apache-2.0. See the
|
|
95
|
+
[Kaiten trademark policy](https://github.com/kaitencloud/kaiten/blob/main/TRADEMARKS.md).
|
mikomi-0.1.0a1/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source srcset="docs/design/brand/wordmark/mikomi-lockup-stacked-dark.svg" media="(prefers-color-scheme: dark)">
|
|
4
|
+
<img src="docs/design/brand/wordmark/mikomi-lockup-stacked-light.svg" alt="Mikomi" width="220">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
# Mikomi
|
|
9
|
+
|
|
10
|
+
**Mikomi** (見込み, *outlook*) is an open-source FinOps tool for startups, by
|
|
11
|
+
[Kaiten](https://kaiten.sh): it collects cloud and AI costs and credits, keeps them as Apache
|
|
12
|
+
Iceberg tables in the [FOCUS](https://focus.finops.org) format next to a credit ledger,
|
|
13
|
+
processes them with DuckDB, and shows how much runway the credits really give, with the
|
|
14
|
+
provenance behind every number.
|
|
15
|
+
|
|
16
|
+
> **Status: under construction, V1 in progress.** This pre-release creates a workspace, its
|
|
17
|
+
> Iceberg catalog and every table, checks it (`mikomi doctor`) and queries it
|
|
18
|
+
> (`mikomi query`); collecting costs and credits comes next. The first release will come with
|
|
19
|
+
> its documentation at mikomi.dev. Until then this repository is where the work happens, in
|
|
20
|
+
> the open.
|
|
21
|
+
|
|
22
|
+
## Try it
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
uv sync
|
|
26
|
+
uv run mikomi init demo
|
|
27
|
+
cd demo && uv run mikomi doctor
|
|
28
|
+
uv run mikomi query "select table_name from information_schema.tables order by 1"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
The user documentation is in [`docs/user/en/`](docs/user/en/index.md).
|
|
32
|
+
|
|
33
|
+
## Toolchain
|
|
34
|
+
|
|
35
|
+
Python ≥ 3.12, [uv](https://docs.astral.sh/uv/), DuckDB for compute, Apache Iceberg
|
|
36
|
+
(PyIceberg) for storage. One command, `mikomi`.
|
|
37
|
+
|
|
38
|
+
## Repository
|
|
39
|
+
|
|
40
|
+
| Path | What |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `src/mikomi/` | the package: configuration, workspace, storage (catalog, tables, writer, reader), connectors, CLI |
|
|
43
|
+
| `tests/` | unit, integration and CLI end-to-end tests, the docs and website tests; `tests/fixtures/tables.json` pins the tables |
|
|
44
|
+
| `docs/user/` | the user documentation, held to the code by `tests/test_docs.py` |
|
|
45
|
+
| `website/` | the static site of mikomi.dev: `website/build.py` builds it into `website/dist/` |
|
|
46
|
+
| `examples/` | configuration, FOCUS and CSV samples, SQL mappings, manual credits — the fixtures of the test suite |
|
|
47
|
+
| `docs/design/brand/` | the mascot, its states, the lock-ups, the favicons and the design tokens |
|
|
48
|
+
| `AGENTS.md`, `CLAUDE.md` | standing rules for agents working here |
|
|
49
|
+
|
|
50
|
+
## License
|
|
51
|
+
|
|
52
|
+
Mikomi is open source and licensed under the [Apache License, Version 2.0](./LICENSE).
|
|
53
|
+
|
|
54
|
+
By contributing, you agree to certify your contribution under the
|
|
55
|
+
[Developer Certificate of Origin 1.1](./DCO.md).
|
|
56
|
+
|
|
57
|
+
The Kaiten and Mikomi names and logos are not licensed under Apache-2.0. See the
|
|
58
|
+
[Kaiten trademark policy](https://github.com/kaitencloud/kaiten/blob/main/TRADEMARKS.md).
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
# Configuration
|
|
2
|
+
|
|
3
|
+
`mikomi.toml` holds the whole configuration of a workspace; every key is listed on this page, and a key that is not is an error.
|
|
4
|
+
|
|
5
|
+
## The file
|
|
6
|
+
|
|
7
|
+
`mikomi init` writes `mikomi.toml` with every key of the schema, the optional blocks
|
|
8
|
+
commented out, so that the file is its own reference. Paths in it are relative to the
|
|
9
|
+
workspace. A minimal file:
|
|
10
|
+
|
|
11
|
+
```toml
|
|
12
|
+
[workspace]
|
|
13
|
+
name = "acme-finops"
|
|
14
|
+
|
|
15
|
+
[catalog]
|
|
16
|
+
type = "sql"
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Mikomi reads the file whenever a command opens the workspace. A problem — a TOML syntax
|
|
20
|
+
error, an unknown key, a missing key, a value of the wrong kind — stops the command with a
|
|
21
|
+
message that names the key and, when it can, the line:
|
|
22
|
+
|
|
23
|
+
```text
|
|
24
|
+
mikomi: mikomi.toml, line 6: catalog.wharehouse: unknown key (did you mean warehouse?)
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`mikomi doctor` reports the same problems as a failed `config` check.
|
|
28
|
+
|
|
29
|
+
## Secrets are references
|
|
30
|
+
|
|
31
|
+
A secret is never written in `mikomi.toml`. Where a key takes a secret, its value is a
|
|
32
|
+
reference to an environment variable:
|
|
33
|
+
|
|
34
|
+
```toml
|
|
35
|
+
[[sources]]
|
|
36
|
+
id = "openrouter"
|
|
37
|
+
kind = "openrouter"
|
|
38
|
+
api_key = { env = "OPENROUTER_MANAGEMENT_KEY" }
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Mikomi reads the variable only when it needs the value, and replaces the value by `***`
|
|
42
|
+
anywhere it could be written: logs, errors and command output. A secret written in clear
|
|
43
|
+
(`api_key = "…"`) is refused, and the message does not repeat it. `mikomi doctor` says, for
|
|
44
|
+
each reference, whether the variable is set.
|
|
45
|
+
|
|
46
|
+
Credentials for an object store (an `s3://` warehouse) are not configured here either: they
|
|
47
|
+
come from the provider's standard chain, such as AWS profiles and instance roles.
|
|
48
|
+
|
|
49
|
+
## `[workspace]`
|
|
50
|
+
|
|
51
|
+
| Key | Default | Meaning |
|
|
52
|
+
|---|---|---|
|
|
53
|
+
| `name` | required | the workspace's name, shown by the commands |
|
|
54
|
+
| `timezone` | `"UTC"` | an IANA time zone, such as `"Europe/Paris"`, for displaying times; Mikomi stores every time in UTC |
|
|
55
|
+
| `lookback_days` | `35` | the default window of `mikomi run`, in days |
|
|
56
|
+
|
|
57
|
+
## `[catalog]`
|
|
58
|
+
|
|
59
|
+
The catalog holds the Iceberg tables. [Storage](storage.md) explains the choice.
|
|
60
|
+
|
|
61
|
+
| Key | Applies to | Meaning |
|
|
62
|
+
|---|---|---|
|
|
63
|
+
| `type` | all | `"sql"`: a local catalog in `state/catalog.sqlite`; `"rest"`: a shared Iceberg REST catalog |
|
|
64
|
+
| `warehouse` | all | `sql`: a directory of the workspace (default `"warehouse"`) or an object-store URI such as `s3://bucket/prefix`; `rest`: the catalog's warehouse, on Databricks the Unity Catalog catalog |
|
|
65
|
+
| `preset` | `rest` | `"databricks"`: derive the Iceberg REST endpoint and the OAuth endpoint from `host` |
|
|
66
|
+
| `host` | `rest` with the preset | the Databricks workspace URL, starting with `https://` |
|
|
67
|
+
| `uri` | `rest` without a preset | the catalog's REST endpoint |
|
|
68
|
+
| `credential` | `rest` | a secret reference to `client_id:client_secret` of a service principal (OAuth) |
|
|
69
|
+
| `token` | `rest` | a secret reference to a bearer token, such as a personal access token; not with `credential` |
|
|
70
|
+
|
|
71
|
+
Unity Catalog on Databricks:
|
|
72
|
+
|
|
73
|
+
```toml
|
|
74
|
+
[catalog]
|
|
75
|
+
type = "rest"
|
|
76
|
+
preset = "databricks"
|
|
77
|
+
host = "https://dbc-a1b2c3d4-e5f6.cloud.databricks.com"
|
|
78
|
+
warehouse = "mikomi_dev"
|
|
79
|
+
credential = { env = "DATABRICKS_CLIENT_CREDENTIAL" }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Any other Iceberg REST catalog:
|
|
83
|
+
|
|
84
|
+
```toml
|
|
85
|
+
[catalog]
|
|
86
|
+
type = "rest"
|
|
87
|
+
uri = "https://lakekeeper.example/catalog"
|
|
88
|
+
warehouse = "finops"
|
|
89
|
+
token = { env = "LAKEKEEPER_TOKEN" }
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## `[maintenance]`
|
|
93
|
+
|
|
94
|
+
| Key | Default | Meaning |
|
|
95
|
+
|---|---|---|
|
|
96
|
+
| `keep_days` | `30` | `mikomi maintain` expires the table snapshots older than this |
|
|
97
|
+
|
|
98
|
+
## `[alerts]`
|
|
99
|
+
|
|
100
|
+
| Key | Default | Meaning |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `spike_ratio` | `1.3` | a cost spike is this month's cost, projected to the month's end, above last month's times this ratio; more than 1 |
|
|
103
|
+
|
|
104
|
+
## `[scheduler]`
|
|
105
|
+
|
|
106
|
+
Read by `mikomi serve`, which runs the collection on a schedule. With cron or a CI, run
|
|
107
|
+
`mikomi run` instead.
|
|
108
|
+
|
|
109
|
+
| Key | Default | Meaning |
|
|
110
|
+
|---|---|---|
|
|
111
|
+
| `every` | `"24h"` | the interval between runs, in hours (`"6h"`) or minutes (`"30m"`), or `"off"` |
|
|
112
|
+
| `at` | `"04:00"` | the time of day of daily runs, 24-hour, in `[workspace] timezone` |
|
|
113
|
+
| `export_after_run` | `false` | write the single-file extracts of `exports/` after each scheduled run |
|
|
114
|
+
|
|
115
|
+
## `[serve]`
|
|
116
|
+
|
|
117
|
+
| Key | Default | Meaning |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| `host` | `"127.0.0.1"` | the address `mikomi serve` listens on |
|
|
120
|
+
| `port` | `7177` | its port |
|
|
121
|
+
|
|
122
|
+
## `[[sources]]`
|
|
123
|
+
|
|
124
|
+
One `[[sources]]` table per origin of data. Every source has:
|
|
125
|
+
|
|
126
|
+
| Key | Default | Meaning |
|
|
127
|
+
|---|---|---|
|
|
128
|
+
| `id` | required | the source's name: lowercase letters, digits, `-` and `_`; unique in the file |
|
|
129
|
+
| `kind` | required | `aws`, `openrouter`, `focus_file`, `csv` or `manual` |
|
|
130
|
+
| `enabled` | `true` | a disabled source is kept in the file and skipped |
|
|
131
|
+
|
|
132
|
+
The other keys depend on the kind. In this pre-release, `mikomi doctor` checks the `manual`
|
|
133
|
+
source's file; the connectors of the other kinds are not available yet, and the doctor says
|
|
134
|
+
so.
|
|
135
|
+
|
|
136
|
+
### `kind = "manual"`
|
|
137
|
+
|
|
138
|
+
Credits declared by hand in a TOML file.
|
|
139
|
+
|
|
140
|
+
| Key | Default | Meaning |
|
|
141
|
+
|---|---|---|
|
|
142
|
+
| `path` | `"credits/manual.toml"` | the file of manual credits |
|
|
143
|
+
|
|
144
|
+
### `kind = "aws"`
|
|
145
|
+
|
|
146
|
+
| Key | Default | Meaning |
|
|
147
|
+
|---|---|---|
|
|
148
|
+
| `account_id` | required | the 12-digit account the Billing API is called for |
|
|
149
|
+
| `payer_account` | `false` | aggregate the consolidated billing family |
|
|
150
|
+
| `region` | `"us-east-1"` | the Billing API endpoint region |
|
|
151
|
+
| `credentials` | the default chain | a boto3 profile name |
|
|
152
|
+
|
|
153
|
+
`[sources.focus_export]`, the FOCUS Data Export on S3: `bucket`, `prefix` and
|
|
154
|
+
`focus_version` (the version the export declares, such as `"1.0"`), all required when the
|
|
155
|
+
table is present. `[sources.credits]`: `enabled` (default `true`).
|
|
156
|
+
|
|
157
|
+
```toml
|
|
158
|
+
[[sources]]
|
|
159
|
+
id = "aws-main"
|
|
160
|
+
kind = "aws"
|
|
161
|
+
account_id = "123456789012"
|
|
162
|
+
payer_account = true
|
|
163
|
+
[sources.focus_export]
|
|
164
|
+
bucket = "acme-billing-exports"
|
|
165
|
+
prefix = "focus/acme-focus-export"
|
|
166
|
+
focus_version = "1.0"
|
|
167
|
+
[sources.credits]
|
|
168
|
+
enabled = true
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `kind = "openrouter"`
|
|
172
|
+
|
|
173
|
+
| Key | Default | Meaning |
|
|
174
|
+
|---|---|---|
|
|
175
|
+
| `api_key` | required | a secret reference to an OpenRouter management key |
|
|
176
|
+
|
|
177
|
+
### `kind = "focus_file"`
|
|
178
|
+
|
|
179
|
+
A FOCUS file from a provider without a connector, imported as is.
|
|
180
|
+
|
|
181
|
+
| Key | Default | Meaning |
|
|
182
|
+
|---|---|---|
|
|
183
|
+
| `path` | required | a CSV, gzip CSV or Parquet file, a glob, or an `s3://` URI |
|
|
184
|
+
| `focus_version` | required | the FOCUS version the file declares: `"1.0"`, `"1.2"`, `"1.3"` or `"1.4"` |
|
|
185
|
+
| `provider` | none | the provider's name, for display |
|
|
186
|
+
|
|
187
|
+
### `kind = "csv"`
|
|
188
|
+
|
|
189
|
+
A proprietary CSV file mapped with SQL: one `SELECT` per destination table.
|
|
190
|
+
|
|
191
|
+
| Key | Default | Meaning |
|
|
192
|
+
|---|---|---|
|
|
193
|
+
| `provider` | required | the provider's name, stored on every row |
|
|
194
|
+
| `path` | required | the file, or a glob |
|
|
195
|
+
|
|
196
|
+
`[sources.csv]`, how to read the file:
|
|
197
|
+
|
|
198
|
+
| Key | Default | Meaning |
|
|
199
|
+
|---|---|---|
|
|
200
|
+
| `delimiter` | `","` | one character |
|
|
201
|
+
| `header` | `true` | the first line names the columns |
|
|
202
|
+
| `encoding` | `"utf-8"` | `"utf-8"`, `"utf-8-sig"` or `"latin-1"` |
|
|
203
|
+
| `decimal_separator` | `"."` | `"."` or `","` |
|
|
204
|
+
| `timezone` | `"UTC"` | the time zone of timestamps written without one |
|
|
205
|
+
| `null_values` | `["", "NULL"]` | the texts read as no value |
|
|
206
|
+
|
|
207
|
+
`[[sources.mappings]]`, one per destination:
|
|
208
|
+
|
|
209
|
+
| Key | Default | Meaning |
|
|
210
|
+
|---|---|---|
|
|
211
|
+
| `destination` | required | `focus`, `staging.non_focus_costs`, `credits.grants`, `credits.pools`, `credits.balance_snapshots`, `credits.allocations` or `credits.events` |
|
|
212
|
+
| `sql` | required | the file of the mapping's `SELECT` |
|
|
213
|
+
| `focus_version` | `"1.4"` | the FOCUS version of a `focus` mapping; only for that destination |
|
|
214
|
+
|
|
215
|
+
`[sources.import]`: `on_error`, `"quarantine"` (default: publish the valid rows, keep the
|
|
216
|
+
others aside) or `"strict"` (publish nothing of the source when a row is refused).
|
|
217
|
+
|
|
218
|
+
## The workspace directory
|
|
219
|
+
|
|
220
|
+
| Path | What |
|
|
221
|
+
|---|---|
|
|
222
|
+
| `mikomi.toml` | this configuration |
|
|
223
|
+
| `warehouse/` | the tables, with a local catalog whose warehouse is a directory |
|
|
224
|
+
| `raw/` | every artifact fetched or read, kept unchanged: `raw/<source_id>/<YYYY-MM-DD>/<sha256>-<name>` |
|
|
225
|
+
| `mappings/` | the SQL mappings of CSV sources |
|
|
226
|
+
| `credits/` | the files of manual credits |
|
|
227
|
+
| `exports/` | single-file extracts |
|
|
228
|
+
| `state/` | `catalog.sqlite` (local catalog), `mikomi.lock`, `mikomi.log` |
|
|
229
|
+
|
|
230
|
+
`raw/`, `warehouse/`, `state/` and `exports/` hold account ids, resource ids, tags and the
|
|
231
|
+
data: the `.gitignore` that `mikomi init` writes keeps them out of version control.
|
|
232
|
+
|
|
233
|
+
## Related
|
|
234
|
+
|
|
235
|
+
- [Storage](storage.md)
|
|
236
|
+
- [Your first workspace](getting-started.md)
|