Skip to main content
# GitLabPy
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

Release files for GitLabPy 0.5.1610182

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

Source distribution (sdist)

Source distribution for GitLabPy 0.5.1610182
File Size Uploaded
GitLabPy-0.5.1610182.zip 5.5 kB Details

Built distribution (wheel)

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

Total release size: 10.7 kB

Release files / GitLabPy-0.5.1610182.zip

Download URL GitLabPy-0.5.1610182.zip
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0454657e5b9869389598d54170c10037a10d1e3909251650e1ac0e53d7d1a58b
BLAKE2b-256 checksum
How to use checksums
a065472c0d281d2aef8e2e04c26193111a1d0c028e107b6b00d6f136fa2e8da4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / GitLabPy-0.5.1610182-py3-none-any.whl

Download URL GitLabPy-0.5.1610182-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06aa020ed6e4b2d471dd35604370ca89f10a66b730d423def41e794fc065f20b
BLAKE2b-256 checksum
How to use checksums
7c969c31aaa72fc6bf63755e5a79dc8882103d2fd297cdb163edfe79eb3ed431
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.7.0

2 release files

0.6.1

2 release files

0.6

2 release files

This release

0.5.1610182 This release

2 release files

0.4.2

1 release file

0.4.1

2 release files

0.4

2 release files

0.3

2 release files

0.2

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