summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-10 06:13:32 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-10 06:13:32 +0000
commit9b7371cad9a6269c613f3432126166610cac3850 (patch)
treeb744cd0c94c99d809ebd14f572f6ae1ac3fd3580
parentcaa06d643ed84c89f5daf23be66f663764bed803 (diff)
automatic import of python-aptible-api
-rw-r--r--.gitignore1
-rw-r--r--python-aptible-api.spec288
-rw-r--r--sources1
3 files changed, 290 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..92eb64d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/aptible-api-0.4.0.tar.gz
diff --git a/python-aptible-api.spec b/python-aptible-api.spec
new file mode 100644
index 0000000..1fb3b39
--- /dev/null
+++ b/python-aptible-api.spec
@@ -0,0 +1,288 @@
+%global _empty_manifest_terminate_build 0
+Name: python-aptible-api
+Version: 0.4.0
+Release: 1
+Summary: Object Oriented interface for Aptible API
+License: MIT License
+URL: https://github.com/TrialSpark/aptible-api
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/95/21/db79dfa884ae33dfa2a5cf52f95a2dbfcfcbcfd7e25c89646abcd8d01d9f/aptible-api-0.4.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-PyYAML
+Requires: python3-inflection
+Requires: python3-requests
+
+%description
+# aptible-api
+
+Python client for api.aptible.com. Aptible's API is built on HAL+JASON so this
+package includes a simplified engine for generating Resource types based on
+JSON objects provided by the API / specifications in
+[draft-kelly-json-hal-06](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-06)
+
+## Installation
+
+```shell
+pip install aptible-api
+```
+
+## Usage
+
+Fist create an instance of the API
+
+```python
+from aptible.api import AptibleApi
+
+aptible_api = AptibleApi()
+```
+
+Then authorize the application via either account credentials or a token.
+
+```python
+# Via account credentials
+aptible_api.authorize(email='user@example.com', password='password')
+
+# Via a token
+from pathlib import Path
+from json import JSONDecoder
+
+tokens_path = Path('~/.aptible/tokens.json')
+tokens_json = JSONDecoder.decode(tokens_path.read_text())
+token = tokens_json['https://auth.aptible.com']
+
+aptible_api.authorize(token=token)
+```
+
+From here, you can interact with the API however you wish.
+
+```python
+accounts = aptible_api.accounts()
+account = next(accounts)
+account.handle
+# >>> 'demo-account'
+
+next(account.apps()).handle
+# >>> 'foodle'
+
+new_app = account.create_app(handle='foo-app')
+new_app.href
+# >>> 'https://api.aptible.com/apps/1337'
+```
+
+## Contributing
+
+1. Fork the project.
+2. Commit your changes, with tests.
+3. Ensure that your code passes tests (`pipenv run py.test`) and meets pylint
+ style guide (`pipenv run pylint`).
+4. Create a new pull request on GitHub.
+
+## Copyright
+
+MIT License, see [LICENSE](LICENSE.md) for details.
+
+Copyright (c) 2021 TrialSpark, Inc. and contributors.
+
+
+
+
+%package -n python3-aptible-api
+Summary: Object Oriented interface for Aptible API
+Provides: python-aptible-api
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-aptible-api
+# aptible-api
+
+Python client for api.aptible.com. Aptible's API is built on HAL+JASON so this
+package includes a simplified engine for generating Resource types based on
+JSON objects provided by the API / specifications in
+[draft-kelly-json-hal-06](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-06)
+
+## Installation
+
+```shell
+pip install aptible-api
+```
+
+## Usage
+
+Fist create an instance of the API
+
+```python
+from aptible.api import AptibleApi
+
+aptible_api = AptibleApi()
+```
+
+Then authorize the application via either account credentials or a token.
+
+```python
+# Via account credentials
+aptible_api.authorize(email='user@example.com', password='password')
+
+# Via a token
+from pathlib import Path
+from json import JSONDecoder
+
+tokens_path = Path('~/.aptible/tokens.json')
+tokens_json = JSONDecoder.decode(tokens_path.read_text())
+token = tokens_json['https://auth.aptible.com']
+
+aptible_api.authorize(token=token)
+```
+
+From here, you can interact with the API however you wish.
+
+```python
+accounts = aptible_api.accounts()
+account = next(accounts)
+account.handle
+# >>> 'demo-account'
+
+next(account.apps()).handle
+# >>> 'foodle'
+
+new_app = account.create_app(handle='foo-app')
+new_app.href
+# >>> 'https://api.aptible.com/apps/1337'
+```
+
+## Contributing
+
+1. Fork the project.
+2. Commit your changes, with tests.
+3. Ensure that your code passes tests (`pipenv run py.test`) and meets pylint
+ style guide (`pipenv run pylint`).
+4. Create a new pull request on GitHub.
+
+## Copyright
+
+MIT License, see [LICENSE](LICENSE.md) for details.
+
+Copyright (c) 2021 TrialSpark, Inc. and contributors.
+
+
+
+
+%package help
+Summary: Development documents and examples for aptible-api
+Provides: python3-aptible-api-doc
+%description help
+# aptible-api
+
+Python client for api.aptible.com. Aptible's API is built on HAL+JASON so this
+package includes a simplified engine for generating Resource types based on
+JSON objects provided by the API / specifications in
+[draft-kelly-json-hal-06](https://datatracker.ietf.org/doc/html/draft-kelly-json-hal-06)
+
+## Installation
+
+```shell
+pip install aptible-api
+```
+
+## Usage
+
+Fist create an instance of the API
+
+```python
+from aptible.api import AptibleApi
+
+aptible_api = AptibleApi()
+```
+
+Then authorize the application via either account credentials or a token.
+
+```python
+# Via account credentials
+aptible_api.authorize(email='user@example.com', password='password')
+
+# Via a token
+from pathlib import Path
+from json import JSONDecoder
+
+tokens_path = Path('~/.aptible/tokens.json')
+tokens_json = JSONDecoder.decode(tokens_path.read_text())
+token = tokens_json['https://auth.aptible.com']
+
+aptible_api.authorize(token=token)
+```
+
+From here, you can interact with the API however you wish.
+
+```python
+accounts = aptible_api.accounts()
+account = next(accounts)
+account.handle
+# >>> 'demo-account'
+
+next(account.apps()).handle
+# >>> 'foodle'
+
+new_app = account.create_app(handle='foo-app')
+new_app.href
+# >>> 'https://api.aptible.com/apps/1337'
+```
+
+## Contributing
+
+1. Fork the project.
+2. Commit your changes, with tests.
+3. Ensure that your code passes tests (`pipenv run py.test`) and meets pylint
+ style guide (`pipenv run pylint`).
+4. Create a new pull request on GitHub.
+
+## Copyright
+
+MIT License, see [LICENSE](LICENSE.md) for details.
+
+Copyright (c) 2021 TrialSpark, Inc. and contributors.
+
+
+
+
+%prep
+%autosetup -n aptible-api-0.4.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-aptible-api -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 10 2023 Python_Bot <Python_Bot@openeuler.org> - 0.4.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..488a0e9
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+041e029d891587122d45a5ff77a31ec8 aptible-api-0.4.0.tar.gz