Skip to content

Commit

Permalink
work around the babel/documentation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mmomtchev committed Oct 27, 2022
1 parent 430723c commit f7ffbfb
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 13 deletions.
41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,17 @@ assert.deepEqual(py_array.toJS(), [2, 1, 0]);
- [slice](#slice)
- [fromJS](#fromjs)
- [Parameters](#parameters-10)
- [keys](#keys)
- [values](#values)
- [pymport](#pymport)
- [Parameters](#parameters-11)
- [proxify](#proxify)
- [Parameters](#parameters-12)
- [pyval](#pyval)
- [Parameters](#parameters-13)
- [version](#version)
- [version](#version-1)
- [pythonRuntime](#pythonruntime)

## PyObject

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

### get

Get a property from the object
Get a property from the object, equivalent to Python member operator .

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

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

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

### keys

Retrieve a list with the keys of the dictionary, equivalent to JS Object.keys()

Type: function (obj: [PyObject](#pyobject)): [PyObject](#pyobject)

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

### values

Retrieve a list with the values of the dictionary, equivalent to JS Object.values()

Type: function (obj: [PyObject](#pyobject)): [PyObject](#pyobject)

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

## pymport

Import a Python module
Expand Down Expand Up @@ -434,6 +455,24 @@ Eval a Python fragment

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

## version

Hex number

Type: string

## version

Version information

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}

### pythonRuntime

Supported only on Python 3.11+

Type: (null | string)

# Alternatives

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).
Expand Down
32 changes: 20 additions & 12 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,23 +162,31 @@ export function pyval(
locals?: PyObject | Record<string, any>
): PyObject;

export const version: {
pymport: { major: number, minor: number, patch: number, suffix: string; },
pythonLibrary: {
builtin: boolean;
major: number;
minor: number;
micro: number;
release: number;
serial: number;
/**
* Version information
*/
declare const version: {
readonly pymport: {
readonly major: number,
readonly minor: number,
readonly patch: number,
readonly suffix: string;
},
readonly pythonLibrary: {
readonly builtin: boolean;
readonly major: number;
readonly minor: number;
readonly micro: number;
readonly release: number;
readonly serial: number;
/**
* Hex number
*/
version: string;
readonly version: string;
};
/**
* Supported only on Python 3.11+
*/
pythonRuntime: null | string;
pythonPath: string;
readonly pythonRuntime: null | string;
readonly pythonPath: string;
};

0 comments on commit f7ffbfb

Please sign in to comment.