Skip to content

Commit 17d920a

Browse files
authored
feat: add AIDR Python SDK (#1)
1 parent 2c57a99 commit 17d920a

29 files changed

+8787
-2
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 2
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.py]
12+
indent_size = 4

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @kenany

.github/workflows/ci.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
types:
10+
- opened
11+
- synchronize
12+
- reopened
13+
- ready_for_review
14+
15+
merge_group:
16+
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-24.04
25+
steps:
26+
- name: Checkout code
27+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
28+
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
31+
with:
32+
enable-cache: true
33+
34+
- name: Setup Python
35+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
36+
with:
37+
python-version-file: .python-version
38+
39+
- name: Install dependencies
40+
run: uv sync --all-extras --dev
41+
42+
- name: Build
43+
run: uv build
44+
45+
mypy:
46+
runs-on: ubuntu-24.04
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
50+
51+
- name: Install uv
52+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
53+
with:
54+
enable-cache: true
55+
56+
- name: Setup Python
57+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
58+
with:
59+
python-version-file: .python-version
60+
61+
- name: Install dependencies
62+
run: uv sync --all-extras --dev
63+
64+
- name: mypy
65+
run: uv run mypy .
66+
67+
ruff-check:
68+
runs-on: ubuntu-24.04
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
72+
73+
- name: Install uv
74+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
75+
with:
76+
enable-cache: true
77+
78+
- name: Setup Python
79+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
80+
with:
81+
python-version-file: .python-version
82+
83+
- name: Install dependencies
84+
run: uv sync --all-extras --dev
85+
86+
- name: ruff
87+
run: uv run ruff check .
88+
89+
ruff-format:
90+
runs-on: ubuntu-24.04
91+
steps:
92+
- name: Checkout code
93+
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
94+
95+
- name: Install uv
96+
uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4
97+
with:
98+
enable-cache: true
99+
100+
- name: Setup Python
101+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
102+
with:
103+
python-version-file: .python-version
104+
105+
- name: Install dependencies
106+
run: uv sync --all-extras --dev
107+
108+
- name: ruff format
109+
run: uv run ruff format --check .

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
name: publish
12+
runs-on: ubuntu-24.04
13+
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/crowdstrike-aidr
17+
18+
permissions:
19+
id-token: write
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
24+
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
27+
with:
28+
enable-cache: true
29+
30+
- name: Setup Python
31+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
32+
with:
33+
python-version-file: .python-version
34+
35+
- name: Install dependencies
36+
run: uv sync --locked
37+
38+
- name: Build
39+
run: uv build
40+
41+
- name: Publish to PyPI
42+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
__pycache__
2+
.mypy_cache
3+
.venv
4+
dist

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13

LICENSE.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 CrowdStrike
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
# aidr-python
2-
Python SDK for CrowdStrike AIDR
1+
# CrowdStrike AIDR Python SDK
2+
3+
Python SDK for CrowdStrike AIDR.

flake.lock

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
7+
outputs = {
8+
self,
9+
nixpkgs,
10+
flake-utils,
11+
}:
12+
flake-utils.lib.simpleFlake {
13+
inherit self nixpkgs;
14+
name = "aidr-python";
15+
shell = {pkgs ? import <nixpkgs>}:
16+
pkgs.mkShellNoCC {
17+
packages = with pkgs; [
18+
python313
19+
uv
20+
];
21+
22+
env = {};
23+
24+
shellHook = '''';
25+
};
26+
};
27+
}

0 commit comments

Comments
 (0)