diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9d08474 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,27 @@ +name: Build +on: [push,pull_request] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - '2.7' + - '3.6' + - '3.7' + - '3.9' + name: Python ${{ matrix.python-version }} sample + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install -r test-requirements.txt + - env: + CONVERT_API_SECRET: ${{ secrets.CONVERTAPI_SECRET }} + run: nosetests diff --git a/.gitignore b/.gitignore index 76f2a46..8999207 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ coverage.xml # Sphinx documentation docs/_build/ +.python-version diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0e8c4d9..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: python -python: -- 2.7 -- 3.4 -- 3.5 -- 3.6 -install: -- pip install -r requirements.txt -- pip install -r test-requirements.txt -- python setup.py develop -script: -- nosetests -env: - global: - secure: ppjKrL1CxLcjVt1UOop+eaPYCoB9VoXz6LyE4dGr9R9aZs6+R3y+Z0eCgXoOz82xdi/H8GbN8p/tDho5+AQyBzsIINE5W8hEfWraQo9jo3QspNjFyx5j4d5zf6dglqf3535FNEiI6NPXSlQH/WioUMpMvKS32UwBPhV+IEm7lycQevB+rOC9taDvGgapl2glTp32C7nNAS7iS7jScdhEBPFnPBhGEIUTtiWlsYAXnq1I7Jgub8GAjcFQloM5G92v7BhVQzBco8004lA5AG9zrh8aimB2KOc1ng8mot6x0how4lYImo48wBDDYqtHygO64Qg5fLm/xVtXGqlOYTO+iY0Qm1BeXQhVfmVwD+K8qq3PhZRHCCsjBcL0KTH3IMeHH4f38x0V/KZrEtE6/TPLzTZib2aWCX7Ei88aajZSq0TZA+6qqSq+G+Qs6YqapHl7E86UU+qhxO8ZIDIOsZz8Ikf09qWdwJThIROhYUHI+GB3y/5C4+jOG8hssFy2IO8mQYJRBBp0dwwyoJZq8WkPvwh5efUUReCDhl5vdNy6GE6I6NqsdyouiePAWrLhh1zr2rpZ7kgTyKGp5FInbFOJ7igDJnf5WhouPaFzgtUaVUHQlKKOPJunyxqZbMAPTea2oVRsORXObjCMU+rPSc81tgSc8xOnZKiRYfJPAUeOALI= diff --git a/README.md b/README.md index 685db9c..4a3f765 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # ConvertAPI Python Client [![PyPI version](https://badge.fury.io/py/convertapi.svg)](https://badge.fury.io/py/convertapi) -[![Build Status](https://secure.travis-ci.org/ConvertAPI/convertapi-python.svg)](http://travis-ci.org/ConvertAPI/convertapi-python) +[![Build Status](https://github.com/ConvertAPI/convertapi-python/actions/workflows/main.yml/badge.svg)](https://github.com/ConvertAPI/convertapi-python/actions) +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) ## Convert your files with our online file conversion API @@ -84,7 +85,7 @@ result = convertapi.convert( #### Additional conversion parameters ConvertAPI accepts additional conversion parameters depending on selected formats. All conversion -parameters and explanations can be found [here](https://www.convertapi.com). +parameters and explanations can be found [here](https://www.convertapi.com/conversions). ```python result = convertapi.convert( diff --git a/convertapi/__init__.py b/convertapi/__init__.py index 1931cf8..a98c554 100644 --- a/convertapi/__init__.py +++ b/convertapi/__init__.py @@ -1,4 +1,4 @@ -__version__ = '1.4.0' +__version__ = '1.5.0' from .exceptions import * from .client import Client @@ -10,7 +10,7 @@ api_secret = None base_uri = 'https://v2.convertapi.com/' user_agent = 'ConvertAPI-Python/' + __version__ -timeout = 60 +timeout = 1800 conversion_timeout = None conversion_timeout_delta = 10 upload_timeout = 1800 diff --git a/convertapi/task.py b/convertapi/task.py index 5fc15e8..e580456 100644 --- a/convertapi/task.py +++ b/convertapi/task.py @@ -3,7 +3,7 @@ from convertapi import file_param, format_detector, utils from .result import Result -DEFAULT_URL_FORMAT = 'url' +DEFAULT_URL_FORMAT = 'web' class Task: def __init__(self, from_format, to_format, params, timeout = None): @@ -50,6 +50,9 @@ def __normalize_params(self): return params def __detect_format(self): + if str(self.to_format).lower() == 'zip': + return 'any' + if 'Url' in self.params: return DEFAULT_URL_FORMAT