dendrite-sdk


Namedendrite-sdk JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://dendrite.systems
SummaryDendrite is a suite of tools that makes it easy to create web integrations for AI agents. With Dendrite your can: Authenticate on websites, Interact with elements, Extract structured data, Download and upload files, Fill out forms
upload_time2024-10-21 10:45:08
maintainerNone
docs_urlNone
authorArian Hanifi
requires_python<4.0,>=3.9
licenseNone
keywords ai agent playwright web web agents automation web extraction browser
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Website](https://img.shields.io/badge/Website-dendrite.systems-blue?style=for-the-badge&logo=google-chrome)](https://dendrite.systems)
[![Documentation](https://img.shields.io/badge/Docs-docs.dendrite.systems-orange?style=for-the-badge&logo=bookstack)](https://docs.dendrite.systems)
[![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/ETPBdXU3kx)

## What is Dendrite?

#### Dendrite is a devtool that makes it easy for AI agents to:

- 🔓 Authenticate on websites
- 👆🏼 Interact with elements
- 💿 Extract structured data
- ↕️ Download/upload files
- 🚫 Browse without getting blocked

#### A simple outlook integration

With Dendrite, it's easy to create web interaction tools for your agent.

```python
from dendrite_sdk import Dendrite

def send_email():
    client = Dendrite(auth="outlook.live.com")

    # Navigate
    client.goto(
        "https://outlook.live.com/mail/0/",
        expected_page="An email inbox"
    )

    # Create new email and populate fields
    client.click("The new email button")
    client.fill_fields({
        "Recipient": to,
        "Subject": subject,
        "Message": message
    })

    # Send email
    client.click("The send button")
```

To authenticate you'll need to use our Chrome Extension **Dendrite Vault**, you can download it [here](https://chromewebstore.google.com/detail/dendrite-vault/faflkoombjlhkgieldilpijjnblgabnn). Read more about authentication [in our docs](https://docs.dendrite.systems/examples/authentication-instagram).

## Quickstart

```
pip install dendrite-sdk && dendrite install
```

#### Simple navigation and interaction

Initialize the Dendrite client and start doing web interactions without boilerplate.

[Get your API key here](https://dendrite.systems/app)

```python
from dendrite_sdk import Dendrite

client = Dendrite(dendrite_api_key="sk...")

client.goto("https://google.com")
client.fill("Search field", "Hello world")
client.press("Enter")
```

In the example above, we simply go to Google, populate the search field with "Hello world" and simulate a keypress on Enter. It's a simple example that starts to explore the endless possibilities with Dendrite. Now you can create tools for your agents that have access to the full web without depending on APIs.

## More powerful examples

Now, let's have some fun. Earlier we showed you a simple send_email example. And sending emails is cool, but if that's all our agent can do it kind of sucks. So let's create two cooler examples.

### Download Bank Transactions

First up, a tool that allows our AI agent to download our bank's monthly transactions so that they can be analyzed and compiled into a report that can be sent to stakeholders with `send_email`.

```python
from dendrite_sdk import Dendrite

def get_transactions() -> str:
    client = Dendrite(auth="mercury.com")

    # Navigate and wait for loading
    client.goto(
      "https://app.mercury.com/transactions",
      expected_page="Dashboard with transactions"
    )
    client.wait_for("The transactions to finish loading")

    # Modify filters
    client.click("The 'add filter' button")
    client.click("The 'show transactions for' dropdown")
    client.click("The 'this month' option")

    # Download file
    client.click("The 'export filtered' button")
    transactions = client.get_download()

    # Save file locally
    path = "files/transactions.xlsx"
    transactions.save_as(path)

    return path

def analyze_transactions(path: str):
    ...
```

### Extract Google Analytics

Finally, it would be cool if we could add the amount of monthly visitors from Google Analytics to our report. We can do that by using the `extract` function:

```python
def get_visitor_count() -> int:
    client = Dendrite(auth="analytics.google.com")

    client.goto(
      "https://analytics.google.com/analytics/web",
      expected_page="Google Analytics dashboard"
    )

    # The Dendrite extract agent will create a web script that is cached
    # and reused. It will self-heal when the website updates
    visitor_count = client.extract("The amount of visitors this month", int)
    return visitor_count
```

## Documentation

[Read the full docs here](https://docs.dendrite.systems)

[Find more advanced examples in our docs.](https://docs.dendrite.systems/examples)

## Remote Browsers

When you want to scale up your AI agents, we support using browsers hosted by Browserbase. This way you can run many agents in parallel without having to worry about the infrastructure.

To start using Browserbase just swap out the `Dendrite` class with `DendriteRemoteBrowser` and add your Browserbase API key and project id, either in the code or in a `.env` file like this:

```bash
# ... previous keys
BROWSERBASE_API_KEY=
BROWSERBASE_PROJECT_ID=
```

```python
# from dendrite_sdk import Dendrite
from dendrite_sdk import DendriteRemoteBrowser

...

# client = Dendrite(...)
client = DendriteRemoteBrowser(
    # Use interchangeably with the Dendrite class
    browserbase_api_key="...", # or specify the browsebase keys in the .env file
    browserbase_project_id="..."
)

...
```


            

Raw data

            {
    "_id": null,
    "home_page": "https://dendrite.systems",
    "name": "dendrite-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": "AI agent, playwright, web, web agents, automation, web extraction, browser",
    "author": "Arian Hanifi",
    "author_email": "arian@dendrite.se",
    "download_url": "https://files.pythonhosted.org/packages/30/a0/473c1f2eb9eddbaf8cc665a9b7fb2c4af3aac8aab28406a5d1314c42804f/dendrite_sdk-0.2.2.tar.gz",
    "platform": null,
    "description": "[![Website](https://img.shields.io/badge/Website-dendrite.systems-blue?style=for-the-badge&logo=google-chrome)](https://dendrite.systems)\n[![Documentation](https://img.shields.io/badge/Docs-docs.dendrite.systems-orange?style=for-the-badge&logo=bookstack)](https://docs.dendrite.systems)\n[![Discord](https://img.shields.io/badge/Discord-Join%20Us-7289DA?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/ETPBdXU3kx)\n\n## What is Dendrite?\n\n#### Dendrite is a devtool that makes it easy for AI agents to:\n\n- \ud83d\udd13 Authenticate on websites\n- \ud83d\udc46\ud83c\udffc Interact with elements\n- \ud83d\udcbf Extract structured data\n- \u2195\ufe0f Download/upload files\n- \ud83d\udeab Browse without getting blocked\n\n#### A simple outlook integration\n\nWith Dendrite, it's easy to create web interaction tools for your agent.\n\n```python\nfrom dendrite_sdk import Dendrite\n\ndef send_email():\n    client = Dendrite(auth=\"outlook.live.com\")\n\n    # Navigate\n    client.goto(\n        \"https://outlook.live.com/mail/0/\",\n        expected_page=\"An email inbox\"\n    )\n\n    # Create new email and populate fields\n    client.click(\"The new email button\")\n    client.fill_fields({\n        \"Recipient\": to,\n        \"Subject\": subject,\n        \"Message\": message\n    })\n\n    # Send email\n    client.click(\"The send button\")\n```\n\nTo authenticate you'll need to use our Chrome Extension **Dendrite Vault**, you can download it [here](https://chromewebstore.google.com/detail/dendrite-vault/faflkoombjlhkgieldilpijjnblgabnn). Read more about authentication [in our docs](https://docs.dendrite.systems/examples/authentication-instagram).\n\n## Quickstart\n\n```\npip install dendrite-sdk && dendrite install\n```\n\n#### Simple navigation and interaction\n\nInitialize the Dendrite client and start doing web interactions without boilerplate.\n\n[Get your API key here](https://dendrite.systems/app)\n\n```python\nfrom dendrite_sdk import Dendrite\n\nclient = Dendrite(dendrite_api_key=\"sk...\")\n\nclient.goto(\"https://google.com\")\nclient.fill(\"Search field\", \"Hello world\")\nclient.press(\"Enter\")\n```\n\nIn the example above, we simply go to Google, populate the search field with \"Hello world\" and simulate a keypress on Enter. It's a simple example that starts to explore the endless possibilities with Dendrite. Now you can create tools for your agents that have access to the full web without depending on APIs.\n\n## More powerful examples\n\nNow, let's have some fun. Earlier we showed you a simple send_email example. And sending emails is cool, but if that's all our agent can do it kind of sucks. So let's create two cooler examples.\n\n### Download Bank Transactions\n\nFirst up, a tool that allows our AI agent to download our bank's monthly transactions so that they can be analyzed and compiled into a report that can be sent to stakeholders with `send_email`.\n\n```python\nfrom dendrite_sdk import Dendrite\n\ndef get_transactions() -> str:\n    client = Dendrite(auth=\"mercury.com\")\n\n    # Navigate and wait for loading\n    client.goto(\n      \"https://app.mercury.com/transactions\",\n      expected_page=\"Dashboard with transactions\"\n    )\n    client.wait_for(\"The transactions to finish loading\")\n\n    # Modify filters\n    client.click(\"The 'add filter' button\")\n    client.click(\"The 'show transactions for' dropdown\")\n    client.click(\"The 'this month' option\")\n\n    # Download file\n    client.click(\"The 'export filtered' button\")\n    transactions = client.get_download()\n\n    # Save file locally\n    path = \"files/transactions.xlsx\"\n    transactions.save_as(path)\n\n    return path\n\ndef analyze_transactions(path: str):\n    ...\n```\n\n### Extract Google Analytics\n\nFinally, it would be cool if we could add the amount of monthly visitors from Google Analytics to our report. We can do that by using the `extract` function:\n\n```python\ndef get_visitor_count() -> int:\n    client = Dendrite(auth=\"analytics.google.com\")\n\n    client.goto(\n      \"https://analytics.google.com/analytics/web\",\n      expected_page=\"Google Analytics dashboard\"\n    )\n\n    # The Dendrite extract agent will create a web script that is cached\n    # and reused. It will self-heal when the website updates\n    visitor_count = client.extract(\"The amount of visitors this month\", int)\n    return visitor_count\n```\n\n## Documentation\n\n[Read the full docs here](https://docs.dendrite.systems)\n\n[Find more advanced examples in our docs.](https://docs.dendrite.systems/examples)\n\n## Remote Browsers\n\nWhen you want to scale up your AI agents, we support using browsers hosted by Browserbase. This way you can run many agents in parallel without having to worry about the infrastructure.\n\nTo start using Browserbase just swap out the `Dendrite` class with `DendriteRemoteBrowser` and add your Browserbase API key and project id, either in the code or in a `.env` file like this:\n\n```bash\n# ... previous keys\nBROWSERBASE_API_KEY=\nBROWSERBASE_PROJECT_ID=\n```\n\n```python\n# from dendrite_sdk import Dendrite\nfrom dendrite_sdk import DendriteRemoteBrowser\n\n...\n\n# client = Dendrite(...)\nclient = DendriteRemoteBrowser(\n    # Use interchangeably with the Dendrite class\n    browserbase_api_key=\"...\", # or specify the browsebase keys in the .env file\n    browserbase_project_id=\"...\"\n)\n\n...\n```\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Dendrite is a suite of tools that makes it easy to create web integrations for AI agents. With Dendrite your can: Authenticate on websites, Interact with elements, Extract structured data, Download and upload files, Fill out forms",
    "version": "0.2.2",
    "project_urls": {
        "Documentation": "https://docs.dendrite.systems/introduction",
        "Homepage": "https://dendrite.systems",
        "Repository": "https://github.com/dendrite-systems/dendrite-python-sdk"
    },
    "split_keywords": [
        "ai agent",
        " playwright",
        " web",
        " web agents",
        " automation",
        " web extraction",
        " browser"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "df884fce2e5aac79b5be68a0019749f353dda67c39e5e54783fe56d763cfcc7a",
                "md5": "7ee927486794b929adde7d746f405c47",
                "sha256": "7ec5b11b99bb64e2f51c5243228f69cf4678b4cdc1a127d67ee50cc3251e79ad"
            },
            "downloads": -1,
            "filename": "dendrite_sdk-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7ee927486794b929adde7d746f405c47",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 115205,
            "upload_time": "2024-10-21T10:45:06",
            "upload_time_iso_8601": "2024-10-21T10:45:06.635559Z",
            "url": "https://files.pythonhosted.org/packages/df/88/4fce2e5aac79b5be68a0019749f353dda67c39e5e54783fe56d763cfcc7a/dendrite_sdk-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "30a0473c1f2eb9eddbaf8cc665a9b7fb2c4af3aac8aab28406a5d1314c42804f",
                "md5": "cf71bf7f9d30cb8951def8bd3b52ecc1",
                "sha256": "d232051e7b05b8bf5af0eb0a0f7371448e3352983dabc0479d3e228333c23d5d"
            },
            "downloads": -1,
            "filename": "dendrite_sdk-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "cf71bf7f9d30cb8951def8bd3b52ecc1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 66986,
            "upload_time": "2024-10-21T10:45:08",
            "upload_time_iso_8601": "2024-10-21T10:45:08.121069Z",
            "url": "https://files.pythonhosted.org/packages/30/a0/473c1f2eb9eddbaf8cc665a9b7fb2c4af3aac8aab28406a5d1314c42804f/dendrite_sdk-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-21 10:45:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dendrite-systems",
    "github_project": "dendrite-python-sdk",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "dendrite-sdk"
}
        
Elapsed time: 9.87240s