py-cozi


Namepy-cozi JSON
Version 1.0.3 PyPI version JSON
download
home_pagehttps://github.com/Wetzel402/py-cozi
SummaryCozi Unofficial Python Package
upload_time2024-04-22 19:22:00
maintainerNone
docs_urlNone
authorCody Wetzel
requires_python>=3.5
licenseMIT
keywords unoffical cozi api
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # py-cozi

## Table of Contents
- [Introduction](#introduction)
- [Installation](#installation)
- [Usage](#usage)
- [Methods](#methods)
- [Exceptions](#exceptions)

<a name="introduction"></a>
## Introduction

Unofficial python wrapper for the Cozi API. This library requires `Python >=3.5`.

<a name="installation"></a>
## Installation

```bash
pip install py-cozi
```

<a name="usage"></a>
## Usage

```
import asyncio
from cozi import Cozi

username = ''
password = ''

cozi = Cozi(username, password)
asyncio.run(cozi.login())

get_lists = asyncio.run(cozi.get_lists())
print(get_lists)
```

<a name="methods"></a>
## Methods
```def login()```

Logs into Cozi.

---

```def get_lists()```

Gets all of your lists.

---

```def add_list(list_title, list_type)```

Adds a new list.

| Parameter   | Type        | Description           |
| :---        |    :---     |                  :--- |
| list_title  | string      | Title of your list    |
| list_type   | string      | 'todo' or 'shopping'  |

---

```def remove_list(list_id)```

Removes a list.

| Parameter   | Type        | Description           |
| :---        |    :---     |                  :--- |
| list_id     | string      | Cozi list id          |

---

```def reorder_list(list_id, list_title, items_list, list_type)```

Reorders a list.

| Parameter   | Type        | Description                |
| :---        |    :---     |                       :--- |
| list_id     | string      | Cozi list id               |
| list_title  | string      | Title or name of your list |
| items_list  | list        | List of JSON Cozi items    |
| list_type   | string      | 'todo' or 'shopping'       |

---

```def add_item(list_id, item_text, item_pos)```

Adds an item to a list.

| Parameter   | Type        | Description                      |
| :---        |    :---     |                             :--- |
| list_id     | string      | Cozi list id                     |
| item_text   | string      | Title or name of your item       |
| item_pos    | int         | Array index position of the item |

---

```def edit_item(list_id, item_id, item_text)```

Edits an item in a list.

| Parameter   | Type        | Description                |
| :---        |    :---     |                       :--- |
| list_id     | string      | Cozi list id               |
| item_id     | string      | Cozi item id               |
| item_text   | string      | Title or name of your item |

---

```def mark_item(list_id, item_id, item_status)```

Checks or completes and item in a list.

| Parameter   | Type        | Description                |
| :---        |    :---     |                       :--- |
| list_id     | string      | Cozi list id               |
| item_id     | string      | Cozi item id               |
| item_status | string      | 'complete' or 'incomplete' |

---

```def remove_items(list_id, items_list)```

Removes item(s) from a list.

| Parameter   | Type        | Description                |
| :---        |    :---     |                       :--- |
| list_id     | string      | Cozi list id               |
| items_list  | list        | List of Cozi item IDs      |

---

```def get_calendar(year, month)```

Gets calendar appointments for a given year and month. 

| Parameter   | Type        | Description |
| :---        |    :---     |        :--- |
| year        | int         | Year        |
| month       | int         | Month       |

---

```def add_appointment(year, month, day, start, end, date_span, attendees, location, notes, subject)```

Adds a new calendar appointment.  

| Parameter   | Type        | Description                          |
| :---        |    :---     |                                 :--- |
| year        | int         | Year                                 |
| month       | int         | Month                                |
| day         | int         | Day                                  |
| start       | string      | Start time in 24 hour format `08:00` |
| end         | string      | End time in 24 hour format `21:00`   |
| date_span   | int         | Days the appointment spans           |
| attendees   | list        | List of Cozi person IDs              |
| location    | string      | Location of the appointment          |
| notes       | string      | Notes for the appointment            |
| subject     | string      | The title or name of the appointment |

---

```def edit_appointment(appt_id, year, month, day, start, end, date_span, attendees, location, notes, subject)```

Edits a calendar appointment.  

| Parameter   | Type        | Description                          |
| :---        |    :---     |                                 :--- |
| appt_id     | string      | Cozi appointment ID                  |
| year        | int         | Year                                 |
| month       | int         | Month                                |
| day         | int         | Day                                  |
| start       | string      | Start time in 24 hour format `08:00` |
| end         | string      | End time in 24 hour format `21:00`   |
| date_span   | int         | Days the appointment spans           |
| attendees   | list        | List of Cozi person IDs              |
| location    | string      | Location of the appointment          |
| notes       | string      | Notes for the appointment            |
| subject     | string      | The title or name of the appointment |

---

```def remove_appointment(year, month, appt_id)```

Removes a calendar appointment.  

| Parameter   | Type        | Description                          |
| :---        |    :---     |                                 :--- |
| year        | int         | Year                                 |
| month       | int         | Month                                |
| appt_id     | string      | Cozi appointment ID                  |

<a name="exceptions"></a>
## Exceptions

```CoziException```

---

```InvalidLoginException``` 

Thrown when login fails.

---

```RequestException```

Thrown when the connection is reset.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Wetzel402/py-cozi",
    "name": "py-cozi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.5",
    "maintainer_email": null,
    "keywords": "unoffical Cozi api",
    "author": "Cody Wetzel",
    "author_email": "wetzelredistribution@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/43/c7/20d6ad285d94af2de07a6c4af253fd460b53327bb09d9e71b0b27bdff287/py_cozi-1.0.3.tar.gz",
    "platform": null,
    "description": "# py-cozi\n\n## Table of Contents\n- [Introduction](#introduction)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Methods](#methods)\n- [Exceptions](#exceptions)\n\n<a name=\"introduction\"></a>\n## Introduction\n\nUnofficial python wrapper for the Cozi API. This library requires `Python >=3.5`.\n\n<a name=\"installation\"></a>\n## Installation\n\n```bash\npip install py-cozi\n```\n\n<a name=\"usage\"></a>\n## Usage\n\n```\nimport asyncio\nfrom cozi import Cozi\n\nusername = ''\npassword = ''\n\ncozi = Cozi(username, password)\nasyncio.run(cozi.login())\n\nget_lists = asyncio.run(cozi.get_lists())\nprint(get_lists)\n```\n\n<a name=\"methods\"></a>\n## Methods\n```def login()```\n\nLogs into Cozi.\n\n---\n\n```def get_lists()```\n\nGets all of your lists.\n\n---\n\n```def add_list(list_title, list_type)```\n\nAdds a new list.\n\n| Parameter   | Type        | Description           |\n| :---        |    :---     |                  :--- |\n| list_title  | string      | Title of your list    |\n| list_type   | string      | 'todo' or 'shopping'  |\n\n---\n\n```def remove_list(list_id)```\n\nRemoves a list.\n\n| Parameter   | Type        | Description           |\n| :---        |    :---     |                  :--- |\n| list_id     | string      | Cozi list id          |\n\n---\n\n```def reorder_list(list_id, list_title, items_list, list_type)```\n\nReorders a list.\n\n| Parameter   | Type        | Description                |\n| :---        |    :---     |                       :--- |\n| list_id     | string      | Cozi list id               |\n| list_title  | string      | Title or name of your list |\n| items_list  | list        | List of JSON Cozi items    |\n| list_type   | string      | 'todo' or 'shopping'       |\n\n---\n\n```def add_item(list_id, item_text, item_pos)```\n\nAdds an item to a list.\n\n| Parameter   | Type        | Description                      |\n| :---        |    :---     |                             :--- |\n| list_id     | string      | Cozi list id                     |\n| item_text   | string      | Title or name of your item       |\n| item_pos    | int         | Array index position of the item |\n\n---\n\n```def edit_item(list_id, item_id, item_text)```\n\nEdits an item in a list.\n\n| Parameter   | Type        | Description                |\n| :---        |    :---     |                       :--- |\n| list_id     | string      | Cozi list id               |\n| item_id     | string      | Cozi item id               |\n| item_text   | string      | Title or name of your item |\n\n---\n\n```def mark_item(list_id, item_id, item_status)```\n\nChecks or completes and item in a list.\n\n| Parameter   | Type        | Description                |\n| :---        |    :---     |                       :--- |\n| list_id     | string      | Cozi list id               |\n| item_id     | string      | Cozi item id               |\n| item_status | string      | 'complete' or 'incomplete' |\n\n---\n\n```def remove_items(list_id, items_list)```\n\nRemoves item(s) from a list.\n\n| Parameter   | Type        | Description                |\n| :---        |    :---     |                       :--- |\n| list_id     | string      | Cozi list id               |\n| items_list  | list        | List of Cozi item IDs      |\n\n---\n\n```def get_calendar(year, month)```\n\nGets calendar appointments for a given year and month. \n\n| Parameter   | Type        | Description |\n| :---        |    :---     |        :--- |\n| year        | int         | Year        |\n| month       | int         | Month       |\n\n---\n\n```def add_appointment(year, month, day, start, end, date_span, attendees, location, notes, subject)```\n\nAdds a new calendar appointment.  \n\n| Parameter   | Type        | Description                          |\n| :---        |    :---     |                                 :--- |\n| year        | int         | Year                                 |\n| month       | int         | Month                                |\n| day         | int         | Day                                  |\n| start       | string      | Start time in 24 hour format `08:00` |\n| end         | string      | End time in 24 hour format `21:00`   |\n| date_span   | int         | Days the appointment spans           |\n| attendees   | list        | List of Cozi person IDs              |\n| location    | string      | Location of the appointment          |\n| notes       | string      | Notes for the appointment            |\n| subject     | string      | The title or name of the appointment |\n\n---\n\n```def edit_appointment(appt_id, year, month, day, start, end, date_span, attendees, location, notes, subject)```\n\nEdits a calendar appointment.  \n\n| Parameter   | Type        | Description                          |\n| :---        |    :---     |                                 :--- |\n| appt_id     | string      | Cozi appointment ID                  |\n| year        | int         | Year                                 |\n| month       | int         | Month                                |\n| day         | int         | Day                                  |\n| start       | string      | Start time in 24 hour format `08:00` |\n| end         | string      | End time in 24 hour format `21:00`   |\n| date_span   | int         | Days the appointment spans           |\n| attendees   | list        | List of Cozi person IDs              |\n| location    | string      | Location of the appointment          |\n| notes       | string      | Notes for the appointment            |\n| subject     | string      | The title or name of the appointment |\n\n---\n\n```def remove_appointment(year, month, appt_id)```\n\nRemoves a calendar appointment.  \n\n| Parameter   | Type        | Description                          |\n| :---        |    :---     |                                 :--- |\n| year        | int         | Year                                 |\n| month       | int         | Month                                |\n| appt_id     | string      | Cozi appointment ID                  |\n\n<a name=\"exceptions\"></a>\n## Exceptions\n\n```CoziException```\n\n---\n\n```InvalidLoginException``` \n\nThrown when login fails.\n\n---\n\n```RequestException```\n\nThrown when the connection is reset.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Cozi Unofficial Python Package",
    "version": "1.0.3",
    "project_urls": {
        "Homepage": "https://github.com/Wetzel402/py-cozi"
    },
    "split_keywords": [
        "unoffical",
        "cozi",
        "api"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0f64a5f7366193f08edafebc6f38939b9b0a5b73792b06e0e2120db0c6839bc",
                "md5": "0482d70cd8fe53d0c49a398536b062ba",
                "sha256": "833d20f3058d601270cae1502fc8b174228f176947159ef2e2ff0a68e41d3145"
            },
            "downloads": -1,
            "filename": "py_cozi-1.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0482d70cd8fe53d0c49a398536b062ba",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.5",
            "size": 5943,
            "upload_time": "2024-04-22T19:21:53",
            "upload_time_iso_8601": "2024-04-22T19:21:53.701729Z",
            "url": "https://files.pythonhosted.org/packages/b0/f6/4a5f7366193f08edafebc6f38939b9b0a5b73792b06e0e2120db0c6839bc/py_cozi-1.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "43c720d6ad285d94af2de07a6c4af253fd460b53327bb09d9e71b0b27bdff287",
                "md5": "86f92834b1b98ab00ec926fff999bfae",
                "sha256": "b57889c2f0569dfd1a9de67bc0324f2d1d1d4ae5ab3f1bef5378022f4e2f34fb"
            },
            "downloads": -1,
            "filename": "py_cozi-1.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "86f92834b1b98ab00ec926fff999bfae",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.5",
            "size": 6596,
            "upload_time": "2024-04-22T19:22:00",
            "upload_time_iso_8601": "2024-04-22T19:22:00.000986Z",
            "url": "https://files.pythonhosted.org/packages/43/c7/20d6ad285d94af2de07a6c4af253fd460b53327bb09d9e71b0b27bdff287/py_cozi-1.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-22 19:22:00",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Wetzel402",
    "github_project": "py-cozi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "py-cozi"
}
        
Elapsed time: 0.33290s