Installation
FalconPy leverages the Python Package Index for distribution, making installation and maintenance easy. There are two packages for FalconPy, the production package crowdstrike-falconpy (also referred to as the ‘stable release’), and the development package crowdstrike-falconpy-dev.
Production Package
Section titled “Production Package”For most developer scenarios, the production package will be the preferred solution.
Installing the stable release
Section titled “Installing the stable release”Stable releases of FalconPy are available on the Python Package Index and are the default installation option.
Virtual environment installation using Poetry
Section titled “Virtual environment installation using Poetry”poetry add crowdstrike-falconpyVirtual environment installation using Pipenv
Section titled “Virtual environment installation using Pipenv”pipenv install crowdstrike-falconpyLocal installation
Section titled “Local installation”python3 -m pip install crowdstrike-falconpyYou may also call pip3 directly to perform an installation:
pip3 install crowdstrike-falconpyUpgrading the stable release
Section titled “Upgrading the stable release”Upgrading the package to the latest stable release follows a similar pattern.
Upgrading in a virtual environment using Poetry
Section titled “Upgrading in a virtual environment using Poetry”Updates are performed as dictated by the contents of your pyproject.toml file. If this file is pinned to a specific version, the following command will have no effect.
poetry update crowdstrike-falconpyUpgrading in a virtual environment using Pipenv
Section titled “Upgrading in a virtual environment using Pipenv”Updates are performed as dictated by the contents of your Pipfile. If this file is pinned to a specific version, the following command will have no effect.
pipenv update crowdstrike-falconpyUpgrading your local environment
Section titled “Upgrading your local environment”python3 -m pip install crowdstrike-falconpy --upgradeor:
pip3 install crowdstrike-falconpy --upgradeInstalling the Bleeding Edge release
Section titled “Installing the Bleeding Edge release”The Bleeding Edge release is the latest release of the production package after new changes but prior to the release of this package to the production index. The period of time between the Bleeding Edge release and the production release is referred to as soak time and typically lasts for a few days to a week. If you’d like to try the Bleeding Edge version of the stable release, you will need to use the PyPI test index.
Bleeding Edge installation using Poetry
Section titled “Bleeding Edge installation using Poetry”In order to install the Bleeding Edge release, you will need to add the test index to your pyproject.toml file.
PLEASE NOTE: The
sourcecommand is available in Poetry v1.2.0+. For scenarios where you are unable to the upgrade to the latest version of Poetry, these changes will need to be manually implemented within yourpyproject.tomlfile.
poetry source add -s testpypi https://test.pypi.org/simple/This will add the following to your pyproject.toml file.
[[tool.poetry.source]]name = "testpypi"url = "https://test.pypi.org/simple/"default = falsesecondary = trueOnce the test index is enabled for your project, you can update the crowdstrike-falconpy package using this new index.
First we remove the production package.
poetry remove crowdstrike-falconpyThen we add in the Bleeding Edge package.
poetry add --source testpypi crowdstrike-falconpyThis will update your pyproject.toml file as follows.
crowdstrike-falconpy = {version = "^1.x.x", source = "testpypi"}When you have completed testing and want to swap back to the production package, you can revert these changes quickly.
Remove the Bleeding Edge package.
poetry remove crowdstrike-falconpyInstall the production package.
poetry add crowdstrike-falconpyBleeding Edge installation using Pipenv
Section titled “Bleeding Edge installation using Pipenv”You can specify the index you wish to install from using the --pypi-mirror flag.
pipenv install --pypi-mirror https://test.pypi.org/simple crowdstrike-falconpyLocal installation
Section titled “Local installation”python3 -m pip install -i https://test.pypi.org/simple crowdstrike-falconpyor:
pip3 install -i https://test.pypi.org/simple crowdstrike-falconpyUpgrading to the Bleeding Edge release
Section titled “Upgrading to the Bleeding Edge release”This package is updated as part of our regular build cycle, you may move to the Bleeding Edge release at any time and maintain it in your environment exactly as you would the stable release.
Using Poetry or Pipenv to upgrade to the Bleeding Edge release
Section titled “Using Poetry or Pipenv to upgrade to the Bleeding Edge release”You may use Poetry or Pipenv to upgrade to the latest Bleeding Edge release by following the installation procedure detailed above.
Local upgrades
Section titled “Local upgrades”To upgrade to the Bleeding Edge version you can use the following command:
python3 -m pip install -i https://test.pypi.org/simple crowdstrike-falconpy --upgradeor:
pip3 install -i https://test.pypi.org/simple crowdstrike-falconpy --upgradeUninstalling and removing the package
Section titled “Uninstalling and removing the package”Uninstalling and removing the FalconPy package entirely can be performed quickly regardless of your preferred solution.
Uninstalling from a virtual environment using Poetry
Section titled “Uninstalling from a virtual environment using Poetry”poetry remove crowdstrike-falconpyUninstalling from a virtual environment using Pipenv
Section titled “Uninstalling from a virtual environment using Pipenv”pipenv uninstall crowdstrike-falconpyUninstalling locally
Section titled “Uninstalling locally”python3 -m pip uninstall crowdstrike-falconpyor:
pip3 uninstall crowdstrike-falconpyPlease note: This will uninstall whichever version of FalconPy you have installed, bleeding edge or stable.
Development package
Section titled “Development package”The FalconPy development package (crowdstrike-falconpy-dev) is released from the dev branch as part of the code review and testing process. New library functionality and changes will be released to the development package prior to the production package and are available for pre-release testing.
NOTE: The development package uses a different module name,
falconpydev. You will need to update your import to match.
Installing the development release
Section titled “Installing the development release”The development package can be installed to your local or virtual environment using the same commands.
Virtual environment installation using Poetry
Section titled “Virtual environment installation using Poetry”poetry add crowdstrike-falconpy-devVirtual environment installation using Pipenv
Section titled “Virtual environment installation using Pipenv”pipenv install crowdstrike-falconpy-devLocal installation
Section titled “Local installation”python3 -m pip install crowdstrike-falconpy-devYou may also call pip3 directly to perform an installation:
pip3 install crowdstrike-falconpy-devUpgrading to the most recent development release
Section titled “Upgrading to the most recent development release”You can upgrade to the latest release by installing updates via the Python Package Index.
Upgrading in a virtual environment using Poetry
Section titled “Upgrading in a virtual environment using Poetry”Updates are performed as dictated by the contents of your pyproject.toml file. If this file is pinned to a specific version, the following command will have no effect.
poetry update crowdstrike-falconpy-devUpgrading in a virtual environment using Pipenv
Section titled “Upgrading in a virtual environment using Pipenv”Updates are performed as dictated by the contents of your Pipfile. If this file is pinned to a specific version, the following command will have no effect.
pipenv update crowdstrike-falconpy-devUpgrading your local environment
Section titled “Upgrading your local environment”python3 -m pip install crowdstrike-falconpy-dev --upgradeor
pip3 install crowdstrike-falconpy-dev --upgradeUninstalling and removing the development package
Section titled “Uninstalling and removing the development package”As before, uninstalling the development package is also a simple process.
Uninstalling from a virtual environment using Poetry
Section titled “Uninstalling from a virtual environment using Poetry”poetry remove crowdstrike-falconpyUninstalling from a virtual environment using Pipenv
Section titled “Uninstalling from a virtual environment using Pipenv”pipenv uninstall crowdstrike-falconpyUninstalling locally
Section titled “Uninstalling locally”python3 -m pip uninstall crowdstrike-falconpy-devor:
pip3 uninstall crowdstrike-falconpy-dev