## AutogonAI Python Library Readme
### Overview
The AutogonAI Python library is a tool for interacting with AutogonAI's AI automation platform. It enables you to build and manage machine learning projects using a variety of functions and APIs provided by AutogonAI. With this library, you can streamline your machine learning workflow and take advantage of AutogonAI's automation capabilities.
### Installation
You can install the AutogonAI Python library using pip:
```bash
pip install autogonai
```
### Getting Started
To begin using the AutogonAI Python library, you need an API key, which you can obtain from AutogonAI. Once you have your API key, you can set it as an environment variable or pass it directly to the Client object.
```python
import os
from dotenv import load_dotenv
from autogonai.constants import function_codes as fc
from autogonai.core import Client
load_dotenv()
API_KEY = os.environ.get("API_KEY")
client = Client(api_key=API_KEY)
```
### Example Usage
Here's an example of how to use the AutogonAI Python library to create a machine learning project and perform various data preprocessing and training tasks:
```python
# Create a new project
project = client.Projects.create("Test Name", "Test Description")
# Data Input
data_input = client.Blocks.new(
function_code=fc.DataInput,
project_id=project["id"],
id=1
)
data_input.set_params(
file_type="csv",
dburl="https://raw.githubusercontent.com/The-Vheed/polygon-datasets/main/mobile_price_prediction.csv",
)
response = data_input.run()
# Drop Columns
column_dropping = client.Blocks.new(
fc.DropColumns,
project_id=project["id"],
id=data_input + 1,
parent=data_input,
)
column_dropping.set_params(d_columns=[0, 1, 3, 8])
response = column_dropping.run()
# Handle Missing Data
missing_data_handler = client.Blocks.new(
function_code=fc.HandleMissingData,
project_id=project["id"],
id=column_dropping + 1,
parent=column_dropping,
)
missing_data_handler.set_params(strategy_value="mean", boundaries=":, 2:")
response = missing_data_handler.run()
# Encode Data
data_encoder = client.Blocks.new(
function_code=fc.DataEncoding,
project_id=project["id"],
id=missing_data_handler + 1,
parent=missing_data_handler,
)
data_encoder.set_params(
dataset={
"encode": True,
"encoding_type": "label",
"remainder": "passthrough",
"index": 1,
}
)
response = data_encoder.run()
# ... Continue with other data processing tasks
# Train an Artificial Neural Network (ANN)
ann_train = client.Blocks.new(
function_code=fc.ArtificialNeuralNetworkTrain,
project_id=project["id"],
id=data_encoder + 1,
parent=data_encoder,
)
ann_train.set_params(
model_name="titanic model",
hyp_params={
"optimizer": "adam",
"loss": "binary_crossentropy",
"metrics": ["accuracy"],
"batch_size": 12,
"epochs": 5,
},
)
response = ann_train.run()
# ... Continue with evaluation and prediction
```
This is just a basic example to demonstrate how to use the AutogonAI Python library. You can customize it to suit your specific machine learning project requirements.
### Production Pipelines
You can also use the AutogonAI Python library to make pipeline predictions in production. Here's an example of how to call a production machine learning predict pipeline:
```python
response = client.Production.run_pipeline(
flow_id="fl-sy3bgqa5tdtestestestestestestest",
data="https://github.com/autogoninc/autogon-public-datasets/raw/main/credit-risk/sample_pred.csv",
)
```
### Additional AutogonAI APIs
AutogonAI also provides additional APIs like 'Qore' APIs for image functions like 'Image generation' and others.
Here's an example on image generation:
```python
response = client.Qore.VisionAI.image_generation(
"A dad and his son walking down the street towards a park", "512x512"
)
image = Image.open(response["image"])
image.show()
```
Output:

### Documentation
For detailed documentation and usage instructions, please refer to [AutogonAI's official API documentation](https://docs.autogon.ai/)
.
### Support
If you encounter any issues or have questions about the AutogonAI Python library or AutogonAI's platform, please [contact us](https://autogon.ai/company/contact) directly, or raise the issue up on our [discord server](https://discord.gg/3NhD8mcq5F)
Raw data
{
"_id": null,
"home_page": "https://github.com/autogoninc/autogonai-python",
"name": "autogonai",
"maintainer": "Chiemezie Njoku",
"docs_url": null,
"requires_python": "",
"maintainer_email": "manuel@autogon.ai",
"keywords": "",
"author": "David Mbatuegwu",
"author_email": "david@autogon.ai",
"download_url": "https://files.pythonhosted.org/packages/2b/70/4d4049c254f7d70888a7e4cbae31ab6ade823fc0945d735b9f422470634a/autogonai-0.2.1.tar.gz",
"platform": null,
"description": "## AutogonAI Python Library Readme\r\n\r\n### Overview\r\n\r\nThe AutogonAI Python library is a tool for interacting with AutogonAI's AI automation platform. It enables you to build and manage machine learning projects using a variety of functions and APIs provided by AutogonAI. With this library, you can streamline your machine learning workflow and take advantage of AutogonAI's automation capabilities.\r\n\r\n### Installation\r\n\r\nYou can install the AutogonAI Python library using pip:\r\n\r\n```bash\r\npip install autogonai\r\n```\r\n\r\n\r\n### Getting Started\r\n\r\nTo begin using the AutogonAI Python library, you need an API key, which you can obtain from AutogonAI. Once you have your API key, you can set it as an environment variable or pass it directly to the Client object.\r\n\r\n```python\r\nimport os\r\nfrom dotenv import load_dotenv\r\nfrom autogonai.constants import function_codes as fc\r\nfrom autogonai.core import Client\r\n\r\nload_dotenv()\r\n\r\nAPI_KEY = os.environ.get(\"API_KEY\")\r\n\r\nclient = Client(api_key=API_KEY)\r\n```\r\n\r\n### Example Usage\r\n\r\nHere's an example of how to use the AutogonAI Python library to create a machine learning project and perform various data preprocessing and training tasks:\r\n\r\n```python\r\n# Create a new project\r\nproject = client.Projects.create(\"Test Name\", \"Test Description\")\r\n\r\n# Data Input\r\ndata_input = client.Blocks.new(\r\n function_code=fc.DataInput,\r\n project_id=project[\"id\"],\r\n id=1\r\n)\r\ndata_input.set_params(\r\n file_type=\"csv\",\r\n dburl=\"https://raw.githubusercontent.com/The-Vheed/polygon-datasets/main/mobile_price_prediction.csv\",\r\n)\r\nresponse = data_input.run()\r\n\r\n# Drop Columns\r\ncolumn_dropping = client.Blocks.new(\r\n fc.DropColumns,\r\n project_id=project[\"id\"],\r\n id=data_input + 1,\r\n parent=data_input,\r\n)\r\ncolumn_dropping.set_params(d_columns=[0, 1, 3, 8])\r\nresponse = column_dropping.run()\r\n\r\n# Handle Missing Data\r\nmissing_data_handler = client.Blocks.new(\r\n function_code=fc.HandleMissingData,\r\n project_id=project[\"id\"],\r\n id=column_dropping + 1,\r\n parent=column_dropping,\r\n)\r\nmissing_data_handler.set_params(strategy_value=\"mean\", boundaries=\":, 2:\")\r\nresponse = missing_data_handler.run()\r\n\r\n# Encode Data\r\ndata_encoder = client.Blocks.new(\r\n function_code=fc.DataEncoding,\r\n project_id=project[\"id\"],\r\n id=missing_data_handler + 1,\r\n parent=missing_data_handler,\r\n)\r\ndata_encoder.set_params(\r\n dataset={\r\n \"encode\": True,\r\n \"encoding_type\": \"label\",\r\n \"remainder\": \"passthrough\",\r\n \"index\": 1,\r\n }\r\n)\r\nresponse = data_encoder.run()\r\n\r\n# ... Continue with other data processing tasks\r\n\r\n# Train an Artificial Neural Network (ANN)\r\nann_train = client.Blocks.new(\r\n function_code=fc.ArtificialNeuralNetworkTrain,\r\n project_id=project[\"id\"],\r\n id=data_encoder + 1,\r\n parent=data_encoder,\r\n)\r\nann_train.set_params(\r\n model_name=\"titanic model\",\r\n hyp_params={\r\n \"optimizer\": \"adam\",\r\n \"loss\": \"binary_crossentropy\",\r\n \"metrics\": [\"accuracy\"],\r\n \"batch_size\": 12,\r\n \"epochs\": 5,\r\n },\r\n)\r\nresponse = ann_train.run()\r\n\r\n# ... Continue with evaluation and prediction\r\n```\r\n\r\n\r\nThis is just a basic example to demonstrate how to use the AutogonAI Python library. You can customize it to suit your specific machine learning project requirements.\r\n\r\n### Production Pipelines\r\n\r\nYou can also use the AutogonAI Python library to make pipeline predictions in production. Here's an example of how to call a production machine learning predict pipeline:\r\n\r\n```python\r\nresponse = client.Production.run_pipeline(\r\n flow_id=\"fl-sy3bgqa5tdtestestestestestestest\",\r\n data=\"https://github.com/autogoninc/autogon-public-datasets/raw/main/credit-risk/sample_pred.csv\",\r\n)\r\n```\r\n\r\n### Additional AutogonAI APIs\r\n\r\nAutogonAI also provides additional APIs like 'Qore' APIs for image functions like 'Image generation' and others.\r\nHere's an example on image generation:\r\n```python\r\nresponse = client.Qore.VisionAI.image_generation(\r\n \"A dad and his son walking down the street towards a park\", \"512x512\"\r\n)\r\n\r\nimage = Image.open(response[\"image\"])\r\nimage.show()\r\n```\r\nOutput:\r\n\r\n\r\n\r\n### Documentation\r\n\r\nFor detailed documentation and usage instructions, please refer to [AutogonAI's official API documentation](https://docs.autogon.ai/)\r\n.\r\n\r\n### Support\r\n\r\nIf you encounter any issues or have questions about the AutogonAI Python library or AutogonAI's platform, please [contact us](https://autogon.ai/company/contact) directly, or raise the issue up on our [discord server](https://discord.gg/3NhD8mcq5F)\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Python connector for Autogon Public APIs",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/autogoninc/autogonai-python"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a476d6a866cb682efaf34a140f85d8aa9089b46390b2756b55222a752e9618c4",
"md5": "74fa5f98e4acddc713fb305d965734f4",
"sha256": "4e2a579c0950ea6d4b70865de16f9b264f62f2d5b96b848b51598b46e6ea6e13"
},
"downloads": -1,
"filename": "autogonai-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "74fa5f98e4acddc713fb305d965734f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18125,
"upload_time": "2023-10-09T06:40:48",
"upload_time_iso_8601": "2023-10-09T06:40:48.638704Z",
"url": "https://files.pythonhosted.org/packages/a4/76/d6a866cb682efaf34a140f85d8aa9089b46390b2756b55222a752e9618c4/autogonai-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "2b704d4049c254f7d70888a7e4cbae31ab6ade823fc0945d735b9f422470634a",
"md5": "6beae2398d4c9695a157fe21337f36f0",
"sha256": "5e8c0e4e5a64e24204434afc19d7316aaf8344a1c5cb07cceed0059f30deceb8"
},
"downloads": -1,
"filename": "autogonai-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "6beae2398d4c9695a157fe21337f36f0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16096,
"upload_time": "2023-10-09T06:40:54",
"upload_time_iso_8601": "2023-10-09T06:40:54.647401Z",
"url": "https://files.pythonhosted.org/packages/2b/70/4d4049c254f7d70888a7e4cbae31ab6ade823fc0945d735b9f422470634a/autogonai-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-10-09 06:40:54",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "autogoninc",
"github_project": "autogonai-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "python-dotenv",
"specs": [
[
"==",
"1.0.0"
]
]
}
],
"lcname": "autogonai"
}