envdrift 4.2.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. envdrift/__init__.py +30 -0
  2. envdrift/_version.py +34 -0
  3. envdrift/api.py +192 -0
  4. envdrift/cli.py +42 -0
  5. envdrift/cli_commands/__init__.py +1 -0
  6. envdrift/cli_commands/diff.py +91 -0
  7. envdrift/cli_commands/encryption.py +630 -0
  8. envdrift/cli_commands/encryption_helpers.py +93 -0
  9. envdrift/cli_commands/hook.py +75 -0
  10. envdrift/cli_commands/init_cmd.py +117 -0
  11. envdrift/cli_commands/partial.py +222 -0
  12. envdrift/cli_commands/sync.py +1140 -0
  13. envdrift/cli_commands/validate.py +109 -0
  14. envdrift/cli_commands/vault.py +376 -0
  15. envdrift/cli_commands/version.py +15 -0
  16. envdrift/config.py +489 -0
  17. envdrift/constants.json +18 -0
  18. envdrift/core/__init__.py +30 -0
  19. envdrift/core/diff.py +233 -0
  20. envdrift/core/encryption.py +400 -0
  21. envdrift/core/parser.py +260 -0
  22. envdrift/core/partial_encryption.py +239 -0
  23. envdrift/core/schema.py +253 -0
  24. envdrift/core/validator.py +312 -0
  25. envdrift/encryption/__init__.py +117 -0
  26. envdrift/encryption/base.py +217 -0
  27. envdrift/encryption/dotenvx.py +236 -0
  28. envdrift/encryption/sops.py +458 -0
  29. envdrift/env_files.py +60 -0
  30. envdrift/integrations/__init__.py +21 -0
  31. envdrift/integrations/dotenvx.py +689 -0
  32. envdrift/integrations/precommit.py +266 -0
  33. envdrift/integrations/sops.py +85 -0
  34. envdrift/output/__init__.py +21 -0
  35. envdrift/output/rich.py +424 -0
  36. envdrift/py.typed +0 -0
  37. envdrift/sync/__init__.py +26 -0
  38. envdrift/sync/config.py +218 -0
  39. envdrift/sync/engine.py +383 -0
  40. envdrift/sync/operations.py +138 -0
  41. envdrift/sync/result.py +99 -0
  42. envdrift/vault/__init__.py +107 -0
  43. envdrift/vault/aws.py +282 -0
  44. envdrift/vault/azure.py +170 -0
  45. envdrift/vault/base.py +150 -0
  46. envdrift/vault/gcp.py +210 -0
  47. envdrift/vault/hashicorp.py +238 -0
  48. envdrift-4.2.1.dist-info/METADATA +160 -0
  49. envdrift-4.2.1.dist-info/RECORD +52 -0
  50. envdrift-4.2.1.dist-info/WHEEL +4 -0
  51. envdrift-4.2.1.dist-info/entry_points.txt +2 -0
  52. envdrift-4.2.1.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,160 @@
1
+ Metadata-Version: 2.4
2
+ Name: envdrift
3
+ Version: 4.2.1
4
+ Summary: Prevent environment variable drift with Pydantic schema validation, pre-commit hooks, and dotenvx encryption
5
+ Project-URL: Homepage, https://github.com/jainal09/envdrift
6
+ Project-URL: Documentation, https://jainal09.github.io/envdrift
7
+ Project-URL: Repository, https://github.com/jainal09/envdrift
8
+ Project-URL: Issues, https://github.com/jainal09/envdrift/issues
9
+ Author-email: Jainal Gosaliya <gosaliya.jainal@gmail.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: aws,azure,config,dotenv,dotenvx,drift,encryption,environment,gcp,hashicorp,pre-commit,pydantic,schema,secrets,validation,variables,vault
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Security
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Classifier: Topic :: Software Development :: Quality Assurance
24
+ Classifier: Typing :: Typed
25
+ Requires-Python: >=3.11
26
+ Requires-Dist: pydantic-settings>=2.0
27
+ Requires-Dist: pydantic>=2.0
28
+ Requires-Dist: python-dotenv>=1.0
29
+ Requires-Dist: rich>=13.0
30
+ Requires-Dist: typer>=0.9
31
+ Provides-Extra: all
32
+ Requires-Dist: azure-identity>=1.15; extra == 'all'
33
+ Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'all'
34
+ Requires-Dist: boto3>=1.34; extra == 'all'
35
+ Requires-Dist: google-cloud-secret-manager>=2.16; extra == 'all'
36
+ Requires-Dist: hvac>=2.0; extra == 'all'
37
+ Requires-Dist: pyyaml>=6.0; extra == 'all'
38
+ Provides-Extra: aws
39
+ Requires-Dist: boto3>=1.34; extra == 'aws'
40
+ Provides-Extra: azure
41
+ Requires-Dist: azure-identity>=1.15; extra == 'azure'
42
+ Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'azure'
43
+ Provides-Extra: dev
44
+ Requires-Dist: bandit>=1.7.0; extra == 'dev'
45
+ Requires-Dist: mkdocs-material>=9.5; extra == 'dev'
46
+ Requires-Dist: pre-commit>=3.0; extra == 'dev'
47
+ Requires-Dist: pyrefly>=0.2.0; extra == 'dev'
48
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
49
+ Requires-Dist: pytest-mock>=3.12; extra == 'dev'
50
+ Requires-Dist: pytest>=8.0; extra == 'dev'
51
+ Requires-Dist: pyyaml>=6.0; extra == 'dev'
52
+ Requires-Dist: ruff>=0.8.0; extra == 'dev'
53
+ Provides-Extra: docs
54
+ Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
55
+ Provides-Extra: gcp
56
+ Requires-Dist: google-cloud-secret-manager>=2.16; extra == 'gcp'
57
+ Provides-Extra: hashicorp
58
+ Requires-Dist: hvac>=2.0; extra == 'hashicorp'
59
+ Provides-Extra: precommit
60
+ Requires-Dist: pyyaml>=6.0; extra == 'precommit'
61
+ Provides-Extra: vault
62
+ Requires-Dist: azure-identity>=1.15; extra == 'vault'
63
+ Requires-Dist: azure-keyvault-secrets>=4.8; extra == 'vault'
64
+ Requires-Dist: boto3>=1.34; extra == 'vault'
65
+ Requires-Dist: google-cloud-secret-manager>=2.16; extra == 'vault'
66
+ Requires-Dist: hvac>=2.0; extra == 'vault'
67
+ Description-Content-Type: text/markdown
68
+
69
+ <p align="center">
70
+ <img src="https://raw.githubusercontent.com/jainal09/envdrift/main/docs/assets/images/env-drift-logo.png" alt="envdrift logo" width="300">
71
+ </p>
72
+
73
+ # envdrift
74
+
75
+ [![PyPI version](https://badge.fury.io/py/envdrift.svg)](https://badge.fury.io/py/envdrift)
76
+ [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
77
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
78
+ [![Docs](https://img.shields.io/badge/docs-mkdocs-blue)](https://jainal09.github.io/envdrift)
79
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
80
+ [![Pyrefly](https://img.shields.io/badge/types-pyrefly-blue)](https://github.com/facebook/pyrefly)
81
+ [![codecov](https://codecov.io/gh/jainal09/envdrift/graph/badge.svg)](https://codecov.io/gh/jainal09/envdrift)
82
+ [![SLOC](https://sloc.xyz/github/jainal09/envdrift)](https://sloc.xyz/github/jainal09/envdrift)
83
+
84
+ **Prevent environment variable drift between dev, staging, and production.**
85
+
86
+ ## The Problem
87
+
88
+ - A missing `DATABASE_URL` in production causes a 3am outage
89
+ - Staging has `NEW_FEATURE_FLAG=true` but production doesn't
90
+ - "It works on my machine!" becomes your team's motto
91
+
92
+ ## The Solution
93
+
94
+ ```bash
95
+ # Validate .env against Pydantic schema
96
+ envdrift validate .env --schema config.settings:Settings
97
+
98
+ # Compare dev vs prod
99
+ envdrift diff .env.development .env.production
100
+
101
+ # Check encryption status
102
+ envdrift encrypt .env.production --check
103
+ ```
104
+
105
+ ## Installation
106
+
107
+ ```bash
108
+ pip install envdrift
109
+ ```
110
+
111
+ ## Quick Start
112
+
113
+ **Define your schema:**
114
+
115
+ ```python
116
+ from pydantic import Field
117
+ from pydantic_settings import BaseSettings, SettingsConfigDict
118
+
119
+ class Settings(BaseSettings):
120
+ model_config = SettingsConfigDict(extra="forbid")
121
+
122
+ DATABASE_URL: str = Field(json_schema_extra={"sensitive": True})
123
+ API_KEY: str = Field(json_schema_extra={"sensitive": True})
124
+ DEBUG: bool = False
125
+ ```
126
+
127
+ **Validate:**
128
+
129
+ ```bash
130
+ envdrift validate .env --schema config.settings:Settings
131
+ ```
132
+
133
+ ## Features
134
+
135
+ | Feature | envdrift |
136
+ |----------------------------|-------------------------------|
137
+ | Schema validation | Pydantic-based |
138
+ | Cross-env diff | Yes |
139
+ | Pre-commit hooks | Yes |
140
+ | Encryption (dotenvx, SOPS) | Yes |
141
+ | Vault integration | Azure, AWS, HashiCorp, GCP |
142
+ | CI/CD mode | Yes |
143
+
144
+ ## Documentation
145
+
146
+ Full documentation: **[jainal09.github.io/envdrift](https://jainal09.github.io/envdrift)**
147
+
148
+ ## Development
149
+
150
+ ```bash
151
+ git clone https://github.com/jainal09/envdrift.git
152
+ cd envdrift
153
+ make dev
154
+ make test
155
+ make docs-serve
156
+ ```
157
+
158
+ ## License
159
+
160
+ MIT
@@ -0,0 +1,52 @@
1
+ envdrift/__init__.py,sha256=Lu10myR5GhpoF5VvIIpM5unM01bTaFBKk0F2l6J71Vk,942
2
+ envdrift/_version.py,sha256=pj0sbH-fF5lpPANVvMk0aWPxGkCuGiYKkGcu4D79KNw,704
3
+ envdrift/api.py,sha256=RKt7q5N_23QXu4k22maTd9BoHjskfqfYSrP5AQrVg78,6558
4
+ envdrift/cli.py,sha256=Dds8a0Z2wl0bmzaOtsIxbWjQukAe0PeWVLFB-WIaKJE,1234
5
+ envdrift/config.py,sha256=pNIJNv7pHxmzJJdwaVA_HnbGG5EiE2hjHqljcB51nuk,16467
6
+ envdrift/constants.json,sha256=QmXXzD2Q56VeG7dDY-OvHqH_nLIX3hZ0tmMgsZSUZ30,1348
7
+ envdrift/env_files.py,sha256=ckzcdUlB_fqy0RpII9sPg70nZ52fZG-CaSLEDPOTvCI,1967
8
+ envdrift/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
+ envdrift/cli_commands/__init__.py,sha256=NPm10nNDPKGVrl3ZHKj8mebgTxaLupLKS0IhHQ37YWs,52
10
+ envdrift/cli_commands/diff.py,sha256=pzFXvNupIV7pqU_grMkkMM77NgBPE_55Qtvq-NeGPjE,3316
11
+ envdrift/cli_commands/encryption.py,sha256=xqisXuVWspg6yS4imyQ0YvYeFGG7MvXqnHTzw_6_fRk,25059
12
+ envdrift/cli_commands/encryption_helpers.py,sha256=aNjmgbhYvrGOhnnPJP3va0NEMK7XwgeQDruW9EU6zwM,3395
13
+ envdrift/cli_commands/hook.py,sha256=GpvfX56QqTV4XS0gkruYvv1h6Yhe5fjQZICtC1gy-AU,2657
14
+ envdrift/cli_commands/init_cmd.py,sha256=QiGueqD5AZDoEp_Tbg0Ee5IT3dkUsTkKg6fT8b5B4zE,4114
15
+ envdrift/cli_commands/partial.py,sha256=HgMRlOV0OnCR6MsWWvSBpymPWuSGIX4oECfvfMSb1QU,7187
16
+ envdrift/cli_commands/sync.py,sha256=tcgpTVfzKprLdXAWaHfbpUPCLMysXVtFCUyno_6HG_c,45005
17
+ envdrift/cli_commands/validate.py,sha256=2vk8kVBTY3A5ARVBLYq_1l74x7bzPoHjZNTafDly814,3976
18
+ envdrift/cli_commands/vault.py,sha256=nEe_WKnkD_fzcdx3YDfKct_LhaRN_4t72nP5cuXqC7E,15011
19
+ envdrift/cli_commands/version.py,sha256=L8Ze0VgxAL2T_44mqKw3Xm86RUQf8Wu5vuDX0gYtRFA,404
20
+ envdrift/core/__init__.py,sha256=CM9wxoTeaHu8vAWxDvzocEv_6cTimI6SpoxEcoUT8ok,776
21
+ envdrift/core/diff.py,sha256=VyJw2Rzs2iGpjVzabEYlmjvN4QgxpGmiwwveFxT-DzY,7912
22
+ envdrift/core/encryption.py,sha256=betYW2wbnUFRjgy2K2KZjklkVifpezCKbg1gQ0LQqMY,14026
23
+ envdrift/core/parser.py,sha256=qMQlKTQVzC6pZmIDr45DZhM0wWKoIqPKbwhdm_H_eQ4,8151
24
+ envdrift/core/partial_encryption.py,sha256=0M9Y774j5zA6ca_6qB4gP3B5XfR9nmkQ2FJ8oGQU6lI,7027
25
+ envdrift/core/schema.py,sha256=fh5Lo5S_yuR9UGSo6CG0l61QmHcgmm_MZX0PiFCiEms,9101
26
+ envdrift/core/validator.py,sha256=PwwCT4uWvV3InaPNX-1ogFKlQvzJeiTiXcDws2xG71s,12395
27
+ envdrift/encryption/__init__.py,sha256=P_W-jWD7xa-fWOo21IMTJYLkZ1T13Jws5PTugOaVsL4,3710
28
+ envdrift/encryption/base.py,sha256=DDKxK97DNfWqUy8fsckv30VW1zbSVKrPWw5IIlSJCOs,5949
29
+ envdrift/encryption/dotenvx.py,sha256=sIr6FkxNY3f2hYVYszatSB7LMpmbmepUzXTP1HsXf_A,7639
30
+ envdrift/encryption/sops.py,sha256=azrz2fp6tIpR6GsjP2lYuf_zYuwqxOAIkLfm_66qubE,15143
31
+ envdrift/integrations/__init__.py,sha256=Z3OFI0GoUd787vlmScZoft_DLgEHw4ObFCf0xwtHlbQ,523
32
+ envdrift/integrations/dotenvx.py,sha256=HFUFx6lGDZejeRtwIKPEXgPmqDZSUmNjD08rI51wxf0,25957
33
+ envdrift/integrations/precommit.py,sha256=PNo7K4VHZsA9ZTlgMg9rqfp2AUjIxNgYmvohEnqabT8,8130
34
+ envdrift/integrations/sops.py,sha256=8RDQ17WmushdbEOL1I_VmnlTGEVDxdrq7zkM1T8fyoE,2613
35
+ envdrift/output/__init__.py,sha256=dvTHJtPXfdARoqP9GKRoaUbzaDVwmk1yGsPf8md1PJc,398
36
+ envdrift/output/rich.py,sha256=Oh54pdskaXIak7VhCEfabAIY829JNnEyzsNzqbCcjSQ,16052
37
+ envdrift/sync/__init__.py,sha256=KOQjKjI7_MWGcqP8lAG1-0oLjUSKP71aIuyDJtxG6j8,626
38
+ envdrift/sync/config.py,sha256=f4nOcBiNkx2ktVi653T3_9xFC_-GSapRx19T2nMa-eg,7752
39
+ envdrift/sync/engine.py,sha256=-UVxMaQ8C84wgqAS7fF5-nbpXUkEBWU3hlYPe9gKdNs,15394
40
+ envdrift/sync/operations.py,sha256=ubK7sBUnAo5dI5Z4XmbbePehGeYXGtw4oz43WBQER74,4513
41
+ envdrift/sync/result.py,sha256=8HwV5c0Q1a0rl1c_9WTnHfB7mWbLSw6pcIEdC-abasw,2803
42
+ envdrift/vault/__init__.py,sha256=GH1AkoqgXXfxT9lEiAUidZrEY_cwS1ur8E7JVfm7Kl0,3752
43
+ envdrift/vault/aws.py,sha256=agk-32xCQSD7MBgfYRuMxmU8WB7qjDxgKtKdnTqmeX4,10011
44
+ envdrift/vault/azure.py,sha256=uEjn9saJWXAq8-KgIZE5KAfdRzIO4iSkXS2PbbYfBwc,6132
45
+ envdrift/vault/base.py,sha256=7Ami0kfC3kA2-KgQuJMqRvginy5k3VlNqwnxVUN3CXs,4062
46
+ envdrift/vault/gcp.py,sha256=ratNN588Ty-LB9quGNtZJU6bu2Y2t2P1j5v__u3pjxU,7637
47
+ envdrift/vault/hashicorp.py,sha256=35EBiwduyjEDJ0oJuGtUPlZ3Y0CsGHD40ezpgow87Ps,8587
48
+ envdrift-4.2.1.dist-info/METADATA,sha256=IDyiL8z1dTLowh1s7eEuzYiQSezrthGI0WdNJDmF4uU,5901
49
+ envdrift-4.2.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
50
+ envdrift-4.2.1.dist-info/entry_points.txt,sha256=njqKNXn7qzidlqaoWgy8_Cwc8F_Sc2Jle2tyPUsMJDU,46
51
+ envdrift-4.2.1.dist-info/licenses/LICENSE,sha256=alWX8zV_Hd76Ze1Wasp1gVkcYypBD9VY5S8uqQhStQw,1072
52
+ envdrift-4.2.1.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.28.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ envdrift = envdrift.cli:app
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jainal Gosaliya
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.