%global _empty_manifest_terminate_build 0 Name: python-trustpilot Version: 9.0.0 Release: 1 Summary: trustpilot api client including cli tool License: MIT URL: https://github.com/trustpilot/python-trustpilot Source0: https://mirrors.nju.edu.cn/pypi/web/packages/39/d2/530453df2a41aa2f12813f86afca252d661029a43eb19f337144e0aaaa6e/trustpilot-9.0.0.tar.gz BuildArch: noarch Requires: python3-click Requires: python3-requests Requires: python3-aiohttp %description # trustpilot [![Build Status](https://travis-ci.org/trustpilot/python-trustpilot.svg?branch=master)](https://travis-ci.org/trustpilot/python-trustpilot) [![Latest Version](https://img.shields.io/pypi/v/trustpilot.svg)](https://pypi.python.org/pypi/trustpilot) [![Python Support](https://img.shields.io/pypi/pyversions/trustpilot.svg)](https://pypi.python.org/pypi/trustpilot) Python HTTP client for [Trustpilot](https://developers.trustpilot.com/). ### Features - Extends the [`requests.Session`](http://docs.python-requests.org/en/master/api/#requests.Session) class with automatic authentication for public and private endpoints - GET, POST, PUT, DELETE, HEAD, OPTIONS and PATCH methods are exposed on module level - Implements session factory and default singleton session - Provides a simple hook system - [CLI](#CLI) tool with basic HTTP commands ## Installation Install the package from [PyPI](http://pypi.python.org/pypi/) using [pip](https://pip.pypa.io/): ``` pip install trustpilot ``` ## Usage _(for **full usage documentation** checkout [docs](https://github.com/trustpilot/python-trustpilot/blob/master/docs/README.md))_ ```python from trustpilot import client client.default_session.setup( api_host="https://api.trustpilot.com" api_key="YOUR_API_KEY" ) response = client.get("/foo/bar") status_code = response.status_code ``` You can rely on environment variables for the setup of sessions so ```bash $ env TRUSTPILOT_API_HOST=https://api.trustpilot.com TRUSTPILOT_API_KEY=foo TRUSTPILOT_API_SECRET=bar ``` ### CLI The `trustpilot_api_client` command is bundled with the install ```bash Usage: trustpilot_api_client [OPTIONS] COMMAND [ARGS]... Options: --host TEXT Host name --version TEXT Api version --key TEXT Api key --secret TEXT Api secret --token_issuer_host TEXT Token issuer host name --username TEXT Trustpilot username --password TEXT Trustpilot password -c, --config FILENAME Json config file name -e, --env FILENAME Dot env file -of, --outputformat [json|raw] Output format, default=json -v, --verbose Verbosity level --help Show this message and exit. Commands: create-access-token Get an access token delete Send a DELETE request get Send a GET request post Send a POST request with specified data put Send a PUT request with specified data ``` You can also supply the variables with: **--config/-c** : As JSON config file in the following format: ```json { "TRUSTPILOT_API_HOST": "foo", "TRUSTPILOT_API_KEY": "bar", "TRUSTPILOT_API_SECRET": "baz", "TRUSTPILOT_API_VERSION": "v1", "TRUSTPILOT_USERNAME": "username", "TRUSTPILOT_PASSWORD": "password" } ``` or **--env/-e** : As DotEnv config file in the following format: ```ini TRUSTPILOT_API_HOST=foo TRUSTPILOT_API_KEY=bar TRUSTPILOT_API_SECRET=baz TRUSTPILOT_API_VERSION=v1 TRUSTPILOT_USERNAME=username TRUSTPILOT_PASSWORD=password ``` ## Changelog see [HISTORY.md](https://github.com/trustpilot/python-trustpilot/blob/master/HISTORY.md) ## Issues / DEV Report issues [here](https://github.com/trustpilot/python-trustpilot/issues) and we welcome collaboration through PullRequests :-) %package -n python3-trustpilot Summary: trustpilot api client including cli tool Provides: python-trustpilot BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-trustpilot # trustpilot [![Build Status](https://travis-ci.org/trustpilot/python-trustpilot.svg?branch=master)](https://travis-ci.org/trustpilot/python-trustpilot) [![Latest Version](https://img.shields.io/pypi/v/trustpilot.svg)](https://pypi.python.org/pypi/trustpilot) [![Python Support](https://img.shields.io/pypi/pyversions/trustpilot.svg)](https://pypi.python.org/pypi/trustpilot) Python HTTP client for [Trustpilot](https://developers.trustpilot.com/). ### Features - Extends the [`requests.Session`](http://docs.python-requests.org/en/master/api/#requests.Session) class with automatic authentication for public and private endpoints - GET, POST, PUT, DELETE, HEAD, OPTIONS and PATCH methods are exposed on module level - Implements session factory and default singleton session - Provides a simple hook system - [CLI](#CLI) tool with basic HTTP commands ## Installation Install the package from [PyPI](http://pypi.python.org/pypi/) using [pip](https://pip.pypa.io/): ``` pip install trustpilot ``` ## Usage _(for **full usage documentation** checkout [docs](https://github.com/trustpilot/python-trustpilot/blob/master/docs/README.md))_ ```python from trustpilot import client client.default_session.setup( api_host="https://api.trustpilot.com" api_key="YOUR_API_KEY" ) response = client.get("/foo/bar") status_code = response.status_code ``` You can rely on environment variables for the setup of sessions so ```bash $ env TRUSTPILOT_API_HOST=https://api.trustpilot.com TRUSTPILOT_API_KEY=foo TRUSTPILOT_API_SECRET=bar ``` ### CLI The `trustpilot_api_client` command is bundled with the install ```bash Usage: trustpilot_api_client [OPTIONS] COMMAND [ARGS]... Options: --host TEXT Host name --version TEXT Api version --key TEXT Api key --secret TEXT Api secret --token_issuer_host TEXT Token issuer host name --username TEXT Trustpilot username --password TEXT Trustpilot password -c, --config FILENAME Json config file name -e, --env FILENAME Dot env file -of, --outputformat [json|raw] Output format, default=json -v, --verbose Verbosity level --help Show this message and exit. Commands: create-access-token Get an access token delete Send a DELETE request get Send a GET request post Send a POST request with specified data put Send a PUT request with specified data ``` You can also supply the variables with: **--config/-c** : As JSON config file in the following format: ```json { "TRUSTPILOT_API_HOST": "foo", "TRUSTPILOT_API_KEY": "bar", "TRUSTPILOT_API_SECRET": "baz", "TRUSTPILOT_API_VERSION": "v1", "TRUSTPILOT_USERNAME": "username", "TRUSTPILOT_PASSWORD": "password" } ``` or **--env/-e** : As DotEnv config file in the following format: ```ini TRUSTPILOT_API_HOST=foo TRUSTPILOT_API_KEY=bar TRUSTPILOT_API_SECRET=baz TRUSTPILOT_API_VERSION=v1 TRUSTPILOT_USERNAME=username TRUSTPILOT_PASSWORD=password ``` ## Changelog see [HISTORY.md](https://github.com/trustpilot/python-trustpilot/blob/master/HISTORY.md) ## Issues / DEV Report issues [here](https://github.com/trustpilot/python-trustpilot/issues) and we welcome collaboration through PullRequests :-) %package help Summary: Development documents and examples for trustpilot Provides: python3-trustpilot-doc %description help # trustpilot [![Build Status](https://travis-ci.org/trustpilot/python-trustpilot.svg?branch=master)](https://travis-ci.org/trustpilot/python-trustpilot) [![Latest Version](https://img.shields.io/pypi/v/trustpilot.svg)](https://pypi.python.org/pypi/trustpilot) [![Python Support](https://img.shields.io/pypi/pyversions/trustpilot.svg)](https://pypi.python.org/pypi/trustpilot) Python HTTP client for [Trustpilot](https://developers.trustpilot.com/). ### Features - Extends the [`requests.Session`](http://docs.python-requests.org/en/master/api/#requests.Session) class with automatic authentication for public and private endpoints - GET, POST, PUT, DELETE, HEAD, OPTIONS and PATCH methods are exposed on module level - Implements session factory and default singleton session - Provides a simple hook system - [CLI](#CLI) tool with basic HTTP commands ## Installation Install the package from [PyPI](http://pypi.python.org/pypi/) using [pip](https://pip.pypa.io/): ``` pip install trustpilot ``` ## Usage _(for **full usage documentation** checkout [docs](https://github.com/trustpilot/python-trustpilot/blob/master/docs/README.md))_ ```python from trustpilot import client client.default_session.setup( api_host="https://api.trustpilot.com" api_key="YOUR_API_KEY" ) response = client.get("/foo/bar") status_code = response.status_code ``` You can rely on environment variables for the setup of sessions so ```bash $ env TRUSTPILOT_API_HOST=https://api.trustpilot.com TRUSTPILOT_API_KEY=foo TRUSTPILOT_API_SECRET=bar ``` ### CLI The `trustpilot_api_client` command is bundled with the install ```bash Usage: trustpilot_api_client [OPTIONS] COMMAND [ARGS]... Options: --host TEXT Host name --version TEXT Api version --key TEXT Api key --secret TEXT Api secret --token_issuer_host TEXT Token issuer host name --username TEXT Trustpilot username --password TEXT Trustpilot password -c, --config FILENAME Json config file name -e, --env FILENAME Dot env file -of, --outputformat [json|raw] Output format, default=json -v, --verbose Verbosity level --help Show this message and exit. Commands: create-access-token Get an access token delete Send a DELETE request get Send a GET request post Send a POST request with specified data put Send a PUT request with specified data ``` You can also supply the variables with: **--config/-c** : As JSON config file in the following format: ```json { "TRUSTPILOT_API_HOST": "foo", "TRUSTPILOT_API_KEY": "bar", "TRUSTPILOT_API_SECRET": "baz", "TRUSTPILOT_API_VERSION": "v1", "TRUSTPILOT_USERNAME": "username", "TRUSTPILOT_PASSWORD": "password" } ``` or **--env/-e** : As DotEnv config file in the following format: ```ini TRUSTPILOT_API_HOST=foo TRUSTPILOT_API_KEY=bar TRUSTPILOT_API_SECRET=baz TRUSTPILOT_API_VERSION=v1 TRUSTPILOT_USERNAME=username TRUSTPILOT_PASSWORD=password ``` ## Changelog see [HISTORY.md](https://github.com/trustpilot/python-trustpilot/blob/master/HISTORY.md) ## Issues / DEV Report issues [here](https://github.com/trustpilot/python-trustpilot/issues) and we welcome collaboration through PullRequests :-) %prep %autosetup -n trustpilot-9.0.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-trustpilot -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Tue May 30 2023 Python_Bot - 9.0.0-1 - Package Spec generated