Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit b24a172

Browse files
author
Denys Smirnov
committed
fix the readme
Signed-off-by: Denys Smirnov <denys@sourced.tech>
1 parent c1f8aef commit b24a172

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

README.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## client-python [![Build Status](https://travis-ci.org/bblfsh/client-python.svg?branch=master)](https://travis-ci.org/bblfsh/client-python) [![PyPI](https://img.shields.io/pypi/v/bblfsh.svg)](https://pypi.python.org/pypi/bblfsh)
22

33
[Babelfish](https://doc.bblf.sh) Python client library provides functionality to both
4-
connect to the Babelfish bblfshd to parse code
4+
connect to the Babelfish daemon (`bblfshd`) to parse code
55
(obtaining an [UAST](https://doc.bblf.sh/uast/uast-specification.html) as a result)
66
and to analyse UASTs with the functionality provided by [libuast](https://github.com/bblfsh/libuast).
77

@@ -10,28 +10,27 @@ and to analyse UASTs with the functionality provided by [libuast](https://github
1010
The recommended way to install *client-python* is using our pip [package](https://pypi.python.org/pypi/bblfsh):
1111

1212
```sh
13-
pip install bblfsh
13+
pip3 install bblfsh
1414
```
1515

1616
### From sources
1717

1818
```bash
1919
git clone https://github.com/bblfsh/client-python.git
2020
cd client-python
21-
pip install -r requirements.txt
22-
python setup.py --getdeps
23-
python setup.py install
24-
# or: pip install .
21+
pip3 install -r requirements.txt
22+
python3 setup.py --getdeps
23+
python3 setup.py install
24+
# or: pip3 install .
2525
```
2626

2727
### Dependencies
2828

29-
You also will need a `curl` cli tool to dowload `libuast`, and a `g++` for building [libtuast Python bindings](https://github.com/bblfsh/client-python/blob/0037d762563ab49b3daac8a7577f7103a5628fc6/setup.py#L17).
29+
You also will need a `curl` cli tool to dowload `libuast`, and a `g++` for building [libuast Python bindings](https://github.com/bblfsh/client-python/blob/0037d762563ab49b3daac8a7577f7103a5628fc6/setup.py#L17).
3030
The command for Debian and derived distributions would be:
3131

3232
```bash
33-
sudo apt install curl
34-
sudo apt install build-essential
33+
sudo apt install curl build-essential
3534
```
3635

3736
## Usage
@@ -87,13 +86,13 @@ for i in newiter: ...
8786
# Over individual node objects to change the iteration order of
8887
# a specific subtree:
8988
ctx = client.parse("file.py")
90-
first_node = next(ctx)
89+
first_node = ctx.root
9190
newiter = first_node.iterate(bblfsh.TreeOrder.POSITION_ORDER)
9291
for i in newiter: ...
9392

9493
# You can also get the non semantic UAST or native AST:
95-
ctx = client.parse("file.py", mode=bblfsh.ModeDict["NATIVE"])
96-
# Possible values for ModeDict: DEFAULT_MODE, NATIVE, PREPROCESSED, ANNOTATED, SEMANTIC
94+
ctx = client.parse("file.py", mode=bblfsh.Modes.NATIVE)
95+
# Possible values for Modes: DEFAULT_MODE, NATIVE, PREPROCESSED, ANNOTATED, SEMANTIC
9796
```
9897

9998
Please read the [Babelfish clients](https://doc.bblf.sh/using-babelfish/clients.html)

0 commit comments

Comments
 (0)