Metadata-Version: 2.4
Name: educabiz
Version: 0.0.6
Summary: API client for *.educabiz.com 
Author-email: Filipe Pina <shelf-corncob-said@duck.com>
Project-URL: Homepage, https://github.com/fopina/python-educabiz
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: pydantic
Dynamic: license-file

# python-educabiz

API client to interact with [educabiz.com](https://www.educabiz.com) portals.

## Install

```
pip install educabiz
```

## Usage

### Using multiple schools  
Educabiz does not provide a way to choose the school during login, matching the
behavior of the Educabiz mobile app.  

The portal redirects to the right school
based on the unique email/password combination, so when using multiple schools
with the same email address, use the password associated with the intended
school. If the same password is currently used for multiple schools, log in to
the first school that opens and change the password there.  

The old password will then redirect to the other school.

### Example

```python
from educabiz.client import Client

eb_client = Client(username, password, login_if_required=True)
data = eb_client.home()
print(f'School: {data["schoolname"]}')
children = eb_client.school_qrcodeinfo()['child']
for child in children.values():
    child_id = child['id']
    home_data = data['children'][child_id]
    print(f'{child_id}:')
    print(f'* Name: {html.unescape(child["name"])}')
    print(f'* Photo URL: {home_data["photo"]}')
    presence = child['presence'][0]
    if presence['id'] == 'undefined':
        presence_str = '(none)'
    elif presence['absent']:
        presence_str = f'absent ({presence["notes"]})'
    elif presence['hourOut'] == '--:--':
        presence_str = f'checked in at {presence["hourIn"]}'
    else:
        presence_str = f'checked in at {presence["hourIn"]} and out at {presence["hourOut"]}'
    print(f'* Presence: {presence_str}')
```

## Build

Check out [CONTRIBUTING.md](CONTRIBUTING.md)
