Metadata-Version: 2.1
Name: guspy
Version: 0.13
Summary: Simple Python Wrapper for common GUS Objects
Home-page: https://git.soma.salesforce.com/c-liew/guspy
Author: Liew Cher Don
Author-email: liewcherdon@gmail.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3.7
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown

# guspy
Gus Python library that allows for simple SOQL queries on GUS, as well as Authentication to GUS.

Current Version: `0.13`

## Installation
To install, simply use your virtualenv:

```
pip install guspy
```

## Repackaging Instructions
To repackage, change the version number of the `setup.py` file
```
python3 setup.py bdist_wheel
python3 -m twine upload dist/*
```


## Summary

Example:
```
query = Case(<SPECIFICATIONS OF OBJECT>).from_single(<FIELDS REQUIRED>)
```
All queries on the objects can be summarised to accept parameters in two places (except special conditions such as GRE specific objects)
The first is the specifications of the object itself (e.g. Case Number, etc) whereas the second is the fields required to be shown.


**Cases Object**
-------------
`Case` class can be initialised with the case number or list of case numbers. In which the single case_number would be using `from_single` method, and the list of case_numbers will be using the `from_multiple` method.
```
from guspy import Case
query = Case("8190582").from_single("Id")
query = Case(["8190582","8190583"]).from_multiple("Id")
```

Special: GRE Cases can be simply queried.
```
gre_query = Case().gre("Id, CaseNumber")
```


**CaseComments Object**
-------------
`CaseComment` object can be initialised with either `case_number` or `comment_id`, in which similar to the `Case` object, would be using `from_single` or `from_multiple` functions to get a single case/comment or multiple case/comment respectively
```
from guspy import CaseComment
query = CaseComment(case_number="").from_single("Id")
query = CaseComment(case_number=["8190582","8190583"]).from_multiple("Id")
```

Special: GRE Cases can be simply queried
```
query = CaseComment().gre("Id, CommentBody")
```

**ScrumMember Object**
-------------
`ScrumMember` object can be initialised with `team_name`, in which you can use `from_single` function to get attributes of the Scrum Members
```
from guspy import ScrumMember
query = ScrumMember(team_name="").from_single("Id")
```

Special: GRE Cases can be simply queried
```
query = ScrumMember().gre("Id, Name")
```

**User Object**
-------------
`User` object can be initialised with `user_id`, in which you can use `from_single` or `from_multiple` functions to get attributes of the Users
```
from guspy import User
query = User(user_id="").from_single("Id")
query = User(user_id=["8190582","8190583"]).from_multiple("Id")
```

Special: GRE Cases can be simply queried
```
query = User().gre("Id, Division")
```

**ReleaseEvent Object**
-------------
To be updated

**Task Object**
-------------
To be updated

**InstanceDatacenter Object**
-------------
To be updated

**Logging In**
-------------
```
from guspy.access import Gus
gus = Gus(username=username,
          password=password).connect()
```
Upon logging in, use the commands above to get the query string for the object required (CaseComments, ReleaseEvents, etc.) before executing the following command:
```
gus.raw(<REQUIRED_QUERY>)
gus.parse(<REQUIRED_QUERY>)
```
Where `raw` will return the raw data, and `parse` will return in a DataFrame format.

