# PyLOOBins
PyLOOBins is a Python SDK and command-line utility for programmatically interacting with [LOOBins](https://loobins.io).
You can download PyLOOBins from PyPI by running the following command:
`pip install pyloobins`
PyLOOBins requires Python 3.8 or later.
## Usage
### Command-line
You can run `pyloobins --help` to see the available commands and options.
```
>>> pyloobins --help
Usage: pyloobins [OPTIONS] COMMAND [ARGS]...
Create, validate, and view LOOBin objects.
Options:
--help Show this message and exit.
Commands:
create Create a YAML template file for a new LOOBin.
get Get a LOOBin object.
validate Validate a LOOBin YAML file.
```
You can run `pyloobins <command> --help` to see the available options for a specific command.
```
>>> pyloobins validate --help
Usage: pyloobins validate [OPTIONS]
Validate a LOOBin YAML file.
Options:
--path TEXT The path of the LOOBin YAML file to validate. [required]
--help Show this message and exit.
```
### SDK
You can use pyloobins as a Python SDK to programmatically interact with LOOBins.
#### pyloobins.util
The util module can be used to get LOOBin objects from the LOOBins API, validate LOOBin YAML files, and create LOOBin YAML templates.
**Example:** get all LOOBins and print a list of the use case code.
```
from pyloobins import util
loobins = util.get_loobins()
for loobin in loobins:
for uc in loobin.example_use_cases:
print(f"{loobin.name}: {uc.code}")
```
#### pyloobins.models
The models module contains the classes that represent a LOOBin and its various components.
**Example:** programmitcally create a LOOBin object.
```
from pyloobins.models import Detection, ExampleUseCase, LOOBin, Resource
l = LOOBin(
name="",
short_description="A short description of the binary goes here.",
full_description="A full length description of the binary goes here.",
author="Enter your name or alias here.",
created=date.today(),
example_use_cases=[
ExampleUseCase(
name="An Example Use Case",
description="A description of the use case goes here.",
code="A code snippet goes here.",
tactics=["Discovery"],
tags=["example_tag", "another_tag"],
)
],
paths=["/enter/binary/path/here"],
detections=[
Detection(
name="A detection source (e.g. Sigma)",
url="https://urltodetection.here",
)
],
resources=[
Resource(
name="Name of resources.",
url="https://urlofexternalreference.here",
)
],
acknowledgements=["Enter any acknowledgements here."],
)
with open ("loobin.yaml", "w") as f:
f.write(l.to_yaml())
```
Raw data
{
"_id": null,
"home_page": "https://loobins.io/",
"name": "PyLOOBins",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "cybersecurity, cli, lol",
"author": "infosecB",
"author_email": "brendan@infosecb.com",
"download_url": "https://files.pythonhosted.org/packages/e6/92/a58844e12f9fb07b149a52403a19bf76fab56066406ffff9254336da9652/pyloobins-1.7.2.tar.gz",
"platform": null,
"description": "# PyLOOBins\nPyLOOBins is a Python SDK and command-line utility for programmatically interacting with [LOOBins](https://loobins.io).\n\nYou can download PyLOOBins from PyPI by running the following command:\n`pip install pyloobins`\n\nPyLOOBins requires Python 3.8 or later.\n\n## Usage\n### Command-line\n\nYou can run `pyloobins --help` to see the available commands and options.\n\n```\n>>> pyloobins --help\n\nUsage: pyloobins [OPTIONS] COMMAND [ARGS]...\n\n Create, validate, and view LOOBin objects.\n\nOptions:\n --help Show this message and exit.\n\nCommands:\n create Create a YAML template file for a new LOOBin.\n get Get a LOOBin object.\n validate Validate a LOOBin YAML file.\n```\n\nYou can run `pyloobins <command> --help` to see the available options for a specific command.\n```\n>>> pyloobins validate --help\nUsage: pyloobins validate [OPTIONS]\n\n Validate a LOOBin YAML file.\n\nOptions:\n --path TEXT The path of the LOOBin YAML file to validate. [required]\n --help Show this message and exit.\n```\n\n### SDK\n\nYou can use pyloobins as a Python SDK to programmatically interact with LOOBins.\n\n#### pyloobins.util\nThe util module can be used to get LOOBin objects from the LOOBins API, validate LOOBin YAML files, and create LOOBin YAML templates.\n\n**Example:** get all LOOBins and print a list of the use case code.\n\n```\nfrom pyloobins import util\n\nloobins = util.get_loobins()\n\nfor loobin in loobins:\n for uc in loobin.example_use_cases:\n print(f\"{loobin.name}: {uc.code}\")\n```\n\n#### pyloobins.models\nThe models module contains the classes that represent a LOOBin and its various components. \n\n**Example:** programmitcally create a LOOBin object.\n\n```\nfrom pyloobins.models import Detection, ExampleUseCase, LOOBin, Resource\n\nl = LOOBin(\n name=\"\",\n short_description=\"A short description of the binary goes here.\",\n full_description=\"A full length description of the binary goes here.\",\n author=\"Enter your name or alias here.\",\n created=date.today(),\n example_use_cases=[\n ExampleUseCase(\n name=\"An Example Use Case\",\n description=\"A description of the use case goes here.\",\n code=\"A code snippet goes here.\",\n tactics=[\"Discovery\"],\n tags=[\"example_tag\", \"another_tag\"],\n )\n ],\n paths=[\"/enter/binary/path/here\"],\n detections=[\n Detection(\n name=\"A detection source (e.g. Sigma)\",\n url=\"https://urltodetection.here\",\n )\n ],\n resources=[\n Resource(\n name=\"Name of resources.\",\n url=\"https://urlofexternalreference.here\",\n )\n ],\n acknowledgements=[\"Enter any acknowledgements here.\"],\n )\n\nwith open (\"loobin.yaml\", \"w\") as f:\n f.write(l.to_yaml())\n```\n",
"bugtrack_url": null,
"license": "GPL-3.0-or-later",
"summary": "Python package for managing the LOOBins model and schema.",
"version": "1.7.2",
"project_urls": {
"Homepage": "https://loobins.io/",
"Repository": "https://github.com/infosecB/LOOBins"
},
"split_keywords": [
"cybersecurity",
" cli",
" lol"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ea344374c19501169a7163ac5ff5f041c2d21a32cf9262b0229d2f15f1649b6a",
"md5": "de2a7add4b7056189613fb9a98fabd99",
"sha256": "37392ddc358e19761c167c00f63da52625cb855a9f041d04007db1bd80c17d7f"
},
"downloads": -1,
"filename": "pyloobins-1.7.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "de2a7add4b7056189613fb9a98fabd99",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 65062,
"upload_time": "2024-08-31T23:41:56",
"upload_time_iso_8601": "2024-08-31T23:41:56.828237Z",
"url": "https://files.pythonhosted.org/packages/ea/34/4374c19501169a7163ac5ff5f041c2d21a32cf9262b0229d2f15f1649b6a/pyloobins-1.7.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e692a58844e12f9fb07b149a52403a19bf76fab56066406ffff9254336da9652",
"md5": "b19dba028f0ef2d71e5d12faa17380f3",
"sha256": "e9207ccdec4cd376480aa7ccdb1dfd17ba4d202ecd9a462656aeed50f9705322"
},
"downloads": -1,
"filename": "pyloobins-1.7.2.tar.gz",
"has_sig": false,
"md5_digest": "b19dba028f0ef2d71e5d12faa17380f3",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 43358,
"upload_time": "2024-08-31T23:41:58",
"upload_time_iso_8601": "2024-08-31T23:41:58.212966Z",
"url": "https://files.pythonhosted.org/packages/e6/92/a58844e12f9fb07b149a52403a19bf76fab56066406ffff9254336da9652/pyloobins-1.7.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-31 23:41:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "infosecB",
"github_project": "LOOBins",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyloobins"
}