# GigaML Secrets
A library to manage AWS secrets with caching and environment variable integration.
## Installation
To install the package, use pip:
pip install gigaml_secrets
## Setup
Ensure you have your AWS credentials configured. You can set them up using the AWS CLI:
aws configure
## Usage
After installing the package, you can use the library in your scripts as follows:
1. **Use the library in your script**:
```python
from gigaml_secrets import CachedSecretsManager, load_secrets
import os
def main():
# Specify the environment and list of secrets to load
env = 'prod'
secret_names = ['ADMIN_API_KEY', 'BACKEND_API']
load_secrets(env, secret_names)
# Now you can access the secrets from environment variables
admin_api_key = os.getenv('ADMIN_API_KEY')
backend_api = os.getenv('BACKEND_API')
print(f"ADMIN_API_KEY: {admin_api_key}")
print(f"BACKEND_API: {backend_api}")
if __name__ == "__main__":
main()
```
2. **Run your script**:
python your_script.py
## Example
Here is an example script (`main.py`) that demonstrates how to use the `gigaml_secrets` package:
```python
import os
from gigaml_secrets import CachedSecretsManager, load_secrets
def main():
# Initialize the CachedSecretsManager
env = 'prod'
secret_names = ['ADMIN_API_KEY', 'BACKEND_API']
load_secrets(env, secret_names)
# Fetch and set secrets as environment variables
for name in secret_names:
print(f"Environment variable {name}: {os.getenv(name)}")
if __name__ == "__main__":
main()
```
## License
This project is licensed under the MIT License.
Raw data
{
"_id": null,
"home_page": "https://github.com/GigaML/GigaML-Secrets",
"name": "gigaml-secrets",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "aws secrets manager caching environment variables",
"author": "Tautik Agrahari",
"author_email": "tautik@gigaml.com",
"download_url": "https://files.pythonhosted.org/packages/f6/ef/866694107c213d29cf33a9ed2d9ef708ba9e4f1624221f3b21c8fb858979/gigaml_secrets-0.46.tar.gz",
"platform": null,
"description": "# GigaML Secrets\n\nA library to manage AWS secrets with caching and environment variable integration.\n\n## Installation\n\nTo install the package, use pip:\n\n pip install gigaml_secrets\n\n## Setup\n\nEnsure you have your AWS credentials configured. You can set them up using the AWS CLI:\n\n aws configure\n\n## Usage\n\nAfter installing the package, you can use the library in your scripts as follows:\n\n1. **Use the library in your script**:\n\n ```python\n from gigaml_secrets import CachedSecretsManager, load_secrets\n import os\n\n def main():\n # Specify the environment and list of secrets to load\n env = 'prod'\n secret_names = ['ADMIN_API_KEY', 'BACKEND_API']\n load_secrets(env, secret_names)\n\n # Now you can access the secrets from environment variables\n admin_api_key = os.getenv('ADMIN_API_KEY')\n backend_api = os.getenv('BACKEND_API')\n\n print(f\"ADMIN_API_KEY: {admin_api_key}\")\n print(f\"BACKEND_API: {backend_api}\")\n\n if __name__ == \"__main__\":\n main()\n ```\n\n2. **Run your script**:\n\n python your_script.py\n\n## Example\n\nHere is an example script (`main.py`) that demonstrates how to use the `gigaml_secrets` package:\n\n ```python\n import os\n from gigaml_secrets import CachedSecretsManager, load_secrets\n\n def main():\n # Initialize the CachedSecretsManager\n env = 'prod'\n secret_names = ['ADMIN_API_KEY', 'BACKEND_API']\n load_secrets(env, secret_names)\n\n # Fetch and set secrets as environment variables\n for name in secret_names:\n print(f\"Environment variable {name}: {os.getenv(name)}\")\n\n if __name__ == \"__main__\":\n main()\n ```\n\n## License\n\nThis project is licensed under the MIT License.\n",
"bugtrack_url": null,
"license": null,
"summary": "A library to manage AWS secrets with caching and environment variable integration",
"version": "0.46",
"project_urls": {
"Homepage": "https://github.com/GigaML/GigaML-Secrets"
},
"split_keywords": [
"aws",
"secrets",
"manager",
"caching",
"environment",
"variables"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d582089a8487c07ecdfb5a5e6772376fd8d5fda3ba1b871401c6e40bb262896e",
"md5": "18f48e6c3369fd46e566fd0aa558a4e6",
"sha256": "4c344c35af5b967999766f7414aa4724ad9e5d9e80d75297e43090e518c62016"
},
"downloads": -1,
"filename": "gigaml_secrets-0.46-py3-none-any.whl",
"has_sig": false,
"md5_digest": "18f48e6c3369fd46e566fd0aa558a4e6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 3680,
"upload_time": "2024-08-18T17:29:24",
"upload_time_iso_8601": "2024-08-18T17:29:24.631314Z",
"url": "https://files.pythonhosted.org/packages/d5/82/089a8487c07ecdfb5a5e6772376fd8d5fda3ba1b871401c6e40bb262896e/gigaml_secrets-0.46-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f6ef866694107c213d29cf33a9ed2d9ef708ba9e4f1624221f3b21c8fb858979",
"md5": "5b2b0d92436e39e9a9c0db606790915e",
"sha256": "a1855517eb8ab26454c040b7faa73bc7f4b7ffb8e92b8c4bd84974772144ebd2"
},
"downloads": -1,
"filename": "gigaml_secrets-0.46.tar.gz",
"has_sig": false,
"md5_digest": "5b2b0d92436e39e9a9c0db606790915e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3085,
"upload_time": "2024-08-18T17:29:26",
"upload_time_iso_8601": "2024-08-18T17:29:26.543048Z",
"url": "https://files.pythonhosted.org/packages/f6/ef/866694107c213d29cf33a9ed2d9ef708ba9e4f1624221f3b21c8fb858979/gigaml_secrets-0.46.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-18 17:29:26",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "GigaML",
"github_project": "GigaML-Secrets",
"github_not_found": true,
"lcname": "gigaml-secrets"
}