<commit_before>#Parse

[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/kylemcc/parse) [![license](http://img.shields.io/badge/license-BSD-red.svg?style=flat)](https://raw.githubusercontent.com/kylemcc/parse/master/LICENSE)

This package provides a client for Parse's REST API. So far, it supports most of the query operations
provided by Parse's [Javascript library](https://parse.com/docs/js/symbols/Parse.Query.html), with a
few exceptions (listed below under TODO).

###Installation

    go get github.com/kylemcc/parse

###Documentation
[Full documentation](http://godoc.org/github.com/kylemcc/parse) is provided by [godoc.org](http://godoc.org)

###Usage:
```go
package main

import (
    "fmt"
	"time"
    
    "github.com/kylemcc/parse"
)

func main() {
    parse.Initialize("APP_ID", "REST_KEY", "MASTER_KEY") // master key is optional
    
    user := parse.User{}
    q, err := parse.NewQuery(&user)
	if err != nil {
		panic(err)
	}
    q.EqualTo("email", "<EMAIL>")
    q.GreaterThan("numFollowers", 10).OrderBy("-createdAt") // API is chainable
    err := q.First()
    if err != nil {
        if pe, ok := err.(parse.ParseError); ok {
            fmt.Printf("Error querying parse: %d - %s\n", pe.Code(), pe.Message())
        }
    }
    
    fmt.Printf("Retrieved user with id: %s\n", u.Id)

	q2, _ := parse.NewQuery(&parse.User{})
	q2.GreaterThan("createdAt", time.Date(2014, 01, 01, 0, 0, 0, 0, time.UTC))
	rc := make(chan *parse.User)
	ec := make(chan error)

	// .Each will retrieve all results for a query and send them to the provided channel
	q2.Each(rc, ec)
	for {
		select {
		case u, ok := <-rc:
			if ok {
				fmt.Printf("received user: %v\n", u)
			} else {
				rc = nil
			}
		case err, ok := <-ec:
			if ok {
				fmt.Printf("error: %v\n", err)
			} else {
				ec = nil
			}
		}
		if rc == nil && ec == nil {
			break
		}
	}
}
```

###TODO
- Missing query operations
	- Related to
- Missing CRUD operations:
    - Update
		- Field ops (__op):
			- AddRelation
			- RemoveRelation
- Roles
- Cloud Functions
- Background Jobs
- Push Notifications
- Analytics
- File upload/retrieval<commit_msg>add todo - batch operations<commit_after>#Parse

[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/kylemcc/parse) [![license](http://img.shields.io/badge/license-BSD-red.svg?style=flat)](https://raw.githubusercontent.com/kylemcc/parse/master/LICENSE)

This package provides a client for Parse's REST API. So far, it supports most of the query operations
provided by Parse's [Javascript library](https://parse.com/docs/js/symbols/Parse.Query.html), with a
few exceptions (listed below under TODO).

###Installation

    go get github.com/kylemcc/parse

###Documentation
[Full documentation](http://godoc.org/github.com/kylemcc/parse) is provided by [godoc.org](http://godoc.org)

###Usage:
```go
package main

import (
    "fmt"
	"time"
    
    "github.com/kylemcc/parse"
)

func main() {
    parse.Initialize("APP_ID", "REST_KEY", "MASTER_KEY") // master key is optional
    
    user := parse.User{}
    q, err := parse.NewQuery(&user)
	if err != nil {
		panic(err)
	}
    q.EqualTo("email", "<EMAIL>")
    q.GreaterThan("numFollowers", 10).OrderBy("-createdAt") // API is chainable
    err := q.First()
    if err != nil {
        if pe, ok := err.(parse.ParseError); ok {
            fmt.Printf("Error querying parse: %d - %s\n", pe.Code(), pe.Message())
        }
    }
    
    fmt.Printf("Retrieved user with id: %s\n", u.Id)

	q2, _ := parse.NewQuery(&parse.User{})
	q2.GreaterThan("createdAt", time.Date(2014, 01, 01, 0, 0, 0, 0, time.UTC))
	rc := make(chan *parse.User)
	ec := make(chan error)

	// .Each will retrieve all results for a query and send them to the provided channel
	q2.Each(rc, ec)
	for {
		select {
		case u, ok := <-rc:
			if ok {
				fmt.Printf("received user: %v\n", u)
			} else {
				rc = nil
			}
		case err, ok := <-ec:
			if ok {
				fmt.Printf("error: %v\n", err)
			} else {
				ec = nil
			}
		}
		if rc == nil && ec == nil {
			break
		}
	}
}
```

###TODO
- Missing query operations
	- Related to
- Missing CRUD operations:
    - Update
		- Field ops (__op):
			- AddRelation
			- RemoveRelation
- Roles
- Cloud Functions
- Background Jobs
- Push Notifications
- Analytics
- File upload/retrieval
- Batch operations
{'fraction_non_alphanumeric': 0.16419612314709237, 'fraction_numerical': 0.007753705815279362, 'mean_word_length': 3.0164835164835164, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, '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': '7258728', 'n_tokens_mistral': 1708, 'n_tokens_neox': 1565, 'n_words': 390}