diff --git a/README.md b/README.md deleted file mode 100644 index ce3f716..0000000 --- a/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# convertio -[![Convertio version on pypi](https://img.shields.io/pypi/v/convertio.svg)](https://pypi.org/project/convertio) -[![Discord support server](https://discord.com/api/guilds/800032961525317693/embed.png)](https://discord.gg/t2dxrXMKya) - -An API wrapper for convertio.co. Before starting, make sure [you've got an API key](https://developers.convertio.co/user/registration/api?utm_source=api_top_btn). The full API reference can be found on [convertio.co/api/docs](https://convertio.co/api/docs), but I'll make a documentation for this package soon. - -## Get started -- Sign-up to [developers.convertio.co](https://developers.convertio.co/user/registration/api?utm_source=api_top_btn). -- Get your free API key from [the homepage](https://developers.convertio.co) -- Install this module : run `python -m pip install convertio -U` for Windows or `python3 -m pip install convertio -U` for Linux and Macos. You can also download it from github `pip install git+https://github.com/PetitPotiron/python-convertio.git` - -## Quick start -```python -import convertio -import time - -client = convertio.Client(token="INSERT_YOUR_TOKEN_HERE") -conversion_id = client.convert_by_filename('source.txt', 'pdf') -while client.check_conversion(conversion_id).step != 'finish': - time.sleep(1) -client.download(conversion_id, 'result.pdf') -client.delete(conversion_id) -``` - - -## Notes - -Version `1.2.0` - -This module is neither created nor managed by convertio.co. It represents services faithful to the API and documentation from their website. This API is not unofficial, and it can be payable if you exceed a certain usage. Notice that you must respect convertio.co's [terms of use](https://convertio.co/terms). - -### Links -- [Get an API key](https://developers.convertio.co/user/registration/api?utm_source=api_top_btn) -- [API pricing](https://developers.convertio.co/api/pricing) -- [API reference](https://developers.convertio.co/api/docs) -- [OCR (options) pricing](https://developers.convertio.co/ocr/pricing) -- [Conversion types](https://convertio.co/formats) -- [GitHub](https:/github.com/PetitPotiron/python-convertio) -- [PHP module by convertio.co](https://github.com/convertio/convertio-php) -- [CLI for convertio.co, by themselves](https://developers.convertio.co/cli) - -### Changelog -- Fixed error when trying to upload a file of a different format than .txt. It used to be impossible. Added usage example -- [Fix issue #1 (typing does not work on 3.8 and lower)](https://github.com/PetitPotiron/python-convertio/commit/3faddfac11d2d0e055c5b181041fd9d0587c3f46) \ No newline at end of file diff --git a/LICENSE b/convertio/LICENSE similarity index 100% rename from LICENSE rename to convertio/LICENSE diff --git a/examples/example.py b/examples/example.py deleted file mode 100644 index f4a3acc..0000000 --- a/examples/example.py +++ /dev/null @@ -1,27 +0,0 @@ -import os -import convertio -import time - -client = convertio.Client(token="INSERT_YOUR_TOKEN_HERE") -conversion_id = client.convert_by_filename('source.txt', 'pdf') -while client.check_conversion(conversion_id).step != 'finish': - time.sleep(1) -client.download(conversion_id, 'result.pdf') -client.delete(conversion_id) - - -def convert_with_convertio(input_file: str, output_file: str, api_key: str): - client = convertio.Client(token=api_key) - conversion_id = client.convert_by_filename(fp=input_file, - output_format=get_file_extension(output_file)) - while client.check_conversion(conversion_id).step != 'finish': - time.sleep(1) - client.download(conversion_id, os.path.abspath(output_file)) - - -convert_with_convertio('source.txt', 'result.pdf', "INSERT_YOUR_TOKEN_HERE") - - -def get_file_extension(file: str): - root, extension = os.path.splitext(file) - return extension[1:] diff --git a/examples/result.pdf b/examples/result.pdf deleted file mode 100644 index 316842c..0000000 Binary files a/examples/result.pdf and /dev/null differ diff --git a/examples/source.txt b/examples/source.txt deleted file mode 100644 index 8e9e960..0000000 --- a/examples/source.txt +++ /dev/null @@ -1 +0,0 @@ -This is an example. diff --git a/pypoject.toml b/pypoject.toml deleted file mode 100644 index 374b58c..0000000 --- a/pypoject.toml +++ /dev/null @@ -1,6 +0,0 @@ -[build-system] -requires = [ - "setuptools>=42", - "wheel" -] -build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py deleted file mode 100644 index aa3ceb1..0000000 --- a/setup.py +++ /dev/null @@ -1,15 +0,0 @@ -from setuptools import setup - -with open("README.md", "r") as fh: - long_description = fh.read() - -setup(name="convertio", - version="1.2.0", - description="An API wrapper for convertio.co", - long_description=long_description, - long_description_content_type="text/markdown", - author="PetitPotiron", - packages=["convertio"], - license="GNU General Public License v3.0", - url='https://github.com/PetitPotiron/python-convertio/' - )