# OpenCTI client for Python
[](https://opencti.io)
[](https://circleci.com/gh/OpenCTI-Platform/client-python/tree/master)
[](https://opencti-client-for-python.readthedocs.io/en/latest/)
[](https://github.com/OpenCTI-Platform/client-python/releases/latest)
[](https://pypi.python.org/pypi/pycti/)
[](https://community.filigran.io)
The official OpenCTI Python client helps developers to use the OpenCTI API by providing easy to use methods and utils.
This client is also used by some OpenCTI components.
## Install
To install the latest Python client library, please use `pip`:
```bash
$ pip3 install pycti
```
## Local development
```bash
# Fork the current repository, then clone your fork
$ git clone https://github.com/YOUR-USERNAME/client-python
$ cd client-python
$ git remote add upstream https://github.com/OpenCTI-Platform/client-python.git
# Create a branch for your feature/fix
$ git checkout -b [branch-name]
# Create a virtualenv
$ python3 -m venv .venv
$ source .venv/bin/activate
# Install the client-python and dependencies for the development and the documentation
$ python3 -m pip install -e .[dev,doc]
# Set up the git hook scripts
$ pre-commit install
# Create your feature/fix
# Create tests for your changes
$ pytest
# Push you feature/fix on Github
$ git add [file(s)]
$ git commit -m "[descriptive message]"
$ git push origin [branch-name]
# Open a pull request
```
### Install the package locally
```bash
$ pip install -e .
```
## Documentation
### Client usage
To learn about how to use the OpenCTI Python client and read some examples and cases, refer to [the client documentation](https://opencti-client-for-python.readthedocs.io/en/latest/client_usage/getting_started.html).
### API reference
To learn about the methods available for executing queries and retrieving their answers, refer to [the client API Reference](https://opencti-client-for-python.readthedocs.io/en/latest/pycti/pycti.html).
## Tests
### Install dependencies
```bash
$ pip install -r ./test-requirements.txt
```
[pytest](https://docs.pytest.org/en/7.2.x/) is used to launch the tests.
### Launch tests
#### Prerequisite
Your OpenCTI API should be running.
Your conftest.py should be configured with your API url, your token, and if applicable, your mTLS cert/key.
#### Launching
Unit tests
```bash
$ pytest ./tests/01-unit/
```
Integration testing
```bash
$ pytest ./tests/02-integration/
```
## About
OpenCTI is a product designed and developed by the company [Filigran](https://filigran.io).
<a href="https://filigran.io" alt="Filigran"><img src="https://github.com/OpenCTI-Platform/opencti/raw/master/.github/img/logo_filigran.png" width="300" /></a>
Raw data
{
"_id": null,
"home_page": "https://github.com/OpenCTI-Platform/client-python",
"name": "pycti",
"maintainer": "Filigran",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": "Filigran",
"author_email": "contact@filigran.io",
"download_url": "https://files.pythonhosted.org/packages/c4/cf/dd4eba955e0a43966e45a7cb10b5d68b726c690b64008250d746f9615af1/pycti-6.7.15.tar.gz",
"platform": null,
"description": "# OpenCTI client for Python\n\n[](https://opencti.io)\n[](https://circleci.com/gh/OpenCTI-Platform/client-python/tree/master)\n[](https://opencti-client-for-python.readthedocs.io/en/latest/)\n[](https://github.com/OpenCTI-Platform/client-python/releases/latest)\n[](https://pypi.python.org/pypi/pycti/)\n[](https://community.filigran.io)\n\nThe official OpenCTI Python client helps developers to use the OpenCTI API by providing easy to use methods and utils.\nThis client is also used by some OpenCTI components.\n\n## Install\n\nTo install the latest Python client library, please use `pip`:\n\n```bash\n$ pip3 install pycti\n```\n\n## Local development\n\n```bash\n# Fork the current repository, then clone your fork\n$ git clone https://github.com/YOUR-USERNAME/client-python\n$ cd client-python\n$ git remote add upstream https://github.com/OpenCTI-Platform/client-python.git\n# Create a branch for your feature/fix\n$ git checkout -b [branch-name]\n# Create a virtualenv\n$ python3 -m venv .venv\n$ source .venv/bin/activate\n# Install the client-python and dependencies for the development and the documentation\n$ python3 -m pip install -e .[dev,doc]\n# Set up the git hook scripts\n$ pre-commit install\n# Create your feature/fix\n# Create tests for your changes\n$ pytest\n# Push you feature/fix on Github\n$ git add [file(s)]\n$ git commit -m \"[descriptive message]\"\n$ git push origin [branch-name]\n# Open a pull request\n```\n\n### Install the package locally\n\n```bash\n$ pip install -e .\n```\n\n## Documentation\n\n### Client usage\n\nTo learn about how to use the OpenCTI Python client and read some examples and cases, refer to [the client documentation](https://opencti-client-for-python.readthedocs.io/en/latest/client_usage/getting_started.html).\n\n### API reference\n\nTo learn about the methods available for executing queries and retrieving their answers, refer to [the client API Reference](https://opencti-client-for-python.readthedocs.io/en/latest/pycti/pycti.html).\n\n## Tests\n\n### Install dependencies\n\n```bash\n$ pip install -r ./test-requirements.txt\n```\n\n[pytest](https://docs.pytest.org/en/7.2.x/) is used to launch the tests.\n\n### Launch tests\n\n#### Prerequisite\n\nYour OpenCTI API should be running.\nYour conftest.py should be configured with your API url, your token, and if applicable, your mTLS cert/key.\n\n#### Launching\n\nUnit tests\n```bash\n$ pytest ./tests/01-unit/\n```\n\nIntegration testing\n```bash\n$ pytest ./tests/02-integration/\n```\n\n## About\n\nOpenCTI is a product designed and developed by the company [Filigran](https://filigran.io).\n\n<a href=\"https://filigran.io\" alt=\"Filigran\"><img src=\"https://github.com/OpenCTI-Platform/opencti/raw/master/.github/img/logo_filigran.png\" width=\"300\" /></a>\n",
"bugtrack_url": null,
"license": "Apache",
"summary": "Python API client for OpenCTI.",
"version": "6.7.15",
"project_urls": {
"Homepage": "https://github.com/OpenCTI-Platform/client-python"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "61fbb30562b74a071bf3e2c653b50b3c756cfa2dcaf96a4045d88f705d32b764",
"md5": "e8405ec7972a6918915e3be7a45c934e",
"sha256": "17b633d2bf946362cff22cd4ae584ce9788329bbae169903b730ce596f7fa66c"
},
"downloads": -1,
"filename": "pycti-6.7.15-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e8405ec7972a6918915e3be7a45c934e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 266089,
"upload_time": "2025-08-27T15:44:37",
"upload_time_iso_8601": "2025-08-27T15:44:37.966068Z",
"url": "https://files.pythonhosted.org/packages/61/fb/b30562b74a071bf3e2c653b50b3c756cfa2dcaf96a4045d88f705d32b764/pycti-6.7.15-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c4cfdd4eba955e0a43966e45a7cb10b5d68b726c690b64008250d746f9615af1",
"md5": "c79e00b126f1e4d3fc495cb802cde684",
"sha256": "125364d5cd400ef4536ee7ecb9f4c3015c55ff2bec4dc711918165f5e37a643a"
},
"downloads": -1,
"filename": "pycti-6.7.15.tar.gz",
"has_sig": false,
"md5_digest": "c79e00b126f1e4d3fc495cb802cde684",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 178244,
"upload_time": "2025-08-27T15:44:39",
"upload_time_iso_8601": "2025-08-27T15:44:39.775371Z",
"url": "https://files.pythonhosted.org/packages/c4/cf/dd4eba955e0a43966e45a7cb10b5d68b726c690b64008250d746f9615af1/pycti-6.7.15.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-27 15:44:39",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "OpenCTI-Platform",
"github_project": "client-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"circle": true,
"requirements": [
{
"name": "datefinder",
"specs": [
[
"~=",
"0.7.3"
]
]
},
{
"name": "pika",
"specs": [
[
"~=",
"1.3.0"
]
]
},
{
"name": "python-magic",
"specs": [
[
"~=",
"0.4.27"
]
]
},
{
"name": "python-magic-bin",
"specs": [
[
"~=",
"0.4.14"
]
]
},
{
"name": "python_json_logger",
"specs": [
[
"~=",
"3.3.0"
]
]
},
{
"name": "PyYAML",
"specs": [
[
"~=",
"6.0"
]
]
},
{
"name": "pydantic",
"specs": [
[
"<",
"3"
],
[
">=",
"2.8.2"
]
]
},
{
"name": "requests",
"specs": [
[
"<",
"3"
],
[
">=",
"2.32.0"
]
]
},
{
"name": "setuptools",
"specs": [
[
"~=",
"80.9.0"
]
]
},
{
"name": "cachetools",
"specs": [
[
"~=",
"5.5.2"
]
]
},
{
"name": "prometheus-client",
"specs": [
[
"~=",
"0.22.1"
]
]
},
{
"name": "opentelemetry-api",
"specs": [
[
"~=",
"1.35.0"
]
]
},
{
"name": "opentelemetry-sdk",
"specs": [
[
"~=",
"1.35.0"
]
]
},
{
"name": "deprecation",
"specs": [
[
"~=",
"2.1.0"
]
]
},
{
"name": "fastapi",
"specs": [
[
">=",
"0.115.2"
],
[
"<",
"1"
]
]
},
{
"name": "uvicorn",
"specs": [
[
">=",
"0.34.0"
],
[
"<",
"0.36.0"
]
]
},
{
"name": "filigran-sseclient",
"specs": [
[
">=",
"1.0.2"
]
]
},
{
"name": "stix2",
"specs": [
[
"~=",
"3.0.1"
]
]
}
],
"lcname": "pycti"
}