Package: nttblink
NTTBlink: An Elegant Solution for Secrets and Documents ManagementNTTBlink Python is a sophisticated Python module that presents a seamless way to handle automation secrets and documentsInstallationThe installation of NTTBlink is a walk in the park, facilitated by pip:pipinstallnttblinkNow, NTTBlink stands ready for your command.UsageThe charm of Python lies in its simplicity and power, traits that NTTBlink embodies fully. Here's a step-by-step guide on how to wield this power:Import the PackageStart your journey by invoking the magic of NTTBlink.fromnttblinkimportBlinkblink=Blink()Set Environment Variables for SecretsWith a single command, normalize your secrets - remove spaces, transform to uppercase, and set them as environment variables.  This is a easy one liner to get your secrets into your environment.blink.secret_set_to_env()Create a New SecretCreating a new secret is as easy as whispering to a trusted friend. Provide the key, a description, and the secret itself as a dictionary.new_secret=blink.secret_create('secretname','secret description',{'key':'value'})List All SecretsSummon the catalogue of all secrets at your disposal.secrets=blink.secret_list()forsecretinsecrets:print(secret)Unveil Secret DetailsPeek into the contents of each secret, illuminating the hidden truth.forsecretinsecrets:secret_details=blink.secret_get(secret['id'])print(secret_details)Enumerate All DocumentsWith NTTBlink, documents are at your fingertips. List them with ease.documents=blink.document_list()fordocumentindocuments:print(document)Store Each DocumentLet no document be left unread. NTTBlink empowers you to retrieve each document and save it to your local directory.fordocumentindocuments:blink.document_download(document['id'],document['name'])Upload a New DocumentWith NTTBlink, you can upload a new document to your project. Simply provide the path to the document and the name you wish to give it.blink.document_upload('path/to/document','documentname.txt')With NTTBlink, you have a versatile tool to manage secrets and documents effortlessly. Enjoy this power responsibly.Environment VariablesTo breathe life into NTTBlink, we need to supply it with the correct environment variables. These variables serve as the keys to the realm, enabling interactions with the Blink project.To establish these variables, you'll need to venture to the developer panel on your project page in Blink and collect the correct values. As a guiding beacon, we provide a sample environment file for testing your Python scripts:# Sample .env fileBLINK_PROJECT_ID="622a1fab001900435372fecfb8fd8a13"BLINK_TOKEN="qwk23q8aaskqwu2iqasmasdf"BLINK_BASE_URL="https://am-automate.nttltd.global.ntt"BLINK_AUTOMATION_ID=9Here's a brief explanation of each variable:BLINK_PROJECT_ID: This is the unique identifier of your Blink project. It tells NTTBlink which project it should interact with.BLINK_TOKEN: This is your authorization token. It's like the passport for NTTBlink, granting it permission to perform operations in your Blink project.BLINK_BASE_URL: This is the base URL for your Blink instance. It's the address that NTTBlink will visit to carry out your commands.BLINK_AUTOMATION_ID: This is the identifier for the specific automation you are working with.
Remember to replace the values in the sample .env file with your actual data.For safety reasons, never expose these environment variables publicly as they can provide unrestricted access to your project. Use .env files for local development, but ensure they're included in your .gitignore file. For deployment, use secure environment variables provided by your hosting service.