{"id":15837607,"url":"https://github.com/muhammad-fiaz/keepsafe","last_synced_at":"2025-10-28T00:47:06.562Z","repository":{"id":217111463,"uuid":"743110296","full_name":"muhammad-fiaz/keepsafe","owner":"muhammad-fiaz","description":"KeepSafe: A secure and user-friendly solution for storing and distributing sensitive information such as keys and passwords in your projects.","archived":false,"fork":false,"pushed_at":"2024-11-19T13:45:04.000Z","size":28,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-28T00:47:01.684Z","etag":null,"topics":["decryption","encryption","encryption-decryption","environment-variables","keepsafe","lock","locker","package","poetry","pypi","python","python-library","python-package","secure-env","store-env"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/keepsafe/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammad-fiaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["muhammad-fiaz"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2024-01-14T11:14:31.000Z","updated_at":"2024-11-19T11:03:20.000Z","dependencies_parsed_at":"2024-01-14T16:59:25.994Z","dependency_job_id":"cecf892b-7947-40e5-b97a-70bb6342a734","html_url":"https://github.com/muhammad-fiaz/keepsafe","commit_stats":{"total_commits":3,"total_committers":2,"mean_commits":1.5,"dds":"0.33333333333333337","last_synced_commit":"e3202f8ed44b3572314d43b061640e7b42f1723c"},"previous_names":["muhammad-fiaz/keepsafe"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/muhammad-fiaz/keepsafe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Fkeepsafe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Fkeepsafe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Fkeepsafe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Fkeepsafe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammad-fiaz","download_url":"https://codeload.github.com/muhammad-fiaz/keepsafe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammad-fiaz%2Fkeepsafe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281366881,"owners_count":26488696,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["decryption","encryption","encryption-decryption","environment-variables","keepsafe","lock","locker","package","poetry","pypi","python","python-library","python-package","secure-env","store-env"],"created_at":"2024-10-05T15:40:56.665Z","updated_at":"2025-10-28T00:47:06.518Z","avatar_url":"https://github.com/muhammad-fiaz.png","language":"Python","funding_links":["https://github.com/sponsors/muhammad-fiaz"],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eKeepsafe: Securely store and distribute sensitive information like passwords and keys\u003c/h1\u003e\r\n\u003cp align=\"center\"\u003e\r\n  \u003cimg src=\"https://img.shields.io/pypi/v/keepsafe\" alt=\"PyPI Version\" /\u003e\r\n  \u003cimg src=\"https://img.shields.io/pypi/dm/keepsafe\" alt=\"PyPI Downloads\" /\u003e\r\n  \u003cimg src=\"https://img.shields.io/pypi/l/keepsafe\" alt=\"License\" /\u003e\r\n  \u003ca href=\"https://github.com/muhammad-fiaz/keepsafe/actions/workflows/github-code-scanning/codeql\"\u003e\r\n    \u003cimg src=\"https://github.com/muhammad-fiaz/keepsafe/actions/workflows/github-code-scanning/codeql/badge.svg\" alt=\"CodeQL\" /\u003e\r\n  \u003c/a\u003e  \u003cimg src=\"https://img.shields.io/pypi/pyversions/keepsafe\" alt=\"Python Versions\" /\u003e\r\n  \u003cimg src=\"https://img.shields.io/github/issues/muhammad-fiaz/keepsafe\" alt=\"Issues\" /\u003e\r\n  \u003cimg src=\"https://img.shields.io/github/issues-pr/muhammad-fiaz/keepsafe\" alt=\"Pull Requests\" /\u003e\r\n  \u003cimg src=\"https://img.shields.io/github/last-commit/muhammad-fiaz/keepsafe\" alt=\"Last Commit\" /\u003e\r\n  \u003cimg src=\"https://img.shields.io/github/contributors/muhammad-fiaz/keepsafe\" alt=\"Contributors\" /\u003e\r\n  \u003ca href=\"https://github.com/sponsors/muhammad-fiaz\"\u003e\r\n    \u003cimg src=\"https://img.shields.io/badge/sponsor-muhammad--fiaz-ff69b4\" alt=\"Sponsor\" /\u003e\r\n  \u003c/a\u003e\r\n\u003c/p\u003e\r\n\r\n## Table of Contents\r\n\r\n- [Introduction](#)\r\n- [Features](#features)\r\n- [Installation](#installation)\r\n- [Usage](#usage)\r\n  - [Initialize a new file with a master password](#initialize-a-new-file-with-a-master-password)\r\n  - [Add secrets](#add-secrets)\r\n  - [Retrieve secrets](#retrieve-secrets)\r\n  - [Export secrets to `.env` file](#export-secrets-to-env-file)\r\n- [Testing](#testing)\r\n- [License](#license)\r\n- [Contributing](#contributing)\r\n- [Contact](#contact)\r\n\r\n\r\nKeepsafe is a Python library that helps you securely store and retrieve sensitive information like passwords, API keys, and other secrets. It uses encryption techniques to ensure that your sensitive data is safe, and only accessible using the correct master password or decryption key.\r\n\r\n## Features\r\n\r\n- Securely store and retrieve secrets (e.g., passwords, API keys).\r\n- Encryption based on `Fernet` and `PBKDF2` for password-based key derivation.\r\n- Supports adding secrets using either the master password or decryption key.\r\n- Export secrets to `.env` files for use in applications.\r\n- Easily integrated into existing projects.\r\n\r\n## Installation\r\n\r\nYou can install `keepsafe` via `pip` from PyPI:\r\n\r\n```bash\r\npip install keepsafe\r\n```\r\n\r\n## Usage\r\n\r\n### Initialize a new file with a master password\r\n\r\nFirst, create a `Keepsafe` object and initialize the file:\r\n\r\n```python\r\nfrom keepsafe import KeepSafe\r\n\r\nks = KeepSafe(\"./secrets.keepsafe\")\r\ndecryption_key = ks.initialize_file(password=\"your_master_password\")\r\n```\r\n\r\n### Add secrets\r\n\r\nYou can add secrets either using the master password or the decryption key:\r\n\r\n```python\r\nks.add_secret(\"api_key\", \"super_secret_api_key\", password_or_decryption_key=\"your_master_password\")\r\nks.add_secret(\"email_password\", \"super_secret_email_password\", password_or_decryption_key=decryption_key)\r\n```\r\n\r\n### Retrieve secrets\r\n\r\nYou can retrieve secrets using the master password or the decryption key:\r\n\r\n```python\r\napi_key = ks.get_secret(\"api_key\", password_or_decryption_key=\"your_master_password\")\r\nemail_password = ks.get_secret(\"email_password\", password_or_decryption_key=decryption_key)\r\n\r\nprint(f\"API Key: {api_key}\")\r\nprint(f\"Email Password: {email_password}\")\r\n```\r\n\r\n### Export secrets to `.env` file\r\n\r\nTo unlock the file and export all secrets to a `.env` file:\r\n\r\n```python\r\nks.unlock(password=\"your_master_password\", env_file_path=\".env\")\r\n```\r\n\r\nThis will export the secrets into the `.env` file, where each secret will be written as `KEY=VALUE`.\r\n\r\n## Testing\r\n\r\nTo run tests, you can use `pytest`. This package includes basic tests to verify that the core functionality works as expected.\r\n\r\nRun the tests with:\r\n\r\n```bash\r\npytest\r\n```\r\n\r\n## License\r\n\r\nKeepsafe is distributed under the MIT License. See `LICENSE` for more information.\r\n\r\n## Contributing\r\n\r\nWe welcome contributions to Keepsafe! Before contributing, please make sure to read our [Code of Conduct](CODE_OF_CONDUCT.md) and follow the guidelines below to ensure a smooth collaboration process.\r\n\r\n**Please ensure you follow the [Code of Conduct](CODE_OF_CONDUCT.md) when contributing.**\r\n\r\nIf you encounter any issues or need assistance, feel free to open an issue or contact the maintainers.\r\n\r\nThank you for your contributions!\r\n\r\n## Contact\r\n\r\nFor any issues, bugs, or feature requests, please open an issue on the [GitHub repository](https://github.com/muhammad-fiaz/keepsafe).\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammad-fiaz%2Fkeepsafe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammad-fiaz%2Fkeepsafe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammad-fiaz%2Fkeepsafe/lists"}