Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/1_started.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# NebulaGraph Python Client Getting Started

## Installation
from pypi

```bash
pip install ng-python # not yet published
pip install nebula5_python==5.2.0
```

from source

```bash
cd python
git clone -b https://github.com/vesoft-inc/nebula-python.git
cd nebula-python
pip install -e .
```

Expand Down Expand Up @@ -152,4 +154,4 @@ Run `ngcli --help` to get the help message. An example to connect to NebulaGraph

```bash
ngcli -h 127.0.0.1:9669 -u root -p NebulaGraph01
```
```
6 changes: 3 additions & 3 deletions docs/5_vector_and_special_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ cli.close()
### NDuration

`NDuration` represents a duration with support for both month-based and time-based forms.
- If `months != 0`, the instance is month-based (`is_month_based = True`), and `years`/`months` are derived from the `months` argument.
- If `months == 0`, the instance is time-based (days default to 0 in current implementation) and uses the `seconds` and `microseconds` arguments to derive `hour`, `minute`, `second`, `microsec`.
- If `is_month_based = True`, the instance uses `year` and `month` fields for duration representation.
- If `is_month_based = False`, the instance uses `day`, `hour`, `minute`, `second`, and `microsecond` fields for duration representation.

The `__str__` produces an ISO-8601–like string:
- Month-based examples: `P1Y2M`, `P0M`
- Time-based examples: `PT0S`, `PT1H2M3S`, `PT3.5S`, `PT-0.000123S`

API:
- Constructor: `NDuration(seconds: int, microseconds: int, months: int)`
- Constructor: `NDuration(is_month_based: bool, year: int, month: int, day: int, hour: int, minute: int, seconds: int, microseconds: int)`
- Properties/Methods:
- `is_month_based: bool`
- `get_year() -> int`, `get_month() -> int`, `get_day() -> int`
Expand Down
Loading