{"id":16556614,"url":"https://github.com/nuhmanpk/generate-api-key","last_synced_at":"2025-10-28T20:30:38.677Z","repository":{"id":144700901,"uuid":"593069347","full_name":"nuhmanpk/generate-api-key","owner":"nuhmanpk","description":"generate API keys using a secret, seed, and an optional include keyword.","archived":false,"fork":false,"pushed_at":"2024-01-14T10:14:17.000Z","size":53,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T17:51:13.353Z","etag":null,"topics":["api","api-keys","apikey","generate-api-key","generate-password","hacktoberfest","hacktoberfest-accepted","hacktoberfest2022","hacktoberfest2023","key","pypi-package","pypi-source","python","python-package","python-pypi","simple","source","twine"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/generateApiKey","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/nuhmanpk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["nuhmanpk"]}},"created_at":"2023-01-25T06:35:16.000Z","updated_at":"2024-11-20T01:24:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"86b14675-403f-418b-ac02-fe3fa076a0f2","html_url":"https://github.com/nuhmanpk/generate-api-key","commit_stats":{"total_commits":27,"total_committers":2,"mean_commits":13.5,"dds":0.07407407407407407,"last_synced_commit":"6277d4a9a8513331d3ff23fd060b07ff87701692"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fgenerate-api-key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fgenerate-api-key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fgenerate-api-key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuhmanpk%2Fgenerate-api-key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuhmanpk","download_url":"https://codeload.github.com/nuhmanpk/generate-api-key/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238710603,"owners_count":19517735,"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","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":["api","api-keys","apikey","generate-api-key","generate-password","hacktoberfest","hacktoberfest-accepted","hacktoberfest2022","hacktoberfest2023","key","pypi-package","pypi-source","python","python-package","python-pypi","simple","source","twine"],"created_at":"2024-10-11T20:05:13.275Z","updated_at":"2025-10-28T20:30:38.668Z","avatar_url":"https://github.com/nuhmanpk.png","language":"Python","funding_links":["https://github.com/sponsors/nuhmanpk"],"categories":[],"sub_categories":[],"readme":"[![Downloads](https://static.pepy.tech/personalized-badge/generateApiKey?period=total\u0026units=abbreviation\u0026left_color=grey\u0026right_color=yellow\u0026left_text=Total-Downloads)](https://pepy.tech/project/generateApiKey)\n[![Supported Versions](https://img.shields.io/pypi/pyversions/generateApiKey.svg)](https://pypi.org/project/YoutubeTags)\n![GitHub](https://img.shields.io/github/license/nuhmanpk/generate-api-key)\n![PyPI](https://img.shields.io/pypi/v/generateApiKey)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/generateApiKey)\n[![Downloads](https://static.pepy.tech/personalized-badge/generateApiKey?period=week\u0026units=international_system\u0026left_color=grey\u0026right_color=brightgreen\u0026left_text=Downloads/Week)](https://pepy.tech/project/generateApiKey)\n[![Upload to PIP](https://github.com/nuhmanpk/generate-api-key/actions/workflows/pypi-upload.yml/badge.svg?branch=main\u0026event=workflow_dispatch)](https://github.com/nuhmanpk/generate-api-key/actions/workflows/Pypi-uploads.yml)\n![PyPI - Format](https://img.shields.io/pypi/format/generateApiKey)\n# API Key Generation Package\n\nTimestamp and Numeric Representation: Now, the package incorporates a time-based and date-based hashing mechanism, adding an extra layer of security to your API keys. It captures the current timestamp and numeric representation of the key generation process, creating a unique identifier that's closely tied to the moment it was generated. This feature adds an element of time-based uniqueness to your keys, making them even more secure and less predictable.\n\nThis package provides a convenient way to generate API keys using a secret, seed, and an optional include keyword. The generated keys are unique and secure, making them suitable for use in a variety of applications.\n\nThe package supports generating API keys using a variety of methods such as UUID v5 and SHA-256 algorithm. The keys are generated using a combination of seed, secret, and include keyword. Additionally, the package allows you to insert the include keyword at a random position in the seed which will make it more difficult to guess.\n\nIt is important to keep the secret used to generate the keys secure and not share it with unauthorized parties. Additionally, the package can only be used for legitimate and legal purposes.\n\nPlease keep in mind that, even though this package provides a secure way to generate API keys, it is still important to use other security measures such as rate limiting, IP whitelisting, and encryption to protect your API and the data it accesses.\n\nBy using this package, you agree to take all necessary precautions to protect the data and resources accessed with the keys from unauthorized access or misuse. It is recommended to consult with a security expert before using this package or handling sensitive data.\n\n# Privacy Policy\n\nThis package generates API keys that can be used to access sensitive data or resources. By using this package, you agree to keep the secret used to generate the keys secure and not share it with unauthorized parties. Additionally, the package can only be used for legitimate and legal purposes.\n\nPlease be aware that the package may cause a security risk if not used properly. The authors of this package cannot be held responsible for any unauthorized access or misuse of the keys generated by this package.\n\nIt is the user's responsibility to ensure the security of the keys and the protection of the data. It is recommended to consult with a security expert before using this package or handling sensitive data.\n\nBy using this package, you agree to take all necessary precautions to protect the data and resources accessed with the keys from unauthorized access or misuse.\n\n\n\n# Installation\nTo install your package, you can use the pip package manager by running the following command in your command line:\n\n```python\npip install generateApiKey\n```\n\n# Importing the package\nOnce the package is installed, you can import the package in your code by using the import statement:\n```python\nfrom generateApiKey import generateApiKey\n```\n# Generating an API key\nTo generate an API key, you can use the generateApiKey() function and pass in the secret, seed, and an optional include keyword. For example:\n\n### Without Dashes\n\n```python\nfrom generateApiKey import generateApiKey\n\nseed='12'\nsecret='Topsecrect'\napi_key= await generateApiKey(secret,seed) # KaEQfEOP0ZMXbkgElkuPRv6iUrMxQDytwrQPKhH0eO8\nprint(api_key)\n```\n\n\n```python\nfrom generateApiKey import generateApiKey\napi_key = await generateApiKey(secret='Topsecret', seed='12',include='user1') # iFuOcas8lSCw8jKWVIg4ru9WXhfr8erl5YzWc8kQw\nprint(api_key)\n```\n### With Dashes\n\n```python\nfrom generateApiKey import generateApiKey\napi_key = await generateApiKey(secret='Topsecret', seed='12',\n    include='user1',add_dashes=True) # 1ff0f93f-c14d-5768-b324-626f1099948b\nprint(api_key)\n```\n### With prefix\n\n```python\nseed='12'\nsecret='Topsecrect'\napi_key=await generateApiKey(secret,seed,\n    prefix='hf',add_dashes=True) # hf-db27e2d7-d0bb-5014-9f75-4c2fda33f727 \nprint(api_key)\n\n```\n\n### With include\n\n```python\nsecret = 'mysecret'\nseed = 'randomseed'\ninclude = \"TopSecretWord\"\napi_key = await generateApiKey(secret, seed, include)\nprint(api_key)\n```\nThis will generate an API key based on the provided secret, seed, and include keyword.\n\n## Error handling\nIt is a good practice to handle errors, you can use the try and except block to handle any exception that may occur during the key generation process.\n\n```python\ntry:\n    secret = 'mysecret'\n    seed = 'randomseed'\n    include = \"Production\"\n    api_key = await generateApiKey(secret, seed, include)\n    print(api_key)\nexcept Exception as e:\n    print(e)\n```\n\nYou can use the None return in the package function, to check if the key generation was successful.\n\n```python\napi_key = await generateApiKey(secret, seed, include)\nif api_key is None:\n    print(\"Failed to generate api key\")\nelse:\n    print(api_key)\n```\n# Parameters \n\n| **Variable** |\t**Type** |\t**Required** |\t**Example Value** | **Default** |\t**Description** |\n|----------|---------|-----------|--------------------|-------------|-------------------|\n| secret |\t`String` |\tYes |\t\"Topsecret\" | - |\tThe secret key used to generate the API key. It should be kept private and not shared with unauthorized parties. |\n| seed |\t`String` |\tYes |\t\"12\" | - |\tA value used to seed the generation of the API key. It can be any value, but it should be unique for each key. |\n| include |\t`String` |\tOptional |\t\"user1\" | - |\tAn optional value that can be included in the generated API key. It can be used to identify the user or application associated with the key. |\n| add_dashes |\t`boolean` |\tOptional |\tTrue | False |\tA value used to determine wheather to add dashes or not in a key |\n| prefix | `String` | Optional | \"hf\" | None | A Value that is added infornt of the apikey generted to make your key unique for your platform  |\n\n\nBy using this package, you are solely liable for any legal issues that may arise from its unauthorized use or misuse, as well as any security risks that may result from not properly securing the secret key used to generate the API keys.\n\n# Fair Use Policy:\n\nThis package is provided as is, without any warranties or guarantees of any kind. We are not liable for any damages or losses that may result from its use. We reserve the right to change or discontinue the package at any time without notice.\n\nWe encourage you to use the package responsibly, and to report any security issues or bugs you may encounter.\n\n\n\nMade with ❤️ , **Happy coding! 🚀**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhmanpk%2Fgenerate-api-key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuhmanpk%2Fgenerate-api-key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuhmanpk%2Fgenerate-api-key/lists"}