{"id":13691030,"url":"https://github.com/KxSystems/embedPy","last_synced_at":"2025-05-02T11:32:00.702Z","repository":{"id":26510006,"uuid":"109252106","full_name":"KxSystems/embedPy","owner":"KxSystems","description":"Allows the kdb+ interpreter to call Python functions","archived":false,"fork":false,"pushed_at":"2023-11-20T15:42:23.000Z","size":340,"stargazers_count":89,"open_issues_count":1,"forks_count":43,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-11-07T16:09:54.421Z","etag":null,"topics":["embedpy","interface","kdb","python","q"],"latest_commit_sha":null,"homepage":"https://code.kx.com/q/interfaces","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KxSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-11-02T10:47:31.000Z","updated_at":"2024-09-11T06:04:58.000Z","dependencies_parsed_at":"2023-11-20T16:52:52.894Z","dependency_job_id":null,"html_url":"https://github.com/KxSystems/embedPy","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2FembedPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2FembedPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2FembedPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KxSystems%2FembedPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KxSystems","download_url":"https://codeload.github.com/KxSystems/embedPy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224308830,"owners_count":17290071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedpy","interface","kdb","python","q"],"created_at":"2024-08-02T17:00:38.909Z","updated_at":"2024-11-12T16:32:07.009Z","avatar_url":"https://github.com/KxSystems.png","language":"Python","funding_links":[],"categories":[":fireworks: Fusion interfaces"],"sub_categories":[],"readme":"# ![Python](python.png) embedPy\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/kxsystems/embedPy)](https://github.com/kxsystems/embedpy/releases) [![AppVeyor branch](https://img.shields.io/appveyor/ci/jhanna-kx/embedpy-ax90d/master?label=appveyor%20build)](https://ci.appveyor.com/project/jhanna-kx/embedpy-ax90d/branch/master)\n\nAllows the kdb+ interpreter to manipulate Python objects and call Python functions.\nPart of the [_Fusion for kdb+_](https://code.kx.com/q/interfaces/) interface collection.\n\nPlease direct any questions to ai@kx.com.\n\nPlease [report issues](https://github.com/KxSystems/embedpy/issues) in this repository.\n\n\n## Requirements\n\n- kdb+ ≥ 3.5 64-bit/32-bit(Linux/Arm)\n- Python ≥ 3.8.0 (macOS/Linux/Arm) ≥ 3.8.0 windows\n\n\n## Overview\n\nYou can either\n\n*   install embedPy to run on your local machine; or \n*   download or build a Docker image in which to run embedPy\n\nThere are three ways to install embedPy on your local machine:\n\n1.  Download and install a release\n\n1.  Clone and build from source, on your local machine or in a Docker image\n\n1.  Install with Conda - recommended for use with\n\n    -   Anaconda Python\n    -   [mlnotebooks](https://github.com/KxSystems/mlnotebooks) \n    -   [JupyterQ](https://github.com/KxSystems/jupyterq)\n\n32-bit Linux/Arm builds require users to build from source, there is not currenly a conda build or provided pre-compiled binary.\n\n### Anaconda Python\n\nIf you are using Anaconda Python, we recommend installing with Conda. If, instead, you take option (1) or (2) above, and are using Linux or macOS, set your `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) to your Python distributions library directory to avoid conflicts between libraries which both q and Python use (e.g. `libz`, `libssl`). You can find this directory's location in Python.\n\n```python\n\u003e\u003e\u003e import sysconfig\n\u003e\u003e\u003e sysconfig.get_config_var('LIBDIR')\n```\n\n\n### PyQ \n\nIf you are currently using [PyQ](https://github.com/KxSystems/pyq), both interfaces use a file `p.k` in `$QHOME/{l64,m64}` which results in a conflict when both are installed. \n\nYou may want to run initially from another directory, without installing. Skip the install step above, and run q in the directory where you unzipped the release.\n\n### Test script\n\nThe test script `test.q` requires the packages listed in `tests/requirements.txt`, although embedPy does not itself require them. They can be installed using `pip` or `conda`.\n\n```bash\npip install -r tests/requirements.txt\n```\nor\n```bash\nconda install --file tests/requirements.txt\n```\n\nIf the tests all pass, no message is displayed. \n\n\n## Install on local machine\n\n### Download and install a release\n\n1.  Download a release archive from the [releases](../../releases/latest) page, and unzip it.\n\n1.  In the unzipped directory, run the [tests](#test-script).\n\n    ```bash\n    q test.q\n    ```\n\n1.  Install: put `p.q` and `p.k` in QHOME and the library file (`p.so` for macOS/Linux or `p.dll` for Windows) in `$QHOME/{l64,m64,w64}`. \n\n\n### Clone and build from source\n\n1.  Clone this repository from GitHub.\n\n1.  To run embedPy without Internet access, download the kdb+ [C API header file](https://raw.githubusercontent.com/KxSystems/kdb/master/c/c/k.h) and place it in the build directory.\n\n1.  Build the interface and run the [tests](#test-script).\n\n    ```bash\n    make p.so \u0026\u0026 q test.q\n    ```\n\n1.  Install: put `p.q` and `p.k` in `$QHOME` and `p.so` in `$QHOME/{l64,l32,m64}`.\n\n\n\u003e **Note**\n\u003e \n\u003e For ease of install on 32-bit Arm and Linux we suggest a new user use a miniconda version of Python specific to the architecture being used, for example `rpi` for Raspberry Pi. This is not an explicit requirement but makes install of embedPy and Python packages more seamless.\n\n\n### Install with Conda\n\nThis requires either macOS or Linux.\n\n1.  [Download and install](https://conda.io/docs/user-guide/install/download.html) either the full Anaconda distribution or Miniconda for Python3\n\n2.  Use the `conda` command to install packages as follows:\n\n    ```bash\n    $ conda install -c kx embedPy\n    ```\n\n\n## Run on local machine\n\nStart q with embedPy\n```bash\nq p.q\n```\nOr from q, load `p.q`.\n```q\nq)\\l p.q\n```\n\nDocumentation is in the :open_file_folder: [`docs`](docs) folder.\n\n\n## Run a Docker image\n\nIf you have [Docker](https://www.docker.com/community-edition) installed, instead of installing embedPy on your machine, you can run:\n\n```bash\n$ docker run -it --name myembedpy kxsys/embedpy\nkdb+ on demand - Personal Edition\n\n[snipped]\n\nI agree to the terms of the license agreement for kdb+ on demand Personal Edition (N/y): y\n\nIf applicable please provide your company name (press enter for none): ACME Limited\nPlease provide your name: Bob Smith\nPlease provide your email (requires validation): bob@example.com\nKDB+ 3.5 2018.04.25 Copyright (C) 1993-2018 Kx Systems\nl64/ 4()core 7905MB kx 0123456789ab 172.17.0.2 EXPIRE 2018.12.04 bob@example.com KOD #0000000\n\nq)\n```\n\nSee [docker/README.md](docker/README.md) for more details.\n\n\n## Back-incompatible changes\n\n### V1.0 -\u003e V 1.1\n\n`.p.key` and `.p.value` removed\n\n\n### V0.2-beta -\u003e V1.0\n\n-   Attribute access from `embedPy` object\n\n    ```q\n    q)obj`ATTRNAME   / old\n    q)obj`:ATTRNAME  / new\n    ```\n\n-   `embedPy` objects can be called directly without explicitly specifying the call return type; the default return type is an `embedPy` object\n\n\n### V0.1-beta -\u003e V0.2beta in V0.2-beta\n\nV0.2-beta features a number of changes back-incompatible with the previous release, V0.1-beta.\n\nMost notably, the default _type_ used in many operations is now the `embedPy` type, rather than the `foreign` type.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKxSystems%2FembedPy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKxSystems%2FembedPy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKxSystems%2FembedPy/lists"}