Skip to main content

IDEAS Python library and CLI

Project description

IDEAS Python

This package provides a python API and a CLI to interact with the IDEAS platform.

  1. Installation
  2. Running
  3. Configuration
  4. Shell completion

Installation

Requirements:

  • python >= 3.11

Installing

The recommended way to install IDEAS Python is with pip in a virtualenv:

python3 -m venv venv
pip install ideas-python

Running

Installing adds the ideas command to the virtualenv. You can either run it directly from the virtualenv with venv/bin/ideas, or symlink it to a directory in your shell's PATH variable:

# by activating the virtualenv
source venv/bin/activate
# OR, manually
ln -sf $(pwd)/venv/bin/ideas ~/.local/bin/ideas

Note on Windows: For windows, run these commands instead in a git-bash to make ideas available in your path:

mkdir -p ~/.local/bin && touch ~/.bash_profile && echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bash_profile && source ~/.bash_profile
ln -sf $(pwd)/venv/Scripts/ideas.exe ~/.local/bin/ideas.exe

Now you can run the CLI directly:

ideas

Configuration

As ideas interfaces with the IDEAS platform, it must authenticate, and we provide two ways to do so: through CLI parameters (like --username), or through a configuration wizard.

Configuration wizard

ideas offers a handy shortcut to edit your configuration interactively:

ideas configure

You will be asked for:

  • Which region are you in: this corresponds to which region you specified as your home region when you signed up for your IDEAS account.
  • Your credentials: use the email address and password you sign into IDEAS with.
  • [Optional] You may be asked which tenant you would like to use, if you belong to multiple tenants.

You may call ideas configure again at any point to change these values.

Configuring and using profiles

It is possible also to configure multiple profiles, with arbitrary names. This could be for accessing different regions, using separate accounts, or selecting another tenant ID.

ideas --profile us configure
ideas --profile jp configure

A given profile can then be used by specifying the profile:

ideas --profile jp tenants

Configuring through arguments

Alternatively, you can configure ideas through arguments. If no configuration file exists, ideas will exclusively use arguments. If you have a configuration file, these arguments will override the file:

CLI argument Config file name Description
-e/--env env Which environment to use. List supported environments with ideas environments.
-u/--username username Your IDEAS username/email address.
-p/--password password The password you log into IDEAS with.
-t/--tenant-id tenant_id The numerical ID of the tenant you want to use. List your tenants with ideas tenants.

Shell completion

You can optionally enable shell completion for the ideas command. We provide tab completion support for Bash (version 4.4 and up), Zsh, and Fish shells.

Bash

# Save the script somewhere
_IDEAS_COMPLETE=bash_source ideas > ~/.ideas-complete.bash

# Source the file in ~/.bashrc
. ~/.ideas-complete.bash

Zsh

# Save the script somewhere.
_IDEAS_COMPLETE=zsh_source ideas > ~/.ideas-complete.zsh

# Source the file in ~/.zshrc.
. ~/.ideas-complete.zsh

Fish

# Save the script to ~/.config/fish/completions/ideas.fish:
_IDEAS_COMPLETE=fish_source ideas > ~/.config/fish/completions/ideas.fish

After modifying the shell config, you need to start a new shell in order for the changes to be loaded.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ideas_python-1.1.1-py3-none-any.whl (127.7 kB view details)

Uploaded Python 3

File details

Details for the file ideas_python-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: ideas_python-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 127.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for ideas_python-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f89af2bdcf909fb08f13e4c8515182dd5f091c0108ffee9adab3238a12936580
MD5 31b80622dea9149608935a8e02be1504
BLAKE2b-256 a2947e2f604a89a8097ed137443200e237f9676202c0fe7478fabfb3aaba49d1

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