From 96296a65ad211ea3fee802c5e876d8a9a62f6a66 Mon Sep 17 00:00:00 2001 From: Hirad Date: Fri, 6 Dec 2024 15:29:36 +0330 Subject: [PATCH] initial commit --- requirements.txt | 3 +++ setup.py | 23 +++++++++++++++++++++++ test/__init__.py | 0 test/test_api.py | 12 ++++++++++++ 4 files changed, 38 insertions(+) create mode 100644 requirements.txt create mode 100644 setup.py create mode 100644 test/__init__.py create mode 100644 test/test_api.py diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5b3ef3f --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +python-dotenv~=1.0.1 +requests~=2.32.3 +setuptools~=75.5.0 \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..9d0f693 --- /dev/null +++ b/setup.py @@ -0,0 +1,23 @@ +from setuptools import setup + + +with open("README.md", "r") as file: + load_description = file.read() + + +setup( + name="portman", + version="0.0.1", + author="Hirad", + author_email="hirad@hirad.it", + description="A tool to manage Portainer stacks and endpoints", + load_description=load_description, + long_description_content_type="text/markdown", + url="https://git.hirad.it/Hirad/Portman", + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Operating System :: OS Independent", + ], + python_requires=">=3.6" +) \ No newline at end of file diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_api.py b/test/test_api.py new file mode 100644 index 0000000..6902811 --- /dev/null +++ b/test/test_api.py @@ -0,0 +1,12 @@ +import os +from dotenv import load_dotenv +from portainer import PortainerApi + + +load_dotenv() +portainer_url = os.getenv("PORTAINER_URL") +portainer_token = os.getenv("PORTAINER_TOKEN") + +portainer = PortainerApi(portainer_url, portainer_token) +stacks = portainer.stacks.list_stacks() +print(stacks)