| OLD | NEW |
| 1 python-abp | 1 python-abp |
| 2 ========== | 2 ========== |
| 3 | 3 |
| 4 This repository contains a library for working with Adblock Plus filter lists, | 4 This repository contains a library for working with Adblock Plus filter lists, |
| 5 a script for rendering diffs between filter lists, and the script that is used | 5 a script for rendering diffs between filter lists, and the script that is used |
| 6 for building Adblock Plus filter lists from the form in which they are authored | 6 for building Adblock Plus filter lists from the form in which they are authored |
| 7 into the format suitable for consumption by the adblocking software (aka | 7 into the format suitable for consumption by the adblocking software (aka |
| 8 rendering). | 8 rendering). |
| 9 | 9 |
| 10 .. contents:: | 10 .. contents:: |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 instantiate (such as exceptions). | 208 instantiate (such as exceptions). |
| 209 | 209 |
| 210 | 210 |
| 211 Using the library with R | 211 Using the library with R |
| 212 ------------------------ | 212 ------------------------ |
| 213 | 213 |
| 214 Clone the repo to your local machine. Then create a virtualenv and install | 214 Clone the repo to your local machine. Then create a virtualenv and install |
| 215 python-abp there:: | 215 python-abp there:: |
| 216 | 216 |
| 217 $ cd python-abp | 217 $ cd python-abp |
| 218 $ virtualenv env | 218 $ virtualenv venv |
| 219 $ source venv/bin/activate |
| 219 $ pip install --upgrade . | 220 $ pip install --upgrade . |
| 220 | 221 |
| 221 | 222 |
| 222 Then import it with ``reticulate`` in R: | 223 Then import it with ``reticulate`` in R: |
| 223 | 224 |
| 224 .. code-block:: R | 225 .. code-block:: R |
| 225 | 226 |
| 226 > library(reticulate) | 227 > library(reticulate) |
| 227 > use_virtualenv("~/python-abp/env", required=TRUE) | 228 > use_virtualenv("~/python-abp/env", required=TRUE) |
| 228 > abp <- import("abp.filters.rpy") | 229 > abp <- import("abp.filters.rpy") |
| 229 | 230 |
| 230 Now you can use the functions with ``abp$functionname``, e.g. | 231 Now you can use the functions with ``abp$functionname``, e.g. |
| 231 ``abp.line2dict("@@||g.doubleclick.net/pagead/$subdocument,domain=hon30.org")``. | 232 ``abp.line2dict("@@||g.doubleclick.net/pagead/$subdocument,domain=hon30.org")``. |
| 233 |
| 234 |
| 235 When you are finished, deactivate the virtualenv and delete it:: |
| 236 |
| 237 $ deactivate |
| 238 $ rm -r venv/ |
| OLD | NEW |