initial structure

This commit is contained in:
Troy Grunt 2024-11-22 12:22:27 +01:00
parent 15fdd56002
commit 90e0cf3d94
8 changed files with 75 additions and 0 deletions

11
.vscode/easycode.ignore vendored Normal file
View File

@ -0,0 +1,11 @@
node_modules/
dist/
vendor/
cache/
.*/
*.min.*
*.test.*
*.spec.*
*.bundle.*
*.bundle-min.*
*.log

0
LICENSE Normal file
View File

0
pyproject.toml Normal file
View File

1
requirements.txt Normal file
View File

@ -0,0 +1 @@
requests

4
sccpy/__init__.py Normal file
View File

@ -0,0 +1,4 @@
from .core import getOrg, getOrgMembers, getUser
#from .modules import *
__all__ = ["getOrg", "getOrgMembers", "getUser"]

25
sccpy/core.py Normal file
View File

@ -0,0 +1,25 @@
# core.py
def getOrg(org_id):
"""
Fetches details about an organization.
:param org_id: The ID of the organization.
:return: A dictionary with organization details.
"""
return {"id": org_id, "name": f"Org-{org_id}"}
def getOrgMembers(org_id):
"""
Fetches a list of members for a given organization.
:param org_id: The ID of the organization.
:return: A list of dictionaries representing members.
"""
return [{"id": i, "name": f"Member-{i}"} for i in range(1, 6)]
def getUser(user_id):
"""
Fetches details about a specific user.
:param user_id: The ID of the user.
:return: A dictionary with user details.
"""
return {"id": user_id, "name": f"User-{user_id}"}

22
sccpy/tests/test_core.py Normal file
View File

@ -0,0 +1,22 @@
# test_core.py
import unittest
from sccpy.core import getOrg, getOrgMembers, getUser
class TestSccpyCore(unittest.TestCase):
def test_getOrg(self):
org = getOrg(1)
self.assertEqual(org["id"], 1)
self.assertIn("name", org)
def test_getOrgMembers(self):
members = getOrgMembers(1)
self.assertEqual(len(members), 5)
self.assertIn("name", members[0])
def test_getUser(self):
user = getUser(1)
self.assertEqual(user["id"], 1)
self.assertIn("name", user)
if __name__ == "__main__":
unittest.main()

12
setup.py Normal file
View File

@ -0,0 +1,12 @@
from setuptools import setup, find_packages
setup(
name="sccpy",
version="0.1.0",
description="A library for SCC operations",
author="Your Name",
author_email="your.email@example.com",
packages=find_packages(),
install_requires=[],
python_requires=">=3.6",
)