<commit_before># pycookiecheat

Borrow cookies from your browser's authenticated session for use in Python scripts.

*   Free software: GPLv3
*   Documentation: http://n8h.me/HufI1w


## Installation

### PyPI
* Unsupported (yet)

### GitHub
1. `git clone -b python2 https://github.com/dani14-96/pycookiecheat.git` (change user after PR)
2. `cd pycookiecheat`
3. `python setup.py install`


## Usage
```python
from pycookiecheat import chrome_cookies
import requests

url = 'http://example.com/fake.html'

cookies = chrome_cookies(url) ## Platform's default filepath.
r = requests.get(url, cookies=cookies)
```

Use the `cookie_file` keyword-argument to specify a different filepath for the
cookies-file: `chrome_cookies(url, cookie_file=/abspath/to/cookies)`

## Features
*  Returns decrypted cookies from Google Chrome on OSX or Linux.

## FAQ
### How about Windows?
I don't use Windows or have a PC, so I won't be adding support myself. Feel free to make a PR :)
<commit_msg>Updated now with Python2 support<commit_after># pycookiecheat

Borrow cookies from your browser's authenticated session for use in Python scripts.

-   Free software: GPLv3
-   Documentation: http://n8h.me/HufI1w


## Installation
**NB:** Use `pip` and `python` instead of `pip3` and `python3` if you're still on Python 2.

### PyPI
- `pip3 install pycookiecheat`

### GitHub
1. `git clone https://github.com/n8henrie/pycookiecheat.git`
2. `cd pycookiecheat`
3. `python3 setup.py install`


## Usage
```python
from pycookiecheat import chrome_cookies
import requests

url = 'http://example.com/fake.html'

# Uses Chrome's default cookies filepath by default
cookies = chrome_cookies(url)
r = requests.get(url, cookies=cookies)
```

Use the `cookie_file` keyword-argument to specify a different filepath for the
cookies-file: `chrome_cookies(url, cookie_file='/abspath/to/cookies')`

## Features
-  Returns decrypted cookies from Google Chrome on OSX or Linux.

## FAQ
### How about Windows?
I don't use Windows or have a PC, so I won't be adding support myself. Feel free to make a PR :)

{'fraction_non_alphanumeric': 0.10890609874152953, 'fraction_numerical': 0.011616650532429816, 'mean_word_length': 4.556451612903226, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '32963', 'n_tokens_mistral': 703, 'n_tokens_neox': 653, 'n_words': 237}