Skip to content

Commit f7ffbfb

Browse files
committed
work around the babel/documentation issue
Refs: documentationjs/documentation#1569
1 parent 430723c commit f7ffbfb

File tree

2 files changed

+60
-13
lines changed

2 files changed

+60
-13
lines changed

README.md

+40-1
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,17 @@ assert.deepEqual(py_array.toJS(), [2, 1, 0]);
205205
- [slice](#slice)
206206
- [fromJS](#fromjs)
207207
- [Parameters](#parameters-10)
208+
- [keys](#keys)
209+
- [values](#values)
208210
- [pymport](#pymport)
209211
- [Parameters](#parameters-11)
210212
- [proxify](#proxify)
211213
- [Parameters](#parameters-12)
212214
- [pyval](#pyval)
213215
- [Parameters](#parameters-13)
216+
- [version](#version)
217+
- [version](#version-1)
218+
- [pythonRuntime](#pythonruntime)
214219

215220
## PyObject
216221

@@ -236,7 +241,7 @@ Type: (number | undefined)
236241

237242
### get
238243

239-
Get a property from the object
244+
Get a property from the object, equivalent to Python member operator .
240245

241246
Type: function (name: string): [PyObject](#pyobject)
242247

@@ -398,6 +403,22 @@ Type: function (v: any): [PyObject](#pyobject)
398403

399404
Returns **[PyObject](#pyobject)** 
400405

406+
### keys
407+
408+
Retrieve a list with the keys of the dictionary, equivalent to JS Object.keys()
409+
410+
Type: function (obj: [PyObject](#pyobject)): [PyObject](#pyobject)
411+
412+
Returns **[PyObject](#pyobject)** 
413+
414+
### values
415+
416+
Retrieve a list with the values of the dictionary, equivalent to JS Object.values()
417+
418+
Type: function (obj: [PyObject](#pyobject)): [PyObject](#pyobject)
419+
420+
Returns **[PyObject](#pyobject)** 
421+
401422
## pymport
402423

403424
Import a Python module
@@ -434,6 +455,24 @@ Eval a Python fragment
434455

435456
Returns **[PyObject](#pyobject)** 
436457

458+
## version
459+
460+
Hex number
461+
462+
Type: string
463+
464+
## version
465+
466+
Version information
467+
468+
Type: {pymport: {major: number, minor: number, patch: number, suffix: string}, pythonLibrary: {builtin: boolean, major: number, minor: number, micro: number, release: number, serial: number, version: string}, pythonRuntime: (null | string), pythonPath: string}
469+
470+
### pythonRuntime
471+
472+
Supported only on Python 3.11+
473+
474+
Type: (null | string)
475+
437476
# Alternatives
438477

439478
There is an alternative package that is more mature but with slightly different target use called [`node-calls-python`](https://github.com/hmenyus/node-calls-python).

lib/index.d.ts

+20-12
Original file line numberDiff line numberDiff line change
@@ -162,23 +162,31 @@ export function pyval(
162162
locals?: PyObject | Record<string, any>
163163
): PyObject;
164164

165-
export const version: {
166-
pymport: { major: number, minor: number, patch: number, suffix: string; },
167-
pythonLibrary: {
168-
builtin: boolean;
169-
major: number;
170-
minor: number;
171-
micro: number;
172-
release: number;
173-
serial: number;
165+
/**
166+
* Version information
167+
*/
168+
declare const version: {
169+
readonly pymport: {
170+
readonly major: number,
171+
readonly minor: number,
172+
readonly patch: number,
173+
readonly suffix: string;
174+
},
175+
readonly pythonLibrary: {
176+
readonly builtin: boolean;
177+
readonly major: number;
178+
readonly minor: number;
179+
readonly micro: number;
180+
readonly release: number;
181+
readonly serial: number;
174182
/**
175183
* Hex number
176184
*/
177-
version: string;
185+
readonly version: string;
178186
};
179187
/**
180188
* Supported only on Python 3.11+
181189
*/
182-
pythonRuntime: null | string;
183-
pythonPath: string;
190+
readonly pythonRuntime: null | string;
191+
readonly pythonPath: string;
184192
};

0 commit comments

Comments
 (0)