py-leap-api


Namepy-leap-api JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/IperGiove/py_leap_api
SummaryUnofficial Library to interact with TryLeap REST API
upload_time2023-03-24 20:19:42
maintainer
docs_urlNone
authoripergiove
requires_python>=3.0.0, <4
license
keywords leap api genrative image
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # TryLeap Python API
The py_leap_api Python package provides a simple interface for interacting with the TryLeap service, a cloud-based platform for generating images using artificial intelligence.

## Installation
You can install the py_leap_api package using pip:

```bash
pip install py_leap_api
```

## Getting Started
First, you'll need to create an account on the TryLeap website and obtain an API key.

Once you have an API key, you can use the TryLeap class to interact with the service. Here's a simple example that creates a model, uploads some images, and generates some images based on a prompt:

```python
from py_leap_api.leap import TryLeap

# Create a TryLeap object with your API key
api_key = "your-api-key"
leap = TryLeap(api=api_key)

# Create a model
model = await leap.create_model("My Model")
print(model)

# add the model id
leap.set_model(model=model["id"])

# Upload some images
urls = [
    "https://example.com/image1.png",
    "https://example.com/image2.png",
    "https://example.com/image3.png",
]
await leap.upload_images_url(urls)

# Train the model
queue = await leap.training_model()
print(queue)
```

Ideally if you have a webhook url you can provide it to training_model in order to know when the training finished.
Otherwise you can fetch the status that return from the function.

```python
# Generate some images
prompt = "a cat sitting on a couch"
response = await leap.generate_image(prompt, number_images=3)

# Retrieve the output images
output_images = await leap.output_images()
```

# License
This library is licensed under the MIT License. See the LICENSE file for details.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/IperGiove/py_leap_api",
    "name": "py-leap-api",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.0.0, <4",
    "maintainer_email": "",
    "keywords": "Leap,api,genrative,image",
    "author": "ipergiove",
    "author_email": "ipergiove@duck.com",
    "download_url": "https://files.pythonhosted.org/packages/51/0d/7dfaa93e621019b806e2771f018d83d627f5b4daddc94eb7a7b83349027c/py_leap_api-0.0.6.tar.gz",
    "platform": null,
    "description": "# TryLeap Python API\nThe py_leap_api Python package provides a simple interface for interacting with the TryLeap service, a cloud-based platform for generating images using artificial intelligence.\n\n## Installation\nYou can install the py_leap_api package using pip:\n\n```bash\npip install py_leap_api\n```\n\n## Getting Started\nFirst, you'll need to create an account on the TryLeap website and obtain an API key.\n\nOnce you have an API key, you can use the TryLeap class to interact with the service. Here's a simple example that creates a model, uploads some images, and generates some images based on a prompt:\n\n```python\nfrom py_leap_api.leap import TryLeap\n\n# Create a TryLeap object with your API key\napi_key = \"your-api-key\"\nleap = TryLeap(api=api_key)\n\n# Create a model\nmodel = await leap.create_model(\"My Model\")\nprint(model)\n\n# add the model id\nleap.set_model(model=model[\"id\"])\n\n# Upload some images\nurls = [\n    \"https://example.com/image1.png\",\n    \"https://example.com/image2.png\",\n    \"https://example.com/image3.png\",\n]\nawait leap.upload_images_url(urls)\n\n# Train the model\nqueue = await leap.training_model()\nprint(queue)\n```\n\nIdeally if you have a webhook url you can provide it to training_model in order to know when the training finished.\nOtherwise you can fetch the status that return from the function.\n\n```python\n# Generate some images\nprompt = \"a cat sitting on a couch\"\nresponse = await leap.generate_image(prompt, number_images=3)\n\n# Retrieve the output images\noutput_images = await leap.output_images()\n```\n\n# License\nThis library is licensed under the MIT License. See the LICENSE file for details.\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Unofficial Library to interact with TryLeap REST API",
    "version": "0.0.6",
    "split_keywords": [
        "leap",
        "api",
        "genrative",
        "image"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "afa066b23976ac42f5a7c924184d5aaf40b7bcaf9ad7330dfd213ff904b594e8",
                "md5": "944928c9f13788da18b61f96d663e8a7",
                "sha256": "0c806cf09ff10889cec589ec2167572cbac52d40650e005b58ca608f470d8964"
            },
            "downloads": -1,
            "filename": "py_leap_api-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "944928c9f13788da18b61f96d663e8a7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.0.0, <4",
            "size": 4935,
            "upload_time": "2023-03-24T20:19:39",
            "upload_time_iso_8601": "2023-03-24T20:19:39.597072Z",
            "url": "https://files.pythonhosted.org/packages/af/a0/66b23976ac42f5a7c924184d5aaf40b7bcaf9ad7330dfd213ff904b594e8/py_leap_api-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "510d7dfaa93e621019b806e2771f018d83d627f5b4daddc94eb7a7b83349027c",
                "md5": "5c1818162b2d08d67b1a54f642b50301",
                "sha256": "cfc392cb5abf2a794263b4ccd7fee6e00233b360798c97e4825f01c94c349542"
            },
            "downloads": -1,
            "filename": "py_leap_api-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "5c1818162b2d08d67b1a54f642b50301",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.0.0, <4",
            "size": 4809,
            "upload_time": "2023-03-24T20:19:42",
            "upload_time_iso_8601": "2023-03-24T20:19:42.002787Z",
            "url": "https://files.pythonhosted.org/packages/51/0d/7dfaa93e621019b806e2771f018d83d627f5b4daddc94eb7a7b83349027c/py_leap_api-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-24 20:19:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "IperGiove",
    "github_project": "py_leap_api",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "py-leap-api"
}
        
Elapsed time: 0.04729s