{"id":22180560,"url":"https://github.com/dcso/dcso-portal-python-sdk","last_synced_at":"2025-07-26T17:32:16.378Z","repository":{"id":54595763,"uuid":"309660192","full_name":"DCSO/dcso-portal-python-sdk","owner":"DCSO","description":"DCSO Portal Python SDK","archived":false,"fork":false,"pushed_at":"2022-10-26T15:37:52.000Z","size":140,"stargazers_count":1,"open_issues_count":2,"forks_count":4,"subscribers_count":8,"default_branch":"main","last_synced_at":"2024-11-08T16:48:34.378Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://dcso.github.io/dcso-portal-python-sdk/dcso/portal/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DCSO.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-03T11:09:03.000Z","updated_at":"2022-10-26T15:38:00.000Z","dependencies_parsed_at":"2022-08-13T20:50:12.449Z","dependency_job_id":null,"html_url":"https://github.com/DCSO/dcso-portal-python-sdk","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCSO%2Fdcso-portal-python-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCSO%2Fdcso-portal-python-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCSO%2Fdcso-portal-python-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCSO%2Fdcso-portal-python-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCSO","download_url":"https://codeload.github.com/DCSO/dcso-portal-python-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227700405,"owners_count":17806365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-02T09:18:39.471Z","updated_at":"2024-12-02T09:18:40.444Z","avatar_url":"https://github.com/DCSO.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"DCSO Portal Python SDK\n======================\n\n***This project is deprecated. It can still be used but is not maintained anymore.***\n\nCopyright (c) 2020, 2021, DCSO Deutsche Cyber-Sicherheitsorganisation GmbH\n\nDCSO Portal Python Software Development Kit (SDK) helps you create\napplication which need to interact with the DCSO Portal.\n\nDocumentation: [https://dcso.github.io/dcso-portal-python-sdk/dcso/portal/](https://dcso.github.io/dcso-portal-python-sdk/dcso/portal/)\n\nRequirements\n------------\n\nThis library is, when installed, pure Python. We use only 3rd party tools\nfor installation and documentation generation.\n\n* Python v3.7 or greater (Python v3.6 as best effort)\n* Requirements:\n  - for distribution, see `requirements_dist.txt`\n\nRequirements can be installed using, for example, `pip`:\n\n    $ pip install -r requirements_dist.txt\n\nWe strongly advise to use a Virtual Environment for testing or for\ndevelopment. This makes sure your local Python environment stays clean.\n\n    $ python3 -m venv venvdir\n    $ source ./venvdir/bin/activate\n    (venvdir)$ pip install -r requirements.txt \n\nInstallation\n------------\n\nThis section explains how to install the DCSO Portal Python SDK. You can get\na copy and source on [GitHub](https://github.com/dcso/dcso-portal-python-sdk).\n\n### From Python Package Index (PyPI)\n\n    $ pip install -U dcso-portal-python-sdk\n\n\n### Using Source\n\nInstallation is done using `setup.py`:\n\n    $ pip install .\n    or\n    $ python3 setup.py install\n\n\nIt is advised, when developing or testing, to use a Virtual Environment (see\nPrerequisites in this document).\n\nDocumentation\n-------------\n\nDocumentation is available as HTML in the `docs/dcso/portal` folder.\n\nIt is possible to generate it using:\n\n    $ ./gendocs.py\n\nAlternatively, it is also possible to have the documentation service\nby the pdoc3 web server. This is mostly useful for working on the\ndocumentation since it will rebuild automatically:\n\n    $ PYTHONPATH=\"./lib\" pdoc --http : --html \\\n        --template-dir support/doc_templates dcso.portal\n    \n    open http://localhost:8080/dcso.portal/\n\nSee `pdoc --help` for more information.\n\n\nExamples\n--------\n\nThe folder `examples` contains code which can be used to learn how to\nuse this SDK.\n\nWhen running the examples, within the root of the repository, use\nthe `PYTHONPATH` variable:\n\n    $ PYTHONPATH=\"lib\" python3 examples/basic.py\n\n### example/portal_cli.py\n\nThe `portal_cli.py`, Portal Command-Line Intereface, show how to create an\ninteractive client.\nIt will prompt for username, password, and if needed, also the one-time password.  \nThe result is showing all permissions the user has, and whether the user\nhas TDH Coordinator access.\n\n### example/exec_graphql.py\n\nThe `exec_graphql.py` shows how to connect using a Machine Token (also known as\nAPI Tokene), and execute some GraphQL.\n\n\nDevelopment\n-----------\n\nThe SDK itself and its tests stays as pure Python as possibly can be.  \nAn exception is the Setuptools requirement for installation or any tools\nfor packaging.\n\n### DCSO Namespace\n\nWe use the `dcso` package namespace, which can be recognized lacking the\n`__init__.py`. This helps having other Python project which can then\ninstall in the same location.\n\n\n### Running Tests\n\nDirectly using the `unittest` package from command line:\n\n    $ PYTHONPATH=\"lib\" python3 -m unittest discover -s ./lib/dcso/ -vv\n\nOr using the wrapper script, to run all tests:\n\n    $ python3 test.py\n\n\nIDE Tips\n--------\n\n### PyCharm\n\nRight click on the `lib/` folder in the root of the repository and \nselect 'Mark Directory as \u003e Sources Root'. This will make sure PyCharm\nadd the code to its `PYTHONPATH`.\n\n\nDistribution\n------------\n\nDCSO Portal Python SDK is make available for downloading from GitHub as source\ndistributions are made available with each release.\n\nWe also upload to the Python Package Index (PyPI) using `twine`, and an API token.\n\n### Preparing a Release\n\nIt is a good idea to start with a fresh Virtual Environment when creating a new\nrelease.\n\n1. Install requirements: `pip install -r requirements_dist.txt`\n2. Create a supporting branch which contains the version number to be releases,\n   for example, `release/1.0.0-beta3`\n3. Update `lib/dcso/portal/_version.py` and update the `__version__` variable\n4. Generate documentation: `./gendocs.py`\n5. Create source distribution: `python setup.py sdist --formats=zip` (will be created\n   in sub folder `dist`)\n\n### Upload to PyPI\n\nWith the source distribution created as ZIP-archive, we can now upload to PyPI using\nthe Twine module.\n\n```\npython3 -m twine upload dist/dcso_portal_python_sdk-1.0.0b3.zip\n```\n\nThe `twine` module is installed using `pip install -r requirements_dist.txt`.\n\nTwine will ask you for credentials:\n\n1. Use `__token__` as username\n2. As Password, enter the PyPI API Token for the `dcso-portal-python-sdk` project (note\n   that this includes the `pypi-` prefix)\n\n\nLicense\n-------\n\n[MIT](LICENSE.txt)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcso%2Fdcso-portal-python-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcso%2Fdcso-portal-python-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcso%2Fdcso-portal-python-sdk/lists"}