ward-labels-upload


Nameward-labels-upload JSON
Version 0.0.10 PyPI version JSON
download
home_page
SummaryAn internal package to allow for easy uploading of labels to the Ward Analytics API.
upload_time2024-03-13 21:21:49
maintainer
docs_urlNone
authorWard Analytics
requires_python
license
keywords internal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Ward Analytics Labels Upload Utility

This utility is used to upload labels to the Ward Analytics Database.

It is for internal use only.

## Installation

```bash
pip install ward-labels-upload
```

## Usage

### The Label Object

The `Label` object is used to represent a label. It has three fields:
- `address`: The address of the label.
- `label`: The label itself.
- `description`: A description of the label.

It also has a `is_address_case_sensitive` field, which defaults to `False`. This field is used to determine whether the address field should be treated as case sensitive or not. In most cases, this field should be left as `False` (For blockchains such as Ethereum, addresses are not case sensitive).

``` python
from ward_labels_upload import Label

label = Label(address="0x12eF3", label="label1", description="description1")
print(label)

>>> Label(address="0x12ef3", label="label1", description="description1", is_address_case_sensitive=False)
```

``` python
from ward_labels_upload import Label

label = Label(address="0x12eF3", label="label1", description="description1", is_address_case_sensitive=True)
print(label)

>>> Label(address="0x12eF3", label="label1", description="description1", is_address_case_sensitive=True)
```

### Label Upload

```python
from ward_labels_upload import Label, LabelUploader

uploader = LabelUploader(api_key="your_api_key")

labels = [
    Label(address="0x12ef3", label="label1", description="description1"),
    Label(address="0x45af6", label="label2", description="description2"),
    Label(address="0x78cs9", label="label3", description="description3"),
]

uploader.upload_labels(labels=labels)
```
The `LabelUploader` class also takes an optional `base_url` parameter. This is the base URL of the Ward Analytics API. It defaults to `https://api.wardanalytics.net`, which is the production API.

### Label Deletion

```python
from ward_labels_upload import Label, LabelUploader

uploader = LabelUploader(api_key="your_api_key")

labels = [
    Label(address="0x12ef3", label="label1"),
    Label(address="0x45af6", label="label2"),
    Label(address="0x78cs9", label="label3"),
]

uploader.delete_labels(labels=labels)
```
In the case of deletion, the description field is unnecessary. This happens because a label is uniquely identified by the combination of its address and label.

### Label Retrieval

```python
from ward_labels_upload import Label, LabelUploader

uploader = LabelUploader(api_key="your_api_key")

addresses = [
    "0x12ef3",
    "0x45af6",
    "0x78cs9",
]

labels = uploader.get_labels(addresses=addresses)
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "ward-labels-upload",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Internal",
    "author": "Ward Analytics",
    "author_email": "<gabriel.vieira@vdspar.com>",
    "download_url": "https://files.pythonhosted.org/packages/c8/9c/57f71f995b1bd0289c25813d27e62c1688856482f14dcff0cc7b5ececeff/ward-labels-upload-0.0.10.tar.gz",
    "platform": null,
    "description": "\n# Ward Analytics Labels Upload Utility\n\nThis utility is used to upload labels to the Ward Analytics Database.\n\nIt is for internal use only.\n\n## Installation\n\n```bash\npip install ward-labels-upload\n```\n\n## Usage\n\n### The Label Object\n\nThe `Label` object is used to represent a label. It has three fields:\n- `address`: The address of the label.\n- `label`: The label itself.\n- `description`: A description of the label.\n\nIt also has a `is_address_case_sensitive` field, which defaults to `False`. This field is used to determine whether the address field should be treated as case sensitive or not. In most cases, this field should be left as `False` (For blockchains such as Ethereum, addresses are not case sensitive).\n\n``` python\nfrom ward_labels_upload import Label\n\nlabel = Label(address=\"0x12eF3\", label=\"label1\", description=\"description1\")\nprint(label)\n\n>>> Label(address=\"0x12ef3\", label=\"label1\", description=\"description1\", is_address_case_sensitive=False)\n```\n\n``` python\nfrom ward_labels_upload import Label\n\nlabel = Label(address=\"0x12eF3\", label=\"label1\", description=\"description1\", is_address_case_sensitive=True)\nprint(label)\n\n>>> Label(address=\"0x12eF3\", label=\"label1\", description=\"description1\", is_address_case_sensitive=True)\n```\n\n### Label Upload\n\n```python\nfrom ward_labels_upload import Label, LabelUploader\n\nuploader = LabelUploader(api_key=\"your_api_key\")\n\nlabels = [\n    Label(address=\"0x12ef3\", label=\"label1\", description=\"description1\"),\n    Label(address=\"0x45af6\", label=\"label2\", description=\"description2\"),\n    Label(address=\"0x78cs9\", label=\"label3\", description=\"description3\"),\n]\n\nuploader.upload_labels(labels=labels)\n```\nThe `LabelUploader` class also takes an optional `base_url` parameter. This is the base URL of the Ward Analytics API. It defaults to `https://api.wardanalytics.net`, which is the production API.\n\n### Label Deletion\n\n```python\nfrom ward_labels_upload import Label, LabelUploader\n\nuploader = LabelUploader(api_key=\"your_api_key\")\n\nlabels = [\n    Label(address=\"0x12ef3\", label=\"label1\"),\n    Label(address=\"0x45af6\", label=\"label2\"),\n    Label(address=\"0x78cs9\", label=\"label3\"),\n]\n\nuploader.delete_labels(labels=labels)\n```\nIn the case of deletion, the description field is unnecessary. This happens because a label is uniquely identified by the combination of its address and label.\n\n### Label Retrieval\n\n```python\nfrom ward_labels_upload import Label, LabelUploader\n\nuploader = LabelUploader(api_key=\"your_api_key\")\n\naddresses = [\n    \"0x12ef3\",\n    \"0x45af6\",\n    \"0x78cs9\",\n]\n\nlabels = uploader.get_labels(addresses=addresses)\n```\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "An internal package to allow for easy uploading of labels to the Ward Analytics API.",
    "version": "0.0.10",
    "project_urls": null,
    "split_keywords": [
        "internal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e010e9edeb62b673a9250a5956f5c9ed133f6c2d72aa2e82b57a8c52111be717",
                "md5": "d2db95ddc1a10dc37a37a0f8e38fb65d",
                "sha256": "559f2e3aaf3a9a4220c655459d65bea7a7c3ea8867e0904cb443fbd6eed57ab1"
            },
            "downloads": -1,
            "filename": "ward_labels_upload-0.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d2db95ddc1a10dc37a37a0f8e38fb65d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5123,
            "upload_time": "2024-03-13T21:21:48",
            "upload_time_iso_8601": "2024-03-13T21:21:48.075867Z",
            "url": "https://files.pythonhosted.org/packages/e0/10/e9edeb62b673a9250a5956f5c9ed133f6c2d72aa2e82b57a8c52111be717/ward_labels_upload-0.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c89c57f71f995b1bd0289c25813d27e62c1688856482f14dcff0cc7b5ececeff",
                "md5": "13209803c1c231141a1f02380c5d4934",
                "sha256": "15ede5d4f9be76d2eee8c12e45f05b5efeb85a5014e19e68b8f694ab803eacf3"
            },
            "downloads": -1,
            "filename": "ward-labels-upload-0.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "13209803c1c231141a1f02380c5d4934",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4186,
            "upload_time": "2024-03-13T21:21:49",
            "upload_time_iso_8601": "2024-03-13T21:21:49.686559Z",
            "url": "https://files.pythonhosted.org/packages/c8/9c/57f71f995b1bd0289c25813d27e62c1688856482f14dcff0cc7b5ececeff/ward-labels-upload-0.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-13 21:21:49",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "ward-labels-upload"
}
        
Elapsed time: 0.22359s