Metadata-Version: 2.1
Name: spacelift
Version: 0.1.3
Summary: simple python client for the spacelift.io GraphQL API
Home-page: https://github.com/wrgeorge1983/spacelift
License: Apache-2.0
Keywords: spacelift,spacelift.io,api,graphql
Author: Will George
Author-email: wrgeorge1983@gmail.com
Requires-Python: >=3.11,<4.0
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: gql[requests] (>=3.4.1,<4.0.0)
Project-URL: Repository, https://github.com/wrgeorge1983/spacelift
Description-Content-Type: text/markdown

# Spacelift Client
Simple client library for working with the [spacelift.io](https://spacelift.io) API.

## Install
```bash
pip install spacelift
```

## Usage
```python
from spacelift import Spacelift


def main():
    sl = Spacelift(
        base_url="https://ORGNAME.app.spacelift.io/graphql",
        key_id="01HCJMP<API_KEY_ID ~26CHAR LONG>",
        key_secret="e355ae6fd5<API_KEY_SECRET ~64 CHAR LONG>"
    )
    result = sl.get_stacks()
    print(result)


if __name__ == "__main__":
    main()
```
### Environment Variables
the `Spacelift` object can also infer its parameters from the following environment variables:

```bash
SPACELIFT_BASE_URL="https://ORGNAME.app.spacelift.io/graphql"
SPACELIFT_KEY_ID="01HCJMP<API_KEY_ID ~26CHAR LONG>"
SPACELIFT_KEY_SECRET="e355ae6fd5<API_KEY_SECRET ~64 CHAR LONG>"
```

### API Keys
Currently, this depends on the API Key workflow [here](https://docs.spacelift.io/integrations/api#spacelift-api-key-token).
The Current Spacelift.io documentation doesn't clearly specify this, but the API Key ID is the 26 character code that 
appears after the name in the web UI.  It does not appear at all in the downloaded `.config` file.  

The required Secret value is the first code (64 characters long) that appears in the downloaded `.config` file.


