# SCANOSS Python Package
The SCANOSS python package provides a simple easy to consume library for interacting with SCANOSS APIs/Engine.
## Installation
To install (from [pypi.org](https://pypi.org/project/scanoss)), please run:
```bash
pip3 install scanoss
```
To upgrade an existing installation please run:
```bash
pip3 install --upgrade scanoss
```
### Fast Winnowing
To take advantage of faster fingerprinting, please install the optional [scanoss_winnowing](https://pypi.org/project/scanoss_winnowing/) package:
```bash
pip3 install scanoss_winnowing
```
Or directly using:
```bash
pip3 install scanoss[fast_winnowing]
```
### Docker
Alternatively, there is a docker image of the compiled package. It can be found [here](https://github.com/scanoss/scanoss.py/pkgs/container/scanoss-py).
Details of how to run it can be found [here](https://github.com/scanoss/scanoss.py/blob/main/GHCR.md).
### Externally Managed Environments on Linux
If installing on Ubuntu 2023.04, Fedora 38, Debian 11, etc. a few additional steps are required before installing `scanoss-py`. More details can be found [here](https://itsfoss.com/externally-managed-environment/).
The recommended method is to install `pipx` and use it to install `scanoss-py`:
```bash
sudo apt install pipx
pipx ensurepath
```
This will install the `pipx` package manager, which can then be used to install `scanoss-py`:
```bash
pipx install scanoss[fast_winnowing]
```
This will install the `scanoss-py` app in a separate virtual environment and create a link to the local path for execution.
## Usage
The package can be run from the command line, or consumed from another Python script.
### CLI Usage
The Python package manager (pip), will register the following command during installation:
```bash
scanoss-py
```
It is also possible to launch it using:
```bash
python3 -m scanoss.cli
```
Running the bare command will list the available sub-commands:
```bash
> scanoss-py
usage: scanoss-py [-h] [--version]
{version,ver,scan,sc,fingerprint,fp,wfp,dependencies,dp,dep,file_count,fc,convert,cv,cnv,cvrt,component,comp,utils,ut}
...
SCANOSS Python CLI. Ver: 1.6.1, License: MIT, Fast Winnowing: True
options:
-h, --help show this help message and exit
--version, -v Display version details
Sub Commands:
valid subcommands
{version,ver,scan,sc,fingerprint,fp,wfp,dependencies,dp,dep,file_count,fc,convert,cv,cnv,cvrt,component,comp,utils,ut}
sub-command help
version (ver) SCANOSS version
scan (sc) Scan source code
fingerprint (fp, wfp)
Fingerprint source code
dependencies (dp, dep)
Scan source code for dependencies, but do not decorate them
file_count (fc) Search the source tree and produce a file type summary
convert (cv, cnv, cvrt)
Convert file format
component (comp) Component support commands
utils (ut) General utility support commands
```
From there it is possible to scan a source code folder:
````bash
> scanoss-py scan -o scan-output.json <source-folder>
````
#### Scanning for Dependencies
The SCANOSS CLI supports dependency decoration. In order for this to work, it requires the installation of scancode:
```bash
pip install scancode-toolkit
```
Dependencies can then be decorated by adding the ``--dependencies`` option to the scanner:
```bash
> scanoss-py scan --dependencies -o scan-output.json <source-folder>
```
### Package Usage
The **scanoss** package can also be used in other Python projects/scripts. A good example of how to consume it can be found [here](https://github.com/scanoss/scanoss.py/blob/main/src/scanoss/cli.py).
In general the easiest way to consume it is to import the required module as follows:
```python
from scanoss.scanner import Scanner
def main():
scanner = Scanner()
scanner.scan_folder( '.' )
if __name__ == "__main__":
main()
```
## Scanning URL and API Key
By Default, scanoss uses the API URL endpoint for SCANOSS OSS KB: https://api.osskb.org/scan/direct.
This API does not require an API key.
These values can be changed from the command line using:
```bash
> scanoss-py scan --apiurl <URL> --key <KEY>
```
From code, it would look like this:
```python
from scanoss.scanner import Scanner
def main():
scanner = Scanner(url='new-url', api_key='key')
scanner.scan_folder( '.' )
if __name__ == "__main__":
main()
```
## Requirements
Python 3.9 or higher.
## Source code
The source for this package can be found [here](https://github.com/scanoss/scanoss.py).
## Documentation
For client usage help please look [here](https://github.com/scanoss/scanoss.py/blob/main/CLIENT_HELP.md).
## Changelog
Details of each release can be found [here](https://github.com/scanoss/scanoss.py/blob/main/CHANGELOG.md).
Raw data
{
"_id": null,
"home_page": "https://scanoss.com",
"name": "scanoss",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": "SCANOSS",
"author_email": "info@scanoss.com",
"download_url": "https://files.pythonhosted.org/packages/09/a0/4dd92e7fe6c17c149691c98bdbc672c991a9f5b169cafb15d44be0bceb08/scanoss-1.30.0.tar.gz",
"platform": null,
"description": "# SCANOSS Python Package\nThe SCANOSS python package provides a simple easy to consume library for interacting with SCANOSS APIs/Engine.\n\n## Installation\nTo install (from [pypi.org](https://pypi.org/project/scanoss)), please run:\n```bash\npip3 install scanoss\n```\nTo upgrade an existing installation please run:\n```bash\npip3 install --upgrade scanoss\n```\n\n### Fast Winnowing\nTo take advantage of faster fingerprinting, please install the optional [scanoss_winnowing](https://pypi.org/project/scanoss_winnowing/) package:\n```bash\npip3 install scanoss_winnowing\n```\nOr directly using:\n```bash\npip3 install scanoss[fast_winnowing]\n```\n\n### Docker\nAlternatively, there is a docker image of the compiled package. It can be found [here](https://github.com/scanoss/scanoss.py/pkgs/container/scanoss-py).\nDetails of how to run it can be found [here](https://github.com/scanoss/scanoss.py/blob/main/GHCR.md).\n\n### Externally Managed Environments on Linux\nIf installing on Ubuntu 2023.04, Fedora 38, Debian 11, etc. a few additional steps are required before installing `scanoss-py`. More details can be found [here](https://itsfoss.com/externally-managed-environment/).\n\nThe recommended method is to install `pipx` and use it to install `scanoss-py`:\n```bash\nsudo apt install pipx\npipx ensurepath\n```\n\nThis will install the `pipx` package manager, which can then be used to install `scanoss-py`:\n```bash\npipx install scanoss[fast_winnowing]\n```\nThis will install the `scanoss-py` app in a separate virtual environment and create a link to the local path for execution.\n\n## Usage\nThe package can be run from the command line, or consumed from another Python script.\n\n### CLI Usage\nThe Python package manager (pip), will register the following command during installation:\n```bash\nscanoss-py\n```\nIt is also possible to launch it using:\n```bash\npython3 -m scanoss.cli\n```\n\nRunning the bare command will list the available sub-commands:\n```bash\n> scanoss-py\n\nusage: scanoss-py [-h] [--version]\n {version,ver,scan,sc,fingerprint,fp,wfp,dependencies,dp,dep,file_count,fc,convert,cv,cnv,cvrt,component,comp,utils,ut}\n ...\n\nSCANOSS Python CLI. Ver: 1.6.1, License: MIT, Fast Winnowing: True\n\noptions:\n -h, --help show this help message and exit\n --version, -v Display version details\n\nSub Commands:\n valid subcommands\n\n {version,ver,scan,sc,fingerprint,fp,wfp,dependencies,dp,dep,file_count,fc,convert,cv,cnv,cvrt,component,comp,utils,ut}\n sub-command help\n version (ver) SCANOSS version\n scan (sc) Scan source code\n fingerprint (fp, wfp)\n Fingerprint source code\n dependencies (dp, dep)\n Scan source code for dependencies, but do not decorate them\n file_count (fc) Search the source tree and produce a file type summary\n convert (cv, cnv, cvrt)\n Convert file format\n component (comp) Component support commands\n utils (ut) General utility support commands\n```\n\nFrom there it is possible to scan a source code folder:\n\n````bash\n> scanoss-py scan -o scan-output.json <source-folder>\n````\n\n#### Scanning for Dependencies\nThe SCANOSS CLI supports dependency decoration. In order for this to work, it requires the installation of scancode:\n```bash\npip install scancode-toolkit\n```\nDependencies can then be decorated by adding the ``--dependencies`` option to the scanner:\n```bash\n> scanoss-py scan --dependencies -o scan-output.json <source-folder>\n```\n\n### Package Usage\nThe **scanoss** package can also be used in other Python projects/scripts. A good example of how to consume it can be found [here](https://github.com/scanoss/scanoss.py/blob/main/src/scanoss/cli.py).\n\nIn general the easiest way to consume it is to import the required module as follows:\n```python\nfrom scanoss.scanner import Scanner\n\ndef main():\n scanner = Scanner()\n scanner.scan_folder( '.' )\n \nif __name__ == \"__main__\":\n main()\n```\n\n## Scanning URL and API Key\nBy Default, scanoss uses the API URL endpoint for SCANOSS OSS KB: https://api.osskb.org/scan/direct.\nThis API does not require an API key.\n\nThese values can be changed from the command line using:\n```bash\n> scanoss-py scan --apiurl <URL> --key <KEY>\n```\n\nFrom code, it would look like this:\n```python\nfrom scanoss.scanner import Scanner\n\ndef main():\n scanner = Scanner(url='new-url', api_key='key')\n scanner.scan_folder( '.' )\n \nif __name__ == \"__main__\":\n main()\n```\n\n## Requirements\nPython 3.9 or higher.\n\n## Source code\nThe source for this package can be found [here](https://github.com/scanoss/scanoss.py).\n\n## Documentation\nFor client usage help please look [here](https://github.com/scanoss/scanoss.py/blob/main/CLIENT_HELP.md).\n\n## Changelog\nDetails of each release can be found [here](https://github.com/scanoss/scanoss.py/blob/main/CHANGELOG.md).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simple Python library to leverage the SCANOSS APIs",
"version": "1.30.0",
"project_urls": {
"Homepage": "https://scanoss.com",
"Source": "https://github.com/scanoss/scanoss.py",
"Tracker": "https://github.com/scanoss/scanoss.py/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "4eff610664dc471a1f1257398c80d41d6e1f77801a38f261b785e3f75090ae09",
"md5": "aed4a263a66b4cacde464f11a197e17f",
"sha256": "bc999c731f21cf4904c29f6aec6ee6dde9e6b79d633927b8f801aecc04359c7c"
},
"downloads": -1,
"filename": "scanoss-1.30.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "aed4a263a66b4cacde464f11a197e17f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 208499,
"upload_time": "2025-07-22T10:32:44",
"upload_time_iso_8601": "2025-07-22T10:32:44.582949Z",
"url": "https://files.pythonhosted.org/packages/4e/ff/610664dc471a1f1257398c80d41d6e1f77801a38f261b785e3f75090ae09/scanoss-1.30.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "09a04dd92e7fe6c17c149691c98bdbc672c991a9f5b169cafb15d44be0bceb08",
"md5": "36d914384842c1ae3a7a1475b64cd829",
"sha256": "2d1b215d926b97546384dcf988ee0b88a7ab80b37924bb21cf59e770a662f1df"
},
"downloads": -1,
"filename": "scanoss-1.30.0.tar.gz",
"has_sig": false,
"md5_digest": "36d914384842c1ae3a7a1475b64cd829",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 153032,
"upload_time": "2025-07-22T10:32:45",
"upload_time_iso_8601": "2025-07-22T10:32:45.975160Z",
"url": "https://files.pythonhosted.org/packages/09/a0/4dd92e7fe6c17c149691c98bdbc672c991a9f5b169cafb15d44be0bceb08/scanoss-1.30.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-22 10:32:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "scanoss",
"github_project": "scanoss.py",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "requests",
"specs": []
},
{
"name": "crc32c",
"specs": [
[
">=",
"2.2"
]
]
},
{
"name": "binaryornot",
"specs": []
},
{
"name": "progress",
"specs": []
},
{
"name": "grpcio",
"specs": [
[
">",
"1.42.0"
]
]
},
{
"name": "protobuf",
"specs": [
[
">",
"3.19.1"
]
]
},
{
"name": "pypac",
"specs": []
},
{
"name": "urllib3",
"specs": []
},
{
"name": "pyOpenSSL",
"specs": []
},
{
"name": "google-api-core",
"specs": []
},
{
"name": "importlib_resources",
"specs": []
},
{
"name": "packageurl-python",
"specs": []
},
{
"name": "pathspec",
"specs": []
},
{
"name": "jsonschema",
"specs": []
},
{
"name": "crc",
"specs": []
},
{
"name": "cyclonedx-python-lib",
"specs": []
}
],
"lcname": "scanoss"
}