A small nttblink connector package
Project description
NTTBlink: An Elegant Solution for Secrets and Documents Management
NTTBlink Python is a sophisticated Python module that presents a seamless way to handle automation secrets and documents
Installation
The installation of NTTBlink is a walk in the park, facilitated by pip:
pip install nttblink
Now, NTTBlink stands ready for your command.
Usage
The 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 Package
Start your journey by invoking the magic of NTTBlink.
from nttblink import Blink
blink = Blink()
Set Environment Variables for Secrets
With 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 Secret
Creating 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 Secrets
Summon the catalogue of all secrets at your disposal.
secrets = blink.secret_list()
for secret in secrets:
print(secret)
Unveil Secret Details
Peek into the contents of each secret, illuminating the hidden truth.
for secret in secrets:
secret_details = blink.secret_get(secret['id'])
print(secret_details)
Enumerate All Documents
With NTTBlink, documents are at your fingertips. List them with ease.
documents = blink.document_list()
for document in documents:
print(document)
Store Each Document
Let no document be left unread. NTTBlink empowers you to retrieve each document and save it to your local directory.
for document in documents:
blink.document_download(document['id'],document['name'])
Upload a New Document
With 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 Variables
To 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 file
BLINK_PROJECT_ID = "622a1fab001900435372fecfb8fd8a13"
BLINK_TOKEN = "qwk23q8aaskqwu2iqasmasdf"
BLINK_BASE_URL = "https://am-automate.nttltd.global.ntt"
BLINK_AUTOMATION_ID = 9
Here'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.
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
Built Distribution
File details
Details for the file nttblink-0.1.2.tar.gz
.
File metadata
- Download URL: nttblink-0.1.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cef15144f7a0d3d7f742e87bfbb1887ae26c47c7b13817d8dfb4b7f7c02ee65 |
|
MD5 | 37c1ee1c4914e33a302d17d0e9bda15d |
|
BLAKE2b-256 | 5534afda240eb691f77deb5b81cd99ee26b9e2491e474f0a12b09edbd0d018bd |
File details
Details for the file nttblink-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: nttblink-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f700b71974dc2fdbeb00bf2e88bdad63b41329615ed95482e562b4e91386eb84 |
|
MD5 | 1dc22ba7737f700ae15cfc66b5b8fbd8 |
|
BLAKE2b-256 | 35af8b4bf7d7cfe46b62788834b4049ad87a3e90dbdd85de44908d0142a739f5 |