# 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/b8/cb/128ea23f9ee39aae8110442dd904f5ca2b2578d7427e3042b38b1abe6b0a/pycti-6.7.17.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.17",
"project_urls": {
"Homepage": "https://github.com/OpenCTI-Platform/client-python"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7fc912416503becb229d8ddee3f81e9cb3388f4b54733aae8c81892e7a7cbb47",
"md5": "ddfde0e09e4d0ede944ad4fbe8924f19",
"sha256": "74d73266c50a089fb41775b1e86e792a4c9e4f1950ff8d3b0d561978c883c863"
},
"downloads": -1,
"filename": "pycti-6.7.17-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ddfde0e09e4d0ede944ad4fbe8924f19",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 266090,
"upload_time": "2025-09-03T15:59:07",
"upload_time_iso_8601": "2025-09-03T15:59:07.036359Z",
"url": "https://files.pythonhosted.org/packages/7f/c9/12416503becb229d8ddee3f81e9cb3388f4b54733aae8c81892e7a7cbb47/pycti-6.7.17-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "b8cb128ea23f9ee39aae8110442dd904f5ca2b2578d7427e3042b38b1abe6b0a",
"md5": "5a0f049404b3339678d4c737bf27d48c",
"sha256": "c38ea35d69a62c23e619804bf1e6578409cb814a5d7de8f8b926d5f8850cc5fe"
},
"downloads": -1,
"filename": "pycti-6.7.17.tar.gz",
"has_sig": false,
"md5_digest": "5a0f049404b3339678d4c737bf27d48c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 178218,
"upload_time": "2025-09-03T15:59:12",
"upload_time_iso_8601": "2025-09-03T15:59:12.414673Z",
"url": "https://files.pythonhosted.org/packages/b8/cb/128ea23f9ee39aae8110442dd904f5ca2b2578d7427e3042b38b1abe6b0a/pycti-6.7.17.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-03 15:59:12",
"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": [
[
">=",
"2.8.2"
],
[
"<",
"3"
]
]
},
{
"name": "requests",
"specs": [
[
">=",
"2.32.0"
],
[
"<",
"3"
]
]
},
{
"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": [
[
"<",
"1"
],
[
">=",
"0.115.2"
]
]
},
{
"name": "uvicorn",
"specs": [
[
">=",
"0.34.0"
],
[
"<",
"0.36.0"
]
]
},
{
"name": "filigran-sseclient",
"specs": [
[
">=",
"1.0.2"
]
]
},
{
"name": "stix2",
"specs": [
[
"~=",
"3.0.1"
]
]
}
],
"lcname": "pycti"
}