Skip to content

Commit 7050d13

Browse files
committed
initial commit
0 parents  commit 7050d13

File tree

9 files changed

+100
-0
lines changed

9 files changed

+100
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
venv/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Hypernode
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Hypernode API Python Client
2+
3+
_**Please note: this project is still in its early stages and the API may be subject to change.**_
4+
5+
## Installation
6+
7+
```bash
8+
git clone https://github.com/byteinternet/hypernode-api-python.git
9+
cd hypernode-api-python
10+
python3 -m venv venv
11+
. venv/bin/activate
12+
pip install -r requirements/development.txt
13+
```
14+
15+
## Usage
16+
17+
### Acquiring an API token
18+
19+
Each Hypernode has an API token associated with it, you can use that to talk to the API directly. You can find the token in `/etc/hypernode/hypernode_api_token`. For API tokens with special permissions please contact support@hypernode.com.

hypernode_api_python/__init__.py

Whitespace-only changes.

requirements/base.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
requests==2.28.1
2+

requirements/development.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-r base.txt
2+
3+
black==22.10.0
4+
pytest==7.1.3
5+
pytest-xdist==2.5.0
6+
pycodestyle==2.9.1

setup.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env python
2+
from setuptools import setup
3+
from os.path import abspath, dirname, join
4+
5+
6+
def readfile(filename):
7+
path = join(dirname(abspath(__file__)), filename)
8+
with open(path, 'rt') as filehandle:
9+
return filehandle.read()
10+
11+
12+
setup(
13+
name='hypernode_api_python',
14+
version='0.0.1',
15+
description='"Hypernode API Client for Python"',
16+
long_description=readfile('README.rst'),
17+
long_description_content_type='text/x-rst',
18+
author='Hypernode',
19+
author_email='support@hypernode.com',
20+
license='MIT',
21+
url='https://github.com/ByteInternet/hypernode_api_python',
22+
packages=['hypernode_api_python'],
23+
install_requires=['pip'],
24+
entry_points={
25+
'console_scripts': []
26+
}
27+
)

tests/__init__.py

Whitespace-only changes.

tox.ini

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[tox]
2+
envlist = py{3.7,3.8}
3+
skipsdist = True
4+
skip_missing_interpreters = True
5+
6+
7+
[testenv]
8+
basepython =
9+
py3.7: python3.7
10+
py3.8: python3.8
11+
12+
deps = -rrequirements/development.txt
13+
14+
commands = pytest --numprocesses=auto {posargs:--quiet tests/}
15+
black --check .
16+
pycodestyle --config=pycodestyle.ini --exclude=venv,.tox
17+
setenv = PYTHONPATH = {toxinidir}
18+
PYTHONDONTWRITEBYTECODE = 1
19+
20+
21+
[testenv:jenkins]
22+
commands = pytest --cache-clear --numprocesses=auto --maxprocesses=4 --cov-report=term-missing --cov=kamikaze3
23+
black --check .
24+
pycodestyle --config=pycodestyle.ini

0 commit comments

Comments
 (0)