dotfill 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.
dotfill-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 omasoud
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
dotfill-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,204 @@
1
+ Metadata-Version: 2.4
2
+ Name: dotfill
3
+ Version: 0.1.0
4
+ Summary: Local-only helper to populate and maintain a personal .env file with API tokens and identity variables
5
+ Keywords: api-tokens,dotenv,env,local-first,secrets
6
+ Author: Osama Masoud
7
+ Author-email: Osama Masoud <osama.masoud@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.14
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Topic :: Utilities
21
+ Requires-Dist: typer>=0.12
22
+ Requires-Dist: fastapi>=0.115
23
+ Requires-Dist: uvicorn>=0.30
24
+ Requires-Dist: pydantic>=2.8
25
+ Requires-Dist: python-dotenv>=1.0
26
+ Requires-Dist: httpx>=0.27
27
+ Requires-Dist: platformdirs>=4.10.0
28
+ Requires-Python: >=3.14
29
+ Project-URL: Homepage, https://github.com/omasoud/dotfill
30
+ Project-URL: Repository, https://github.com/omasoud/dotfill
31
+ Project-URL: Documentation, https://github.com/omasoud/dotfill/tree/main/docs
32
+ Project-URL: Issues, https://github.com/omasoud/dotfill/issues
33
+ Description-Content-Type: text/markdown
34
+
35
+ # dotfill
36
+
37
+ dotfill is a local-only helper for maintaining token and identity variables in a personal `.env` file. It runs a Python CLI plus a localhost web UI, reads TOML configuration, and writes only after explicit user action.
38
+
39
+ Generic `dotfill` ships with no services, identities, domains, token names, or import aliases. A user config or a wrapper package supplies those definitions.
40
+
41
+ ## Installation
42
+
43
+ For CLI use, install dotfill as an isolated tool:
44
+
45
+ ```powershell
46
+ uv tool install dotfill
47
+ ```
48
+
49
+ or:
50
+
51
+ ```powershell
52
+ pipx install dotfill
53
+ ```
54
+
55
+ For use as a library or project dependency:
56
+
57
+ ```powershell
58
+ uv add dotfill
59
+ ```
60
+
61
+ or:
62
+
63
+ ```powershell
64
+ pip install dotfill
65
+ ```
66
+
67
+ dotfill requires Python 3.14 or newer.
68
+
69
+ ## Quick Start
70
+
71
+ ```powershell
72
+ dotfill status
73
+ dotfill
74
+ dotfill config path
75
+ dotfill config open
76
+ ```
77
+
78
+ Useful options:
79
+
80
+ ```powershell
81
+ dotfill --config-root C:\tmp\dotfill-config --profile demo status
82
+ dotfill --env-path C:\work\project\.env
83
+ ```
84
+
85
+ ## Documentation
86
+
87
+ - [Getting started](docs/getting-started.md) walks through the first config and dashboard run.
88
+ - [TOML config schema](docs/config-schema.md) is the full user-facing config reference.
89
+ - [Troubleshooting](docs/troubleshooting.md) covers common setup, config, import, and service-test issues.
90
+
91
+ Maintainer requirements, design notes, and implementation tracking live under `dev/docs/`.
92
+
93
+ ## Configuration
94
+
95
+ dotfill loads two optional TOML files from the resolved config directory:
96
+
97
+ ```text
98
+ config_common.toml
99
+ config.toml
100
+ ```
101
+
102
+ `config_common.toml` is intended for managed baseline configuration. `config.toml` is intended for user-owned overrides. Both files must include `version = 1` when present.
103
+
104
+ See [docs/config-schema.md](docs/config-schema.md) for the complete schema.
105
+
106
+ Default config root:
107
+
108
+ ```text
109
+ platformdirs.user_config_dir("dotfill", appauthor=False, roaming=True)
110
+ ```
111
+
112
+ Profiles live under `profiles/<name>` inside the config root.
113
+
114
+ Example:
115
+
116
+ ```toml
117
+ version = 1
118
+ name = "Example profile"
119
+
120
+ [target]
121
+ default_env_path = "~/.env"
122
+
123
+ [identities.WORK_EMAIL]
124
+ source = "literal"
125
+ value = "alice@example.com"
126
+
127
+ [identities.WORK_USER]
128
+ source = "local_part"
129
+ from = "WORK_EMAIL"
130
+
131
+ [derived.WORK_USERNAME]
132
+ from_identity = "WORK_EMAIL"
133
+
134
+ [services.EXAMPLE]
135
+ display_name = "Example"
136
+ token_var = "EXAMPLE_TOKEN"
137
+ token_url = "https://service.example.com/users/{WORK_USER}/tokens"
138
+ test_url = "https://service.example.com/me"
139
+ auth = "bearer"
140
+ tls_verify = true
141
+ icon = "key"
142
+
143
+ [import_aliases.OLD_EXAMPLE_TOKEN]
144
+ target = "EXAMPLE_TOKEN"
145
+ ```
146
+
147
+ Set `enabled = false` in `config.toml` to disable an inherited service, identity, derived variable, or import alias.
148
+
149
+ ## `.env` Behavior
150
+
151
+ The target `.env` contains ordinary environment values only. dotfill no longer reads legacy service or derived-variable meta-configuration from `.env`; those assignments are unrelated content unless their exact names are explicitly configured as managed variables in TOML.
152
+
153
+ The parser/writer preserves comments, blank lines, unrelated variables, unrelated duplicates, and line endings. Duplicate managed variables are rejected before writes.
154
+
155
+ ## Local UI
156
+
157
+ `dotfill` starts a server bound to `127.0.0.1`, opens the dashboard, and serves static assets from the installed package. The dashboard can:
158
+
159
+ - show configured identities, derived variables, services, config directory, and target `.env`;
160
+ - save service tokens;
161
+ - fill missing enabled derived variables during saves;
162
+ - import token/derived values from another `.env`-like file;
163
+ - test configured bearer tokens on explicit user action.
164
+
165
+ When no services are configured, the dashboard shows an empty generic state.
166
+
167
+ ## Privacy
168
+
169
+ - No cloud backend, accounts, telemetry, or remote sync.
170
+ - Raw token values are not returned by state/import APIs.
171
+ - Dropped import values are kept only in backend session memory as secret values.
172
+ - The browser keeps session and token input in memory only; no browser storage is used.
173
+ - Service tests send `Authorization: Bearer <token>` only to configured test URLs.
174
+ - Service tests verify TLS by default. Use `tls_verify = false` only when a configured service explicitly requires it.
175
+
176
+ ## Wrapper Packages
177
+
178
+ Wrapper packages can provide managed `config_common.toml` content and launch dotfill through:
179
+
180
+ ```python
181
+ from dotfill.entrypoints import run_dotfill
182
+
183
+ raise SystemExit(
184
+ run_dotfill(
185
+ default_profile="team",
186
+ before_config_load=sync_managed_config,
187
+ )
188
+ )
189
+ ```
190
+
191
+ Wrappers should not import the Typer app directly. User overrides remain in `config.toml`.
192
+
193
+ ## Development
194
+
195
+ From a source checkout:
196
+
197
+ ```powershell
198
+ uv sync
199
+ uv run pytest
200
+ uv run dotfill status
201
+ uv build
202
+ ```
203
+
204
+ If the virtual environment is activated, `dotfill --help` works directly. Without activation, use `uv run dotfill ...` or `.\.venv\Scripts\dotfill.exe ...`.
@@ -0,0 +1,170 @@
1
+ # dotfill
2
+
3
+ dotfill is a local-only helper for maintaining token and identity variables in a personal `.env` file. It runs a Python CLI plus a localhost web UI, reads TOML configuration, and writes only after explicit user action.
4
+
5
+ Generic `dotfill` ships with no services, identities, domains, token names, or import aliases. A user config or a wrapper package supplies those definitions.
6
+
7
+ ## Installation
8
+
9
+ For CLI use, install dotfill as an isolated tool:
10
+
11
+ ```powershell
12
+ uv tool install dotfill
13
+ ```
14
+
15
+ or:
16
+
17
+ ```powershell
18
+ pipx install dotfill
19
+ ```
20
+
21
+ For use as a library or project dependency:
22
+
23
+ ```powershell
24
+ uv add dotfill
25
+ ```
26
+
27
+ or:
28
+
29
+ ```powershell
30
+ pip install dotfill
31
+ ```
32
+
33
+ dotfill requires Python 3.14 or newer.
34
+
35
+ ## Quick Start
36
+
37
+ ```powershell
38
+ dotfill status
39
+ dotfill
40
+ dotfill config path
41
+ dotfill config open
42
+ ```
43
+
44
+ Useful options:
45
+
46
+ ```powershell
47
+ dotfill --config-root C:\tmp\dotfill-config --profile demo status
48
+ dotfill --env-path C:\work\project\.env
49
+ ```
50
+
51
+ ## Documentation
52
+
53
+ - [Getting started](docs/getting-started.md) walks through the first config and dashboard run.
54
+ - [TOML config schema](docs/config-schema.md) is the full user-facing config reference.
55
+ - [Troubleshooting](docs/troubleshooting.md) covers common setup, config, import, and service-test issues.
56
+
57
+ Maintainer requirements, design notes, and implementation tracking live under `dev/docs/`.
58
+
59
+ ## Configuration
60
+
61
+ dotfill loads two optional TOML files from the resolved config directory:
62
+
63
+ ```text
64
+ config_common.toml
65
+ config.toml
66
+ ```
67
+
68
+ `config_common.toml` is intended for managed baseline configuration. `config.toml` is intended for user-owned overrides. Both files must include `version = 1` when present.
69
+
70
+ See [docs/config-schema.md](docs/config-schema.md) for the complete schema.
71
+
72
+ Default config root:
73
+
74
+ ```text
75
+ platformdirs.user_config_dir("dotfill", appauthor=False, roaming=True)
76
+ ```
77
+
78
+ Profiles live under `profiles/<name>` inside the config root.
79
+
80
+ Example:
81
+
82
+ ```toml
83
+ version = 1
84
+ name = "Example profile"
85
+
86
+ [target]
87
+ default_env_path = "~/.env"
88
+
89
+ [identities.WORK_EMAIL]
90
+ source = "literal"
91
+ value = "alice@example.com"
92
+
93
+ [identities.WORK_USER]
94
+ source = "local_part"
95
+ from = "WORK_EMAIL"
96
+
97
+ [derived.WORK_USERNAME]
98
+ from_identity = "WORK_EMAIL"
99
+
100
+ [services.EXAMPLE]
101
+ display_name = "Example"
102
+ token_var = "EXAMPLE_TOKEN"
103
+ token_url = "https://service.example.com/users/{WORK_USER}/tokens"
104
+ test_url = "https://service.example.com/me"
105
+ auth = "bearer"
106
+ tls_verify = true
107
+ icon = "key"
108
+
109
+ [import_aliases.OLD_EXAMPLE_TOKEN]
110
+ target = "EXAMPLE_TOKEN"
111
+ ```
112
+
113
+ Set `enabled = false` in `config.toml` to disable an inherited service, identity, derived variable, or import alias.
114
+
115
+ ## `.env` Behavior
116
+
117
+ The target `.env` contains ordinary environment values only. dotfill no longer reads legacy service or derived-variable meta-configuration from `.env`; those assignments are unrelated content unless their exact names are explicitly configured as managed variables in TOML.
118
+
119
+ The parser/writer preserves comments, blank lines, unrelated variables, unrelated duplicates, and line endings. Duplicate managed variables are rejected before writes.
120
+
121
+ ## Local UI
122
+
123
+ `dotfill` starts a server bound to `127.0.0.1`, opens the dashboard, and serves static assets from the installed package. The dashboard can:
124
+
125
+ - show configured identities, derived variables, services, config directory, and target `.env`;
126
+ - save service tokens;
127
+ - fill missing enabled derived variables during saves;
128
+ - import token/derived values from another `.env`-like file;
129
+ - test configured bearer tokens on explicit user action.
130
+
131
+ When no services are configured, the dashboard shows an empty generic state.
132
+
133
+ ## Privacy
134
+
135
+ - No cloud backend, accounts, telemetry, or remote sync.
136
+ - Raw token values are not returned by state/import APIs.
137
+ - Dropped import values are kept only in backend session memory as secret values.
138
+ - The browser keeps session and token input in memory only; no browser storage is used.
139
+ - Service tests send `Authorization: Bearer <token>` only to configured test URLs.
140
+ - Service tests verify TLS by default. Use `tls_verify = false` only when a configured service explicitly requires it.
141
+
142
+ ## Wrapper Packages
143
+
144
+ Wrapper packages can provide managed `config_common.toml` content and launch dotfill through:
145
+
146
+ ```python
147
+ from dotfill.entrypoints import run_dotfill
148
+
149
+ raise SystemExit(
150
+ run_dotfill(
151
+ default_profile="team",
152
+ before_config_load=sync_managed_config,
153
+ )
154
+ )
155
+ ```
156
+
157
+ Wrappers should not import the Typer app directly. User overrides remain in `config.toml`.
158
+
159
+ ## Development
160
+
161
+ From a source checkout:
162
+
163
+ ```powershell
164
+ uv sync
165
+ uv run pytest
166
+ uv run dotfill status
167
+ uv build
168
+ ```
169
+
170
+ If the virtual environment is activated, `dotfill --help` works directly. Without activation, use `uv run dotfill ...` or `.\.venv\Scripts\dotfill.exe ...`.
@@ -0,0 +1,61 @@
1
+ [project]
2
+ name = "dotfill"
3
+ version = "0.1.0"
4
+ description = "Local-only helper to populate and maintain a personal .env file with API tokens and identity variables"
5
+ readme = "README.md"
6
+ authors = [
7
+ { name = "Osama Masoud", email = "osama.masoud@gmail.com"}
8
+ ]
9
+ license = "MIT"
10
+ license-files = ["LICENSE"]
11
+ requires-python = ">=3.14"
12
+ keywords = ["api-tokens", "dotenv", "env", "local-first", "secrets"]
13
+ classifiers = [
14
+ "Development Status :: 3 - Alpha",
15
+ "Environment :: Console",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3 :: Only",
22
+ "Programming Language :: Python :: 3.14",
23
+ "Topic :: Software Development :: Libraries :: Python Modules",
24
+ "Topic :: Utilities",
25
+ ]
26
+ dependencies = [
27
+ "typer>=0.12",
28
+ "fastapi>=0.115",
29
+ "uvicorn>=0.30",
30
+ "pydantic>=2.8",
31
+ "python-dotenv>=1.0",
32
+ "httpx>=0.27",
33
+ "platformdirs>=4.10.0",
34
+ ]
35
+
36
+ [project.scripts]
37
+ dotfill = "dotfill.entrypoints:main"
38
+
39
+ [project.urls]
40
+ Homepage = "https://github.com/omasoud/dotfill"
41
+ Repository = "https://github.com/omasoud/dotfill"
42
+ Documentation = "https://github.com/omasoud/dotfill/tree/main/docs"
43
+ Issues = "https://github.com/omasoud/dotfill/issues"
44
+
45
+ [build-system]
46
+ requires = ["uv_build>=0.11.7,<0.12.0"]
47
+ build-backend = "uv_build"
48
+
49
+ [dependency-groups]
50
+ dev = [
51
+ "pytest>=9.0.3",
52
+ "pytest-mock>=3.14",
53
+ "respx>=0.21",
54
+ ]
55
+
56
+ [tool.pytest.ini_options]
57
+ testpaths = ["tests"]
58
+
59
+
60
+ [tool.uv]
61
+ exclude-newer = "2 days" # Exclude packages released in the last 2 days as a protection against undiscovered supply chain vulnerabilities.
@@ -0,0 +1,8 @@
1
+ """dotfill — local-only API token/identity .env helper."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ __version__ = version("dotfill")
7
+ except PackageNotFoundError:
8
+ __version__ = "0.0.0"
@@ -0,0 +1,6 @@
1
+ """Allow `python -m dotfill`."""
2
+
3
+ from .entrypoints import main
4
+
5
+ if __name__ == "__main__":
6
+ main()