Skip to main content

orchester

PyPI versionPyPI downloads

This is a python set of tools to easily manage membership of users to your preferred cloud services.

Getting started

Install the package with pip install orchester

If you want on using the command line interface, you must define some configurations.

Configuration

Configuration is done through a .orchester.json configuration file. You can see a documented template here: .orchester-doc.json The values labeled by [CLI] are only required for the CLI.

Note: An empty template is available here: .orchester.json

The application will attempt to load from this following order:

  • A specific path defined in the ORCHESTER_CONFIG_PATH environment variable.
  • In the current working directory
  • In the user folder (home)

CLI

Orchester is distributed with a command line tool. Once installed, you can call it with orchest --help

The following commands are available:

  • orchest -c CONNECTOR_TYPE check IDENTIFIER: Check if the user is registered to the organization
  • orchest -c CONNECTOR_TYPE add IDENTIFIER Add a user to the organization
  • orchest -c CONNECTOR_TYPE rm IDENTIFIER: Remove a user from the organization
  • orchest generate CONNECTOR_TYPE: Generates the OAuth credentials for connector.

If you want to omit the CONNECTOR_TYPE for each command, you can set a default connector in your configuration file:

"default_connector": "trello"

The connector_type must be CONNECTOR name of a valid connector. The connectors are described in the next section.

Connectors

Trello

CONNECTOR: trello

IDENTIFIER: Use the trello username


  1. Get your API token and secret from https://trello.com/app-key (Look for the Api Key and OAuth secret)
  2. Add the Api Key and OAuth secret in the .orchester.json configuration file in api_key and api_secret.
  3. Run orchest generate trello script to get the credentials
  4. Set the OAuth token and OAuth secret in the configuration file in token and token_secret

Github

CONNECTOR: github

IDENTIFIER: Use the github username


To use the Github service, you need an Personal Token.

Go on Github under Settings > Developer settings > Personal access tokens

Then, create a new token and save it in your configuration file at token.


Slack

CONNECTOR: slack

IDENTIFIER: Use the slack email


To get started with slack, you first need to get a legacy token and a OAuth token.

Legacy token

Simply go to the following url and issue a new legacy token: https://api.slack.com/custom-integrations/legacy-tokens

You can then add the legacy token in legacy_token.

Note: You'll need to be connected to issue a token.

OAuth token

Before you can actually generate an OAuth token, you'll need to have a Slack application.

How to create an app?: Go to https://api.slack.com/apps and click on Create New App
You must add the following permission scopes: users:read and users:read.email
You will also need to set the following Redirect URI: http://localhost:8888/finish_auth

You can then store the client id and client secret in client_id and client_secret

You are now all setup to generate the final OAuth token.

  1. Run orchest generate slack
  2. Go to: http://localhost:8888/begin_auth
  3. Click on "Add to slack"
  4. Click Authorize
  5. It should show a OAuth token. Save that in the configuration file at token

Warnings: Free Slack users can't use the api to remove a user.


Google Drive

IDENTIFIER: Use the google email

CONNECTOR: g_drive


Before you begin, you'll need a google_drive_credentials.json file at the root of this folder.

You can get it by creating credentials in your Google Console API

Tutorial: Tutorials coming from: https://developers.google.com/drive/api/v3/quickstart/python

Once you have the credentials.json file, you need to define the credential_path and token_path.

After that, you can run orchest generate g_drive to create the google_drive_token.json.

API

The API is pretty straight forward. Each connectors inherit from orchester.connectors.AbstractBaseConnector

If you want to use all the connectors at one time, you can use the orchester.ConnectorManager

The manager instantiate all the connectors and let you easily interact with the connector one at a time.

Here's an example to use the github connector:

from orchester.connectors import GithubConnector, RequestFailedError

connector = GithubConnector(access_token="my token...",organization_id='myOrg')

try:
    user_exist = connector.is_registered_to_group('popojargo')
    print('User is registered to myOrg')
except RequestFailedError:
    print('The request failed.')


try:
    connector.remove_from_group('popojargo')
    print('User removed to myOrg')

except RequestFailedError:
    print('The request failed.')


try:
    user_exist = connector.add_to_group('popojargo')
    print('User added to myOrg')

except RequestFailedError:
    print('The request failed.')

Contributing

For developer documentation, see README-DEV.md

Metadata

Release files for orchester 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for orchester 0.0.4
File Size Uploaded Provenance Actions
orchester-0.0.4.tar.gz 9.2 kB Without provenance Details for orchester-0.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for orchester 0.0.4
File Interpreter ABI Platform Actions
orchester-0.0.4-py3-none-any.whl Python 3 none any Details for orchester-0.0.4-py3-none-any.whl

Total release size: 23.4 kB

Release files / orchester-0.0.4.tar.gz

Download URL orchester-0.0.4.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
5cb140662e73c0b771d227fe6cbc7d5e3a821c5173839b50bc2748d7a080fde2
BLAKE2b-256 checksum
How to use checksums
726192ecf7449625e4af154aa206c7e41fd5e5ef3ec33f07a215eeea22ae592d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.8

Release files / orchester-0.0.4-py3-none-any.whl

Download URL orchester-0.0.4-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6dcd663baf39d6e65b8714c638a8d7af6c32b4d2f63cd900ebc54bb8da5c952
BLAKE2b-256 checksum
How to use checksums
a821fc5bf7cfab1206f4e947bc8c88f4b1db15bb8e31b986837d308f8cfb08d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.1.0 requests-toolbelt/0.8.0 tqdm/4.29.0 CPython/3.6.8

Security for orchester 0.0.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page