# 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/b6/1e/105b87af1b928c2262ce4b10070b76c0b77a05cc93e53be7ac5eb2f1052b/py_cozi-1.0.4.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.4",
"project_urls": {
"Homepage": "https://github.com/Wetzel402/py-cozi"
},
"split_keywords": [
"unoffical",
"cozi",
"api"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2bccaaca9f5cfa6b675c3f6297577fc6d7385031ee76048699d026cbecfdfd93",
"md5": "d175cd94bd08bdd1834c6a8b1f595566",
"sha256": "eee345a37c7607de2a065a7296c8f4cf35d7dc7947a8bcbaed5c2e1c0bdd62a2"
},
"downloads": -1,
"filename": "py_cozi-1.0.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d175cd94bd08bdd1834c6a8b1f595566",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 5939,
"upload_time": "2024-07-10T16:46:25",
"upload_time_iso_8601": "2024-07-10T16:46:25.914494Z",
"url": "https://files.pythonhosted.org/packages/2b/cc/aaca9f5cfa6b675c3f6297577fc6d7385031ee76048699d026cbecfdfd93/py_cozi-1.0.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b61e105b87af1b928c2262ce4b10070b76c0b77a05cc93e53be7ac5eb2f1052b",
"md5": "c7afbcb355e2dbea1d5dc04ca247066a",
"sha256": "a254df3d5b452db32334d043241e8af9ef294687f14a7c428336d369c931fc88"
},
"downloads": -1,
"filename": "py_cozi-1.0.4.tar.gz",
"has_sig": false,
"md5_digest": "c7afbcb355e2dbea1d5dc04ca247066a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.5",
"size": 6616,
"upload_time": "2024-07-10T16:46:27",
"upload_time_iso_8601": "2024-07-10T16:46:27.350726Z",
"url": "https://files.pythonhosted.org/packages/b6/1e/105b87af1b928c2262ce4b10070b76c0b77a05cc93e53be7ac5eb2f1052b/py_cozi-1.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-10 16:46:27",
"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"
}