Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Huluti committed Jan 31, 2024
0 parents commit 523190a
Show file tree
Hide file tree
Showing 61 changed files with 5,163 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# NOTE: This file is auto generated by OpenAPI Generator.
# URL: https://openapi-generator.tech
#
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: urlr Python package

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
66 changes: 66 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache

# Translations
*.mo
*.pot

# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

#Ipython Notebook
.ipynb_checkpoints
31 changes: 31 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# NOTE: This file is auto generated by OpenAPI Generator.
# URL: https://openapi-generator.tech
#
# ref: https://docs.gitlab.com/ee/ci/README.html
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml

stages:
- test

.pytest:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=urlr

pytest-3.7:
extends: .pytest
image: python:3.7-alpine
pytest-3.8:
extends: .pytest
image: python:3.8-alpine
pytest-3.9:
extends: .pytest
image: python:3.9-alpine
pytest-3.10:
extends: .pytest
image: python:3.10-alpine
pytest-3.11:
extends: .pytest
image: python:3.11-alpine
3 changes: 3 additions & 0 deletions .openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Prevent generator from creating these files:
git_push.sh
.travis.yml
56 changes: 56 additions & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.github/workflows/python.yml
.gitignore
.gitlab-ci.yml
README.md
docs/Authentification200Response.md
docs/Authentification401Response.md
docs/AuthentificationApi.md
docs/AuthentificationRequest.md
docs/LinkApi.md
docs/ReduceLink200Response.md
docs/ReduceLink400Response.md
docs/ReduceLinkRequest.md
docs/Stats200Response.md
docs/Stats400Response.md
docs/StatsApi.md
docs/StatsRequest.md
pyproject.toml
requirements.txt
setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_authentification200_response.py
test/test_authentification401_response.py
test/test_authentification_api.py
test/test_authentification_request.py
test/test_link_api.py
test/test_reduce_link200_response.py
test/test_reduce_link400_response.py
test/test_reduce_link_request.py
test/test_stats200_response.py
test/test_stats400_response.py
test/test_stats_api.py
test/test_stats_request.py
tox.ini
urlr/__init__.py
urlr/api/__init__.py
urlr/api/authentification_api.py
urlr/api/link_api.py
urlr/api/stats_api.py
urlr/api_client.py
urlr/api_response.py
urlr/configuration.py
urlr/exceptions.py
urlr/models/__init__.py
urlr/models/authentification200_response.py
urlr/models/authentification401_response.py
urlr/models/authentification_request.py
urlr/models/reduce_link200_response.py
urlr/models/reduce_link400_response.py
urlr/models/reduce_link_request.py
urlr/models/stats200_response.py
urlr/models/stats400_response.py
urlr/models/stats_request.py
urlr/py.typed
urlr/rest.py
1 change: 1 addition & 0 deletions .openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.2.0
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## [0.0.1] - 2024-01-31

- First version of the URLR Python client
95 changes: 95 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# [email protected]

This SDK is automatically generated with the [OpenAPI Generator](https://openapi-generator.tech) project.

- API version: 0.2
- Package version: 0.0.1
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
For more information, please visit [https://urlr.me/en](https://urlr.me/en)

## Requirements

Python 3.7+

## Installation & Usage

### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/urlr/urlr-python.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/urlr/urlr-python.git`)

Then import the package:
```python
import urlr
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import urlr
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
```

A complete example is [available here](examples/example1.py).

## API Endpoints

All URIs are relative to *https://urlr.me/api*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AuthentificationApi* | [**authentification**](docs/AuthentificationApi.md#authentification) | **POST** /login_check | Get an access token
*LinkApi* | [**reduce_link**](docs/LinkApi.md#reduce_link) | **POST** /reduce-link | Reduce a link
*StatsApi* | [**stats**](docs/StatsApi.md#stats) | **POST** /stats | Get statistics of a link


## Models

- [Authentification200Response](docs/Authentification200Response.md)
- [Authentification401Response](docs/Authentification401Response.md)
- [AuthentificationRequest](docs/AuthentificationRequest.md)
- [ReduceLink200Response](docs/ReduceLink200Response.md)
- [ReduceLink400Response](docs/ReduceLink400Response.md)
- [ReduceLinkRequest](docs/ReduceLinkRequest.md)
- [Stats200Response](docs/Stats200Response.md)
- [Stats400Response](docs/Stats400Response.md)
- [StatsRequest](docs/StatsRequest.md)


<a id="documentation-for-authorization"></a>

## Authorization


Authentication schemes defined for the API:
<a id="bearerAuth"></a>
### bearerAuth

- **Type**: Bearer authentication (JWT)


## Get help / support

Please contact [[email protected]](mailto:[email protected]?subject=[GitHub]%urlr-python) and we can take more direct action toward finding a solution.
29 changes: 29 additions & 0 deletions docs/Authentification200Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Authentification200Response


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**token** | **str** | | [optional]

## Example

```python
from urlr.models.authentification200_response import Authentification200Response

# TODO update the JSON string below
json = "{}"
# create an instance of Authentification200Response from a JSON string
authentification200_response_instance = Authentification200Response.from_json(json)
# print the JSON string representation of the object
print Authentification200Response.to_json()

# convert the object into a dict
authentification200_response_dict = authentification200_response_instance.to_dict()
# create an instance of Authentification200Response from a dict
authentification200_response_form_dict = authentification200_response.from_dict(authentification200_response_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


30 changes: 30 additions & 0 deletions docs/Authentification401Response.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Authentification401Response


## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**code** | **int** | | [optional]
**message** | **str** | | [optional]

## Example

```python
from urlr.models.authentification401_response import Authentification401Response

# TODO update the JSON string below
json = "{}"
# create an instance of Authentification401Response from a JSON string
authentification401_response_instance = Authentification401Response.from_json(json)
# print the JSON string representation of the object
print Authentification401Response.to_json()

# convert the object into a dict
authentification401_response_dict = authentification401_response_instance.to_dict()
# create an instance of Authentification401Response from a dict
authentification401_response_form_dict = authentification401_response.from_dict(authentification401_response_dict)
```
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


Loading

0 comments on commit 523190a

Please sign in to comment.