%global _empty_manifest_terminate_build 0 Name: python-ox3apiclient Version: 0.6.3 Release: 1 Summary: Client to connect to the OpenX Enterprise API. License: BSD URL: https://github.com/openx/OX3-Python-API-Client Source0: https://mirrors.nju.edu.cn/pypi/web/packages/65/d2/e04184bfd7506429e66f14f8764211448d9b66c68cc41e582f5fe92a79c5/ox3apiclient-0.6.3.tar.gz BuildArch: noarch %description # ox3apiclient A small class to help connect to the OpenX Enterprise API. As of version 0.5.0 it uses [requests_oauthlib](https://github.com/requests/requests-oauthlib) instead of oauth2. It currently supports Python 2.6 - 3.5. As of version 0.4.0, ox3apiclient supports API v2. If your instance is v2, set the api_path option to "/ox/4.0". As of version 0.5.0 the client.request method returns a requests.Response object instead of urllib2.Response and throws a requests.exceptions.HTTPError instead of urllib2.HTTPError. In addition debugging is now available via the standard python logging facility. See the [requests documentation](http://docs.python-requests.org/en/latest/) for details. Basic usage: ````python import ox3apiclient import logging ox = ox3apiclient.client_from_file().logon() ox.logger.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) ox.logger.addHandler(ch) accounts = ox.get('/account') order = { 'status': 'Active', 'name': 'OX3APIClient Object Creation Test', 'account_uid': accounts['objects'][0]['account_uid'], 'start_date': '2016-06-01 00:00:00'} new_order = ox.post('/order', data=order) ox.delete('/order/%s' % new_order['uid']) ox.logoff() ```` ## Installation From Pypi The last released version (from the master branch) is available at [PyPi](http://pypi.python.org/pypi) ```` $ pip install ox3apiclient ```` From Github: Just clone our git repo: ```` $ git clone https://github.com/openx/OX3-Python-API-Client.git ```` Install the downloaded library: ```` python setup.py install ```` this will install the current dependencies. ## Authentication The recommended method of authentication is to use `ox3apiclient.client_from_file`. By default this will look for a file named `.ox3rc` in the current current directory, but this can be overwritten by specifying a `file_path` parameter. The file should be in the following format: ```` [ox3apiclient] envs= dev prod [dev] email: you@example.com password: password123 domain: dev.uidomain.com realm: dev.uidomain_realm consumer_key: 1fc5c9ae... consumer_secret: 7c664d68... authorization_url: http://custom_sso.uidomain.com/api/index/initiate [prod] email: you@example.com password: password123 domain: uidomain.com realm: uidomain_realm consumer_key: 1fc5c9ae... consumer_secret: 7c664d68... ```` `ox3apiclient.client_from_file` will use the first `env` by default but this can be overwritten by setting the `env` parameter. If your email and password are set in `.ox3rc` you can simply chain a call to `logon()`. Alternatively you can set everything in your code. ````python email = 'you@example.com' password = 'password123' domain = 'uidomain.com' realm = 'uidomain_realm' consumer_key = '1fc5c9ae...' consumer_secret = '7c664d68...' ox = ox3apiclient.Client( email=email, password=password, domain=domain, realm=realm, consumer_key=consumer_key, consumer_secret=consumer_secret) ox.logon(email, password) ```` # To run these tests. Install nose (pip install nose) # and run nosetests -sxv tests/ from the root dir ## Tests Install nose ````bash pip install nose ```` and run the following command line from the root: ````bash nosetests -sxv tests/ ```` %package -n python3-ox3apiclient Summary: Client to connect to the OpenX Enterprise API. Provides: python-ox3apiclient BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-ox3apiclient # ox3apiclient A small class to help connect to the OpenX Enterprise API. As of version 0.5.0 it uses [requests_oauthlib](https://github.com/requests/requests-oauthlib) instead of oauth2. It currently supports Python 2.6 - 3.5. As of version 0.4.0, ox3apiclient supports API v2. If your instance is v2, set the api_path option to "/ox/4.0". As of version 0.5.0 the client.request method returns a requests.Response object instead of urllib2.Response and throws a requests.exceptions.HTTPError instead of urllib2.HTTPError. In addition debugging is now available via the standard python logging facility. See the [requests documentation](http://docs.python-requests.org/en/latest/) for details. Basic usage: ````python import ox3apiclient import logging ox = ox3apiclient.client_from_file().logon() ox.logger.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) ox.logger.addHandler(ch) accounts = ox.get('/account') order = { 'status': 'Active', 'name': 'OX3APIClient Object Creation Test', 'account_uid': accounts['objects'][0]['account_uid'], 'start_date': '2016-06-01 00:00:00'} new_order = ox.post('/order', data=order) ox.delete('/order/%s' % new_order['uid']) ox.logoff() ```` ## Installation From Pypi The last released version (from the master branch) is available at [PyPi](http://pypi.python.org/pypi) ```` $ pip install ox3apiclient ```` From Github: Just clone our git repo: ```` $ git clone https://github.com/openx/OX3-Python-API-Client.git ```` Install the downloaded library: ```` python setup.py install ```` this will install the current dependencies. ## Authentication The recommended method of authentication is to use `ox3apiclient.client_from_file`. By default this will look for a file named `.ox3rc` in the current current directory, but this can be overwritten by specifying a `file_path` parameter. The file should be in the following format: ```` [ox3apiclient] envs= dev prod [dev] email: you@example.com password: password123 domain: dev.uidomain.com realm: dev.uidomain_realm consumer_key: 1fc5c9ae... consumer_secret: 7c664d68... authorization_url: http://custom_sso.uidomain.com/api/index/initiate [prod] email: you@example.com password: password123 domain: uidomain.com realm: uidomain_realm consumer_key: 1fc5c9ae... consumer_secret: 7c664d68... ```` `ox3apiclient.client_from_file` will use the first `env` by default but this can be overwritten by setting the `env` parameter. If your email and password are set in `.ox3rc` you can simply chain a call to `logon()`. Alternatively you can set everything in your code. ````python email = 'you@example.com' password = 'password123' domain = 'uidomain.com' realm = 'uidomain_realm' consumer_key = '1fc5c9ae...' consumer_secret = '7c664d68...' ox = ox3apiclient.Client( email=email, password=password, domain=domain, realm=realm, consumer_key=consumer_key, consumer_secret=consumer_secret) ox.logon(email, password) ```` # To run these tests. Install nose (pip install nose) # and run nosetests -sxv tests/ from the root dir ## Tests Install nose ````bash pip install nose ```` and run the following command line from the root: ````bash nosetests -sxv tests/ ```` %package help Summary: Development documents and examples for ox3apiclient Provides: python3-ox3apiclient-doc %description help # ox3apiclient A small class to help connect to the OpenX Enterprise API. As of version 0.5.0 it uses [requests_oauthlib](https://github.com/requests/requests-oauthlib) instead of oauth2. It currently supports Python 2.6 - 3.5. As of version 0.4.0, ox3apiclient supports API v2. If your instance is v2, set the api_path option to "/ox/4.0". As of version 0.5.0 the client.request method returns a requests.Response object instead of urllib2.Response and throws a requests.exceptions.HTTPError instead of urllib2.HTTPError. In addition debugging is now available via the standard python logging facility. See the [requests documentation](http://docs.python-requests.org/en/latest/) for details. Basic usage: ````python import ox3apiclient import logging ox = ox3apiclient.client_from_file().logon() ox.logger.setLevel(logging.DEBUG) ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) ox.logger.addHandler(ch) accounts = ox.get('/account') order = { 'status': 'Active', 'name': 'OX3APIClient Object Creation Test', 'account_uid': accounts['objects'][0]['account_uid'], 'start_date': '2016-06-01 00:00:00'} new_order = ox.post('/order', data=order) ox.delete('/order/%s' % new_order['uid']) ox.logoff() ```` ## Installation From Pypi The last released version (from the master branch) is available at [PyPi](http://pypi.python.org/pypi) ```` $ pip install ox3apiclient ```` From Github: Just clone our git repo: ```` $ git clone https://github.com/openx/OX3-Python-API-Client.git ```` Install the downloaded library: ```` python setup.py install ```` this will install the current dependencies. ## Authentication The recommended method of authentication is to use `ox3apiclient.client_from_file`. By default this will look for a file named `.ox3rc` in the current current directory, but this can be overwritten by specifying a `file_path` parameter. The file should be in the following format: ```` [ox3apiclient] envs= dev prod [dev] email: you@example.com password: password123 domain: dev.uidomain.com realm: dev.uidomain_realm consumer_key: 1fc5c9ae... consumer_secret: 7c664d68... authorization_url: http://custom_sso.uidomain.com/api/index/initiate [prod] email: you@example.com password: password123 domain: uidomain.com realm: uidomain_realm consumer_key: 1fc5c9ae... consumer_secret: 7c664d68... ```` `ox3apiclient.client_from_file` will use the first `env` by default but this can be overwritten by setting the `env` parameter. If your email and password are set in `.ox3rc` you can simply chain a call to `logon()`. Alternatively you can set everything in your code. ````python email = 'you@example.com' password = 'password123' domain = 'uidomain.com' realm = 'uidomain_realm' consumer_key = '1fc5c9ae...' consumer_secret = '7c664d68...' ox = ox3apiclient.Client( email=email, password=password, domain=domain, realm=realm, consumer_key=consumer_key, consumer_secret=consumer_secret) ox.logon(email, password) ```` # To run these tests. Install nose (pip install nose) # and run nosetests -sxv tests/ from the root dir ## Tests Install nose ````bash pip install nose ```` and run the following command line from the root: ````bash nosetests -sxv tests/ ```` %prep %autosetup -n ox3apiclient-0.6.3 %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-ox3apiclient -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 10 2023 Python_Bot - 0.6.3-1 - Package Spec generated