<commit_before>PyLiquidPlanner
===============

Python wrapper for the Liquid Planner REST API.

The code is inspired by [PyXero](http://github.com/freakboy3742/pyxero), and aims to offer an ORM style of accessing the API.

## Installation

At present, the library is not available in PyPI but can be installed from GitHub:

```
pip install git+git://github.com/impulse-cloud/pyliquidplanner.git
```

Alternatively, if you don't have Git installed:

```
pip install --upgrade https://github.com/impulse-cloud/pyliquidplanner/tarball/master
```

## Quickstart:

In addition to the instructions shown here, you will need to follow the [Liquid Planner API Guide](http://www.liquidplanner.com/assets/api/liquidplanner_API.pdf) and the [Types Documentation](https://app.liquidplanner.com/api/help/types) to see which fields are available.

Use your Liquid Planner login to construct some credentials:

```python
>>> from liquidplanner.auth import BasicCredentials
>>> credentials = BasicCredentials(<email>, <password>)
```

Then create an API instance:

```python
>>> from liquidplanner import LiquidPlanner
>>> lp = LiquidPlanner(credentials)
```

You can then access the various types of entities by name. For example, here is a list of all the projects in your workspace:

```python
>>> projects = lp.projects.all()
>>> for p in projects:
>>>     print p['name']
```

## Workspaces

With the exception of `account` and `workspaces`, all other entities require a workspace to be specified. When instantiated, the API requests a list of available workspaces and defaults to the first returned. You can disable this check by passing the `use_first_workspace` argument.

```python
>>> lp = LiquidPlanner(credentials, use_first_workspace=False)
```

You must then set the API's `workspace_id` manually.

```python
>>> workspaces = lp.workspaces.all()
>>> lp.workspace_id = workspaces[1]['id']
```

## Using the API

The following entities are supported at present:

* Account
* Workspaces
* Clients
* Projects
* Tasks

### Reading

This library wraps the objects returned in a `dict` like object. This is done so that related
items can be accessed via the objects returned (see [Associated Objects](#associated-objects) below). Otherwise the data is returned as-is, except for dates which are converted into Python `datetime.datetime` objects. 

Use `all()` to get a full list of entities.

```python
>>> all_clients = lp.clients.all()
```
Most API options are supported, including:<commit_msg>Update README.md - Supported entity list<commit_after>PyLiquidPlanner
===============

Python wrapper for the Liquid Planner REST API.

The code is inspired by [PyXero](http://github.com/freakboy3742/pyxero), and aims to offer an ORM style of accessing the API.

## Installation

At present, the library is not available in PyPI but can be installed from GitHub:

```
pip install git+git://github.com/impulse-cloud/pyliquidplanner.git
```

Alternatively, if you don't have Git installed:

```
pip install --upgrade https://github.com/impulse-cloud/pyliquidplanner/tarball/master
```

## Quickstart:

In addition to the instructions shown here, you will need to follow the [Liquid Planner API Guide](http://www.liquidplanner.com/assets/api/liquidplanner_API.pdf) and the [Types Documentation](https://app.liquidplanner.com/api/help/types) to see which fields are available.

Use your Liquid Planner login to construct some credentials:

```python
>>> from liquidplanner.auth import BasicCredentials
>>> credentials = BasicCredentials(<email>, <password>)
```

Then create an API instance:

```python
>>> from liquidplanner import LiquidPlanner
>>> lp = LiquidPlanner(credentials)
```

You can then access the various types of entities by name. For example, here is a list of all the projects in your workspace:

```python
>>> projects = lp.projects.all()
>>> for p in projects:
>>>     print p['name']
```

## Workspaces

With the exception of `account` and `workspaces`, all other entities require a workspace to be specified. When instantiated, the API requests a list of available workspaces and defaults to the first returned. You can disable this check by passing the `use_first_workspace` argument.

```python
>>> lp = LiquidPlanner(credentials, use_first_workspace=False)
```

You must then set the API's `workspace_id` manually.

```python
>>> workspaces = lp.workspaces.all()
>>> lp.workspace_id = workspaces[1]['id']
```

## Using the API

The following entities are supported at present:

* Account
* Workspaces
* Activities
* Checklist Items
* Clients
* Comments
* Custom Fields
* Documents
* Events
* Folders
* Links
* Members
* Milestones
* Packages
* Projects
* Tags
* Tasks
* Teams
* Timesheets
* Tree Items
* Webhooks

### Reading

This library wraps the objects returned in a `dict` like object. This is done so that related
items can be accessed via the objects returned (see [Associated Objects](#associated-objects) below). Otherwise the data is returned as-is, except for dates which are converted into Python `datetime.datetime` objects. 

Use `all()` to get a full list of entities.

```python
>>> all_clients = lp.clients.all()
```
Most API options are supported, including:
{'fraction_non_alphanumeric': 0.108368684920941, 'fraction_numerical': 0.0019282684149633628, 'mean_word_length': 4.941580756013746, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 73, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3534319', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1424, 'n_words': 592}