bingart


Namebingart JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/DedInc/bingart
Summarybingart is an unofficial API wrapper for Bing Image Creator (based on DALL-E 3).
upload_time2024-01-26 18:53:09
maintainer
docs_urlNone
authorMaehdakvan
requires_python>=3.6
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 🎨 bingart

bingart is an unofficial 🤫 API wrapper for Bing Image Creator (based on DALL-E 3). It allows you to programmatically generate 🖼️ AI-powered images using Bing's image creation tool.

> ⚠️ **Warning:** The `_U` auth cookie should be changed every 2-4 weeks for working.

## 💡 Description 

This module uses web scraping and engineering techniques to interface with Bing's internal image creation APIs. It is not an official API client. 

### 🔑 Key Features

- 🖼️ **Generate images** by providing a text prompt
- 📸 **Get image URLs** up to 4 generated images  
- 🔐 **Authentication** via saved Bing cookies or auto-fetched from browsers
- ⚠️ **Custom exceptions** for common issues

## 💻 Usage

Import and instantiate the `BingArt` class with a valid `_U` cookie value:

```python
from bingart import BingArt

bing_art = BingArt(auth_cookie_U='...')

try:
    results = bing_art.generate_images('sunset')
    print(results)
finally:
    bing_art.close_session()
```

### Sometimes an extra cookie called `KievRPSSecAuth` is required for it to work properly

```python
bing_art = BingArt(auth_cookie_U='...', auth_cookie_KievRPSSecAuth='...')
```

### Also, you can try the auto cookie search feature

```python
bing_art = BingArt(auto=True)
```


Call `generate_images()` with your query text:

```python 
results = bing.generate_images("a cat painting in Picasso style")
```

The return value contains image URLs and original prompt: 

```json
{
  "images": [
    {"url": "https://..."}
  ],
  "prompt": "a cat painting in Picasso style"
}
```

## 🚨 Exceptions

- `AuthCookieError`: Invalid authentication cookie
- `PromptRejectedError`: Prompt rejected as unethical  

## 🤝 Contributing

Pull requests welcome! Please open an issue to discuss major changes.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DedInc/bingart",
    "name": "bingart",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "",
    "author": "Maehdakvan",
    "author_email": "visitanimation@google.com",
    "download_url": "https://files.pythonhosted.org/packages/c4/25/07fe1d428aba05ee5b899eca835d37276c152f8112b6ac7a0dd43700a647/bingart-1.0.3.tar.gz",
    "platform": null,
    "description": "# \ud83c\udfa8 bingart\r\n\r\nbingart is an unofficial \ud83e\udd2b API wrapper for Bing Image Creator (based on DALL-E 3). It allows you to programmatically generate \ud83d\uddbc\ufe0f AI-powered images using Bing's image creation tool.\r\n\r\n> \u26a0\ufe0f **Warning:** The `_U` auth cookie should be changed every 2-4 weeks for working.\r\n\r\n## \ud83d\udca1 Description \r\n\r\nThis module uses web scraping and engineering techniques to interface with Bing's internal image creation APIs. It is not an official API client. \r\n\r\n### \ud83d\udd11 Key Features\r\n\r\n- \ud83d\uddbc\ufe0f **Generate images** by providing a text prompt\r\n- \ud83d\udcf8 **Get image URLs** up to 4 generated images  \r\n- \ud83d\udd10 **Authentication** via saved Bing cookies or auto-fetched from browsers\r\n- \u26a0\ufe0f **Custom exceptions** for common issues\r\n\r\n## \ud83d\udcbb Usage\r\n\r\nImport and instantiate the `BingArt` class with a valid `_U` cookie value:\r\n\r\n```python\r\nfrom bingart import BingArt\r\n\r\nbing_art = BingArt(auth_cookie_U='...')\r\n\r\ntry:\r\n    results = bing_art.generate_images('sunset')\r\n    print(results)\r\nfinally:\r\n    bing_art.close_session()\r\n```\r\n\r\n### Sometimes an extra cookie called `KievRPSSecAuth` is required for it to work properly\r\n\r\n```python\r\nbing_art = BingArt(auth_cookie_U='...', auth_cookie_KievRPSSecAuth='...')\r\n```\r\n\r\n### Also, you can try the auto cookie search feature\r\n\r\n```python\r\nbing_art = BingArt(auto=True)\r\n```\r\n\r\n\r\nCall `generate_images()` with your query text:\r\n\r\n```python \r\nresults = bing.generate_images(\"a cat painting in Picasso style\")\r\n```\r\n\r\nThe return value contains image URLs and original prompt: \r\n\r\n```json\r\n{\r\n  \"images\": [\r\n    {\"url\": \"https://...\"}\r\n  ],\r\n  \"prompt\": \"a cat painting in Picasso style\"\r\n}\r\n```\r\n\r\n## \ud83d\udea8 Exceptions\r\n\r\n- `AuthCookieError`: Invalid authentication cookie\r\n- `PromptRejectedError`: Prompt rejected as unethical  \r\n\r\n## \ud83e\udd1d Contributing\r\n\r\nPull requests welcome! Please open an issue to discuss major changes.\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "bingart is an unofficial API wrapper for Bing Image Creator (based on DALL-E 3).",
    "version": "1.0.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/DedInc/bingart/issues",
        "Homepage": "https://github.com/DedInc/bingart"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71cb39c55d4fb526ed28122f4fd01940c9ef47f05e9152ba7f1a82ee9851de41",
                "md5": "30d475033f67e88dfe8f65d470cbf958",
                "sha256": "504a015f56c92105f382620989d922cbc2449a26cbf1a037cc712cde4067a555"
            },
            "downloads": -1,
            "filename": "bingart-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30d475033f67e88dfe8f65d470cbf958",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 4885,
            "upload_time": "2024-01-26T18:53:08",
            "upload_time_iso_8601": "2024-01-26T18:53:08.658314Z",
            "url": "https://files.pythonhosted.org/packages/71/cb/39c55d4fb526ed28122f4fd01940c9ef47f05e9152ba7f1a82ee9851de41/bingart-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c42507fe1d428aba05ee5b899eca835d37276c152f8112b6ac7a0dd43700a647",
                "md5": "7dfe9af7d8652c01de355f775dfe86fd",
                "sha256": "e4b2a9027496431fd01ab0a14ad3d1b1342beea837b513be9153c918984d698b"
            },
            "downloads": -1,
            "filename": "bingart-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "7dfe9af7d8652c01de355f775dfe86fd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 4691,
            "upload_time": "2024-01-26T18:53:09",
            "upload_time_iso_8601": "2024-01-26T18:53:09.926444Z",
            "url": "https://files.pythonhosted.org/packages/c4/25/07fe1d428aba05ee5b899eca835d37276c152f8112b6ac7a0dd43700a647/bingart-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-26 18:53:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DedInc",
    "github_project": "bingart",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "bingart"
}
        
Elapsed time: 1.63673s