Skip to main content

This 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

Project description

Downloads Supported Versions GitHub PyPI Documentation Status PyPI - Downloads Downloads Upload to PIP PyPI - Format

API Key Generation Package

This 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.

The 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.

It 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.

Please 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.

By 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.

Privacy Policy

This 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.

Please 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.

It 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.

By 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.

Please note that this is just an example, and it is important to consult with a legal professional before publishing any package to ensure that it meets all legal and regulatory requirements.

Installation

To install your package, you can use the pip package manager by running the following command in your command line:

pip install generateApiKey

Importing the package

Once the package is installed, you can import the package in your code by using the import statement:

from generateApiKey import generateApiKey

Generating an API key

To generate an API key, you can use the generateApiKey() function and pass in the secret, seed, and an optional include keyword. For example:

from generateApiKey import generateApiKey

seed='12'
secret='Topsecrect'
api_key=generateApiKey(secret,seed)
print(api_key)
secret = 'mysecret'
seed = 'randomseed'
api_key = generateApiKey(secret, seed)
print(api_key)
secret = 'mysecret'
seed = 'randomseed'
include = "TopSecretWord"
api_key = generateApiKey(secret, seed, include)
print(api_key)

This will generate an API key based on the provided secret, seed, and include keyword.

Error handling It 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.

try:
    secret = 'mysecret'
    seed = 'randomseed'
    include = "Production"
    api_key = generateApiKey(secret, seed, include)
    print(api_key)
except Exception as e:
    print(e)

You can use the None return in the package function, to check if the key generation was successful.

api_key = generateApiKey(secret, seed, include)
if api_key is None:
    print("Failed to generate api key")
else:
    print(api_key)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

generateApiKey-0.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

generateApiKey-0.2-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file generateApiKey-0.2.tar.gz.

File metadata

  • Download URL: generateApiKey-0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for generateApiKey-0.2.tar.gz
Algorithm Hash digest
SHA256 903b958a4600be285ab78b4fad2509aeba838acd9919be8d1548df0fe9c07219
MD5 e2d51f230fe3c7f06e0b8d3c8d87bd01
BLAKE2b-256 7cb3f936179c67b232d414090762531663554db83cd4114446b0c3932d87e476

See more details on using hashes here.

File details

Details for the file generateApiKey-0.2-py3-none-any.whl.

File metadata

  • Download URL: generateApiKey-0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for generateApiKey-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f6cec0e3a6f49b5361091e843ac3c549e689fed9591c5a93c61962d98f2313c2
MD5 861e527dc9422c71f4d85689b166f1a5
BLAKE2b-256 40663668c0e700acf803a3999e366f1f9c9cc4e300495bb135e6dad3aac0e142

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page