<commit_before>GFWList2PAC
===========

[![PyPI version]][PyPI] [![Build Status]][Travis CI]

Generate fast PAC file from gfwlist. Examples: [fast mode] / [precise mode].

Fast mode: use O(1) domain lookup

Precise mode: use adblock plus engine


### Usage

    pip install gfwlist2pac
    
    usage: gfwlist2pac [-h] [-i GFWLIST] -f PAC -p PROXY [--user-rule USER_RULE]
                   [--precise]

    optional arguments:
      -h, --help            show this help message and exit
      -i GFWLIST, --input GFWLIST
                            path to gfwlist
      -f PAC, --file PAC    path to output pac
      -p PROXY, --proxy PROXY
                            the proxy parameter in the pac file, for example,
                            "SOCKS5 127.0.0.1:1080;"
      --user-rule USER_RULE
                            user rule file, which will be appended to gfwlist
      --precise             use adblock plus algorithm instead of O(1) lookup

### Performance

The PAC generated by GFWList2PAC is 1600x faster than SwitchySharp.

    Testing fast mode pac generated by gfwlist2pac
    avg: 0.49us

    Testing precise mode pac generated by gfwlist2pac
    avg: 1.53us

    Testing pac generated by switchysharp
    avg: 784.60us

[Build Status]: https://img.shields.io/travis/clowwindy/gfwlist2pac/master.svg?style=flat
[Travis CI]:    https://travis-ci.org/clowwindy/gfwlist2pac
[PyPI]:         https://pypi.python.org/pypi/gfwlist2pac
[PyPI version]: https://img.shields.io/pypi/v/gfwlist2pac.svg?style=flat
[fast mode]:    https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy.pac
[precise mode]: https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy_abp.pac<commit_msg>add coverage badge<commit_after>GFWList2PAC
===========

[![PyPI version]][PyPI]
[![Build Status]][Travis CI]
[![Coverage Status]][Coverage]

Generate fast PAC file from gfwlist. Examples: [fast mode] / [precise mode].

Fast mode: use O(1) domain lookup

Precise mode: use adblock plus engine


### Usage

    pip install gfwlist2pac
    
    usage: gfwlist2pac [-h] [-i GFWLIST] -f PAC -p PROXY [--user-rule USER_RULE]
                   [--precise]

    optional arguments:
      -h, --help            show this help message and exit
      -i GFWLIST, --input GFWLIST
                            path to gfwlist
      -f PAC, --file PAC    path to output pac
      -p PROXY, --proxy PROXY
                            the proxy parameter in the pac file, for example,
                            "SOCKS5 127.0.0.1:1080;"
      --user-rule USER_RULE
                            user rule file, which will be appended to gfwlist
      --precise             use adblock plus algorithm instead of O(1) lookup

### Performance

The PAC generated by GFWList2PAC is 1600x faster than SwitchySharp.

    Testing fast mode pac generated by gfwlist2pac
    avg: 0.49us

    Testing precise mode pac generated by gfwlist2pac
    avg: 1.53us

    Testing pac generated by switchysharp
    avg: 784.60us

[Build Status]:    https://img.shields.io/travis/clowwindy/gfwlist2pac/master.svg?style=flat
[Coverage Status]: http://172.16.17.32/result/gfwlist2pac
[Coverage]:        http://172.16.17.32/job/gfwlist2pac/ws/htmlcov/index.html
[Travis CI]:       https://travis-ci.org/clowwindy/gfwlist2pac
[PyPI]:            https://pypi.python.org/pypi/gfwlist2pac
[PyPI version]:    https://img.shields.io/pypi/v/gfwlist2pac.svg?style=flat
[fast mode]:       https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy.pac
[precise mode]:    https://github.com/clowwindy/gfwlist2pac/blob/master/test/proxy_abp.pac
{'fraction_non_alphanumeric': 0.110124826629681, 'fraction_numerical': 0.027739251040221916, 'mean_word_length': 2.373246024321796, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '4766103', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1188, 'n_words': 324}