AnySolve.ai Client library
Project description
anysolve is a library for executing AnySolve.ai tasks. It needs an API-Key that can be created in the settings of an anysolve.ai account. The settings can be found at https://www.anysolve.ai/settings.
Please note that the execution of an AnySolve.ai task may be chargeable.
Installation
You can install this library by using pip. The library is designed to use only requests as dependency.
Supported Python Versions
Python >= 3.6
Mac/Linux
pip3 install anysolve
Windows
pip.exe install anysolve
Create an access token
You can create an access token at https://www.anysolve.ai/settings/personal-access-tokens
Example Usage
Translation of a text (free)
The following code uses the translation API for text (free):
from anysolve import AnySolve
client = AnySolve(
"your_api_key"
)
result = client.run(
"intern-translation-free",
"1.0.0",
{
"source_language": "de",
"text": "Das ist ein rotes Haus.",
"target_language": "en",
},
)
print(result)
https://www.anysolve.ai/tasks/u-ba835df8268fc301-translates-a-text
Introduction from Text
The following code creates an introduction from a text:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('create-introduction','1.0.1', {'text': 'As a swan person I like to go to lakes', 'context': 'You are a creative writer.'})
print(res)
Create Newspaper Headline from Text
The following creates a newspaper headline by a text:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('create-newspaper-headline','1.0.0', {'text': 'A group of police...', 'lang': 'English', 'context': 'You are a boulevard journalist.'})
print(res)
Explain Code
The following code explains a code:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('explain-code','1.0.0', {'code': 'print(\'hello world\')'})
print(res)
Google Search
The following code does a google search:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('intern-web-google-search','1.0.0', {'search_query': 'AnySolve.ai', 'location': 'us', 'language': 'lang_en', 'max_results': '5'})
print(res)
Generate SEO Keywords
The following code generates SEO keywords:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-ba835df8268fc301-seo-keyword','1.0.0', {'topic': 'A plattform saas platform targeted to AI tasks'})
print(res)
https://www.anysolve.ai/tasks/u-ba835df8268fc301-seo-keyword
Rewrite Text Tone to Be Polite
The following code creates rewrites the text to be polite:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-ba835df8268fc301-rewrite-text-tone-to-be-polite','1.0.0', {'text': 'I want you to quit an join my business'})
print(res)
https://www.anysolve.ai/tasks/u-ba835df8268fc301-rewrite-text-tone-to-be-polite
Generate Alternative Titles
The following code generates alternatives to a title:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-ba835df8268fc301-generate-alternative-titles','1.0.0', {'title': 'AnySolve.ai - An AI community hub', 'field_of_use': 'Blog post'})
print(res)
https://www.anysolve.ai/tasks/u-ba835df8268fc301-generate-alternative-titles
Create Regex by Description
The following code creates a regex by a description:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-ba835df8268fc301-create-regex-by-description','1.0.0', {'requirement': 'allow up to 3 chars and numbers and then *', 'type': 'PCRE'})
print(res)
https://www.anysolve.ai/tasks/u-ba835df8268fc301-create-regex-by-description
Answer Yes/No Question about Text
The following code answers a yes / no question:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-ba835df8268fc301-answer-yesno-question-about-text','1.0.0', {'text': 'It is a hot day. Maria is on her way to the lake. She will meet her friends there.', 'question': 'Is the main character of the text female?'})
print(res)
https://www.anysolve.ai/tasks/u-ba835df8268fc301-answer-yesno-question-about-text
Answer Question about Text
The following code answers a question about a text:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-ba835df8268fc301-answer-question-about-text','1.0.0', {'question': 'What is the name of the main character?', 'text': 'It is a hot day. Maria is on her way to the lake. She will meet her friends there.'})
print(res)
https://www.anysolve.ai/tasks/u-ba835df8268fc301-answer-question-about-text
Transform Style & Tone
The following code changes the style & tone of a text:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-806494eb1fbfb39f-transform-style--tone','1.0.0', {'style': 'Persuasive', 'tone': 'Formal', 'text': 'I want you to quit an join my business'})
print(res)
https://www.anysolve.ai/tasks/u-806494eb1fbfb39f-transform-style–tone
Text Compression
The following code makes a text smaller without loosing too much information:
import os
from anysolve import AnySolve
anysolve_token = os.environ.get('ANYSOLVE_PERSONAL_ACCESS_TOKEN') # Resolve your personal access token here
client = AnySolve(anysolve_token)
res = client.run('u-806494eb1fbfb39f-text-compression','1.0.0', {'text': 'Enter text to compress'})
print(res)
https://www.anysolve.ai/tasks/u-806494eb1fbfb39f-text-compression
Pricing
Please go to https://www.anysolve.ai/pricing and study the specific tasks for prices. You may get free credits on registration and some tasks are free.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file anysolve-1.0.4.tar.gz
.
File metadata
- Download URL: anysolve-1.0.4.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 426b464d06deae5936c1f70f50f3f4071995e6f6d71d7ea034d0d01ca0d9b9e3 |
|
MD5 | c1be6bfc8a577f4f2e37f4e2ad2c245d |
|
BLAKE2b-256 | ea88c94b0e7e87a7bb06124856e46967afb579f6f9b9644d19fa2be37c02a03d |
File details
Details for the file anysolve-1.0.4-py2.py3-none-any.whl
.
File metadata
- Download URL: anysolve-1.0.4-py2.py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff27340e0c11553038d9ad1dfe4909f3d11b004fe9e22479721246c225754189 |
|
MD5 | 4c4a4f7649a70821eb3c8e64bb93dcbb |
|
BLAKE2b-256 | 6a8fc93fb4aab4a0a3d7a6a5c0338c3dc8b6b70fabdd254660838480f77aae52 |