# 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/d1/0d/aac5da39e01144fa109653c03272dcddda7fcd9a17ede948fc12b5d438bb/pyloobins-1.6.0.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.6.0",
"project_urls": {
"Homepage": "https://loobins.io/",
"Repository": "https://github.com/infosecB/LOOBins"
},
"split_keywords": [
"cybersecurity",
" cli",
" lol"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3539d344e5a9009f99e5aaf3b2761c9e52d0988fff0ade4218f1a69de17b3a06",
"md5": "0e03bd0e7c4de35eea535d35a440bbc8",
"sha256": "8522ccc69c2f7580a8ccb70f8c51685917190b5f296475de4015074176ec5e67"
},
"downloads": -1,
"filename": "pyloobins-1.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0e03bd0e7c4de35eea535d35a440bbc8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 60676,
"upload_time": "2024-04-10T00:29:05",
"upload_time_iso_8601": "2024-04-10T00:29:05.637640Z",
"url": "https://files.pythonhosted.org/packages/35/39/d344e5a9009f99e5aaf3b2761c9e52d0988fff0ade4218f1a69de17b3a06/pyloobins-1.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d10daac5da39e01144fa109653c03272dcddda7fcd9a17ede948fc12b5d438bb",
"md5": "13d4dd97127e7b7c539c7bd064645f1c",
"sha256": "b7add7230f73d79e79e04aa814a020a35431a4caf136cac53a16172b28c98e74"
},
"downloads": -1,
"filename": "pyloobins-1.6.0.tar.gz",
"has_sig": false,
"md5_digest": "13d4dd97127e7b7c539c7bd064645f1c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 40805,
"upload_time": "2024-04-10T00:29:07",
"upload_time_iso_8601": "2024-04-10T00:29:07.268007Z",
"url": "https://files.pythonhosted.org/packages/d1/0d/aac5da39e01144fa109653c03272dcddda7fcd9a17ede948fc12b5d438bb/pyloobins-1.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-10 00:29:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "infosecB",
"github_project": "LOOBins",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pyloobins"
}