A Python module to help sort GitLab's Webhooks
Some of the JSON data coming from GitLab's webhooks are set as attributes to the GitLab class. Their are functions within the GitLab class that allow for easy handling of the JSON data.
## Requirements
* Python3 (has only been tested with Python 3.5.2)
## Install
* `pip install GitLabPy`
## How to use
Below is a list of the attributes and methods of the GitLab class. Each allows for easy handling of the GitLab webhook JSON data.
### Attributes
Some of the common JSON keys are assigned as attributes to the GitLab class. Here is a list of them...
`issue_types`, `object_kind`, `project_id`, `ref`, `project_name`, `user`, `commit`, `object_attributes`, `build_status`, `repository`, `repo_name`, `repo_homepage`
The JSON data that is instantiated with the GitLab class is also attribute of the class as well. `json_data` is the attribute name.
### Methods
##### get_url(url=None)
Arguments:
- url : type of url to return <string>
* input types:
- "http" : retrieve git http url
- "ssh" : retrieve git ssh url
- "homepage" : retrieve homepage url
- (no input) : retrieve default git url, which is: "repository": {"url": <url>}
##### get_repo_description()
Arguments: None
Checks to see if the key 'description' is in the webhook
##### build()
Checks to see if JSON data from GitLab is build data and also checks to see that you want build data. If so, return True
Arguments: *args <bool><string><list>
- can be a list of certain build data you want
- build types are 'success', 'failed', 'runnning'
##### note(note_types=False)
Checks to see if JSON data is a note (comment) and you want note JSON data. If so, return True
Arguments: note_types <bool>
- Returns True if you want note type JSON data to return True and JSON data is a note
- Default - False
##### merge_request(merge_request_types=False)
Checks to see if JSON data is a merge request and if you want merge_request data. If so, return True
Arguments: merge_request_types <bool>
- True if you want merge request data from GitLab to be returned if JSON data is merge request.
- Default - False
##### issue()
Checks to see if JSON data is an issue from GitLabJSON
Arguments: *args <bool><string><list>
- can be list of issue types or boolean
- issue types are 'open', 'update', 'closed'
- True if you want all issues pass this conditional function
Metadata
Release files for GitLabPy 0.5.1610181
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| GitLabPy-0.5.1610181.zip | 5.6 kB | Without provenance | Details for GitLabPy-0.5.1610181.zip |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| GitLabPy-0.5.1610181-py3-none-any.whl | Python 3 | none | any | Details for GitLabPy-0.5.1610181-py3-none-any.whl |
Total release size: 10.7 kB
Release files / GitLabPy-0.5.1610181.zip
| Download URL | GitLabPy-0.5.1610181.zip |
|---|---|
| Size | 5.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
057b4a19b272c0378ea79d14c458835948c8b41bea03d308606059d9a5e4acbf
|
|
BLAKE2b-256 checksum How to use checksums |
c26a068fd04374a4a15a7e351144466e152bd9d7b67b0884145d3f9760609d9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / GitLabPy-0.5.1610181-py3-none-any.whl
| Download URL | GitLabPy-0.5.1610181-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
95568d331567c7f6d47f4870a422d3b881e1ad21c6924cd63efee54d49fb740d
|
|
BLAKE2b-256 checksum How to use checksums |
f900de8ec4f5c2919d03304f778691379500359dae6870044ef068bb6be18a31
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for GitLabPy 0.5.1610181
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.