psaspotter


Namepsaspotter JSON
Version 0.0.4 PyPI version JSON
download
home_pagehttps://github.com/ricardojob/psaspotter
SummaryA tool for extracting of Platform-Specific APIs
upload_time2024-11-01 21:13:30
maintainerNone
docs_urlNone
authorRicardo Job
requires_python~=3.8
licenseMIT
keywords platform-specific api detect tool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![Tests](https://github.com/ricardojob/PSASpotter/actions/workflows/tests.yaml/badge.svg)](https://github.com/ricardojob/PSASpotter/actions/workflows/tests.yaml)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/psaspotter)](https://pypi.org/project/psaspotter/)

<!-- ![Maven](https://github.com/VariantSync/SyncStudy/actions/workflows/maven.yml/badge.svg) -->
<!-- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7025599.svg)](https://doi.org/10.5281/zenodo.7025599)
[![Documentation](https://img.shields.io/badge/Documentation-read%20here-blue)][documentation]
[![Requirements](https://img.shields.io/badge/System%20Requirements-read%20here-blue)](INSTALL.md)
[![Install](https://img.shields.io/badge/Installation%20Instructions-read%20here-blue)](INSTALL.md)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE) -->

# PSASpotter

An automated tool for extracting Platform-Specific API from Git repositories written in Python. 
The `psaspotter` (**P**latform-**S**pecific **A**PI Spotter) is primarily designed to be used as a command-line tool. 
With `psaspotter`, you can easily extract information about the Platform-Specific APIs and their usages from the Git repository or directory (only python files are analyzed).
The set of Platform-Specific APIs are saved in a given CSV file.

## Install

The easiest way to install `psaspotter` is to install from Pypi

```
pip install psaspotter
```

Alternatively, you can install from `test environment`
```
pip install --index-url https://test.pypi.org/simple/ --no-deps psaspotter
```

You may wish to use this tool in a virtual environment. You can use the following commands.

```
virtualenv psaspotter_venv
source psaspotter_venv/bin/activate
pip install psaspotter
```

## Quick examples

As an example, the following command extracts every platform-specific APIs from the directory `repository_local`. 
It also saves various information (line, module, filename ...) in `output.csv`. 
Additionally, we can provide information about the project present in the directory provided. 
For this, the parameters `-n` and `-c` can be added to inform the name (`my/local`) and last commit (`da39a3ee5e6b4b0d3255bfef95601890afd80709`) of the project. 
This information will be available in the output file.

```bash
psaspotter repository_local -o output.csv -n my/local --commit da39a3ee5e6b4b0d3255bfef95601890afd80709 
```

Note that the repository does not have to be already cloned, the tool also can fetch it. 
For example, the GitHub repository `https://github.com/ricardojob/PSASpotter` will be fetched, saved under the `data/PSASpotter` directory.
Note that, by default all projects are cloned to the `data` directory.

```bash
psaspotter https://github.com/ricardojob/PSASpotter -o output.csv
```

## Usage

After installation, the `psaspotter` command-line tool should be available in your shell. 
Otherwise, please replace `psaspotter` by `python -m psaspotter`. 
The explanations in the following stays valid in both cases.

You can use `psaspotter` with the following arguments:

```
Usage: psaspotter [OPTIONS] REPOSITORY

  Extract the usage of Platform-Specific APIs from a single Git repository
  `REPOSITORY`. The Git repository can be local or remote. In the latter case,
  it will be pulled locally in the folder `data`. Every extracted Platform-
  Specific APIs will be written in the CSV file given to `-o`, or in the
  standard output if not specified.

  Example of usage: psaspotter myRepository -n myRepositoryName -o output.csv

Options:
  -o, --output FILE           The output CSV file where the usage of Platform-
                              Specific APIs related to the repository will be
                              stored. By default, the information will written
                              to the standard output.
  -c, --commit TEXT           The commit reference (i.e., commit SHA or TAG)
                              to be considered for the extraction.It is
                              important to note that each commit references a
                              local project.
  -n, --repository-name TEXT  The name's project to be considered for the
                              extraction.It is important to note that the name
                              references a local project.
  -p, --platforms [all|OS]    The Platform-specific API group to figure out.
  -f, --filter FILE           The JSON file with the configuration of
                              Platform-Specific APIs that will be filter. By
                              default, this option is mandatory to option
                              --platforms.
  -h, --help                  Show this message and exit.
```

The CSV file given to `-o` (or that will be written to the standard output by default) will contain the following columns:
- `project_name`: the name of the repository
- `project_commit`: the commit SHA of the commit where the platform-specific APIs file was extracted
- `line`: the line where the platform-specific API usage occurs
- `module`: the module that packages the platform-specific API
- `call`: a short information about of platform-specific API
- `is_test`: a boolean indicating if the file is a test file
- `url`: the URL that represents the API usage on Github
- `risk`: the (low or right) risk for this instance

## License

Distributed under [MIT License](https://github.com/ricardojob/PSASpotter/blob/main/LICENSE.txt).

## Acknowledgements

The structure of this project was heavily inspired by the [gigawork](https://github.com/cardoeng/gigawork) and [spotflow](https://github.com/andrehora/spotflow) projects.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ricardojob/psaspotter",
    "name": "psaspotter",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "~=3.8",
    "maintainer_email": null,
    "keywords": "platform-specific api detect tool",
    "author": "Ricardo Job",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/d9/04/98b1c830ac20fac1e763f0942c1c96a1c2a3ee11ed1e2f667d8565cc0d8e/psaspotter-0.0.4.tar.gz",
    "platform": null,
    "description": "[![Tests](https://github.com/ricardojob/PSASpotter/actions/workflows/tests.yaml/badge.svg)](https://github.com/ricardojob/PSASpotter/actions/workflows/tests.yaml)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/psaspotter)](https://pypi.org/project/psaspotter/)\n\n<!-- ![Maven](https://github.com/VariantSync/SyncStudy/actions/workflows/maven.yml/badge.svg) -->\n<!-- [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.7025599.svg)](https://doi.org/10.5281/zenodo.7025599)\n[![Documentation](https://img.shields.io/badge/Documentation-read%20here-blue)][documentation]\n[![Requirements](https://img.shields.io/badge/System%20Requirements-read%20here-blue)](INSTALL.md)\n[![Install](https://img.shields.io/badge/Installation%20Instructions-read%20here-blue)](INSTALL.md)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue)](LICENSE) -->\n\n# PSASpotter\n\nAn automated tool for extracting Platform-Specific API from Git repositories written in Python. \nThe `psaspotter` (**P**latform-**S**pecific **A**PI Spotter) is primarily designed to be used as a command-line tool. \nWith `psaspotter`, you can easily extract information about the Platform-Specific APIs and their usages from the Git repository or directory (only python files are analyzed).\nThe set of Platform-Specific APIs are saved in a given CSV file.\n\n## Install\n\nThe easiest way to install `psaspotter` is to install from Pypi\n\n```\npip install psaspotter\n```\n\nAlternatively, you can install from `test environment`\n```\npip install --index-url https://test.pypi.org/simple/ --no-deps psaspotter\n```\n\nYou may wish to use this tool in a virtual environment. You can use the following commands.\n\n```\nvirtualenv psaspotter_venv\nsource psaspotter_venv/bin/activate\npip install psaspotter\n```\n\n## Quick examples\n\nAs an example, the following command extracts every platform-specific APIs from the directory `repository_local`. \nIt also saves various information (line, module, filename ...) in `output.csv`. \nAdditionally, we can provide information about the project present in the directory provided. \nFor this, the parameters `-n` and `-c` can be added to inform the name (`my/local`) and last commit (`da39a3ee5e6b4b0d3255bfef95601890afd80709`) of the project. \nThis information will be available in the output file.\n\n```bash\npsaspotter repository_local -o output.csv -n my/local --commit da39a3ee5e6b4b0d3255bfef95601890afd80709 \n```\n\nNote that the repository does not have to be already cloned, the tool also can fetch it. \nFor example, the GitHub repository `https://github.com/ricardojob/PSASpotter` will be fetched, saved under the `data/PSASpotter` directory.\nNote that, by default all projects are cloned to the `data` directory.\n\n```bash\npsaspotter https://github.com/ricardojob/PSASpotter -o output.csv\n```\n\n## Usage\n\nAfter installation, the `psaspotter` command-line tool should be available in your shell. \nOtherwise, please replace `psaspotter` by `python -m psaspotter`. \nThe explanations in the following stays valid in both cases.\n\nYou can use `psaspotter` with the following arguments:\n\n```\nUsage: psaspotter [OPTIONS] REPOSITORY\n\n  Extract the usage of Platform-Specific APIs from a single Git repository\n  `REPOSITORY`. The Git repository can be local or remote. In the latter case,\n  it will be pulled locally in the folder `data`. Every extracted Platform-\n  Specific APIs will be written in the CSV file given to `-o`, or in the\n  standard output if not specified.\n\n  Example of usage: psaspotter myRepository -n myRepositoryName -o output.csv\n\nOptions:\n  -o, --output FILE           The output CSV file where the usage of Platform-\n                              Specific APIs related to the repository will be\n                              stored. By default, the information will written\n                              to the standard output.\n  -c, --commit TEXT           The commit reference (i.e., commit SHA or TAG)\n                              to be considered for the extraction.It is\n                              important to note that each commit references a\n                              local project.\n  -n, --repository-name TEXT  The name's project to be considered for the\n                              extraction.It is important to note that the name\n                              references a local project.\n  -p, --platforms [all|OS]    The Platform-specific API group to figure out.\n  -f, --filter FILE           The JSON file with the configuration of\n                              Platform-Specific APIs that will be filter. By\n                              default, this option is mandatory to option\n                              --platforms.\n  -h, --help                  Show this message and exit.\n```\n\nThe CSV file given to `-o` (or that will be written to the standard output by default) will contain the following columns:\n- `project_name`: the name of the repository\n- `project_commit`: the commit SHA of the commit where the platform-specific APIs file was extracted\n- `line`: the line where the platform-specific API usage occurs\n- `module`: the module that packages the platform-specific API\n- `call`: a short information about of platform-specific API\n- `is_test`: a boolean indicating if the file is a test file\n- `url`: the URL that represents the API usage on Github\n- `risk`: the (low or right) risk for this instance\n\n## License\n\nDistributed under [MIT License](https://github.com/ricardojob/PSASpotter/blob/main/LICENSE.txt).\n\n## Acknowledgements\n\nThe structure of this project was heavily inspired by the [gigawork](https://github.com/cardoeng/gigawork) and [spotflow](https://github.com/andrehora/spotflow) projects.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A tool for extracting of Platform-Specific APIs",
    "version": "0.0.4",
    "project_urls": {
        "Homepage": "https://github.com/ricardojob/psaspotter"
    },
    "split_keywords": [
        "platform-specific",
        "api",
        "detect",
        "tool"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "650ceec35f9192f756311da335caf45ec9a9dc7b59564b8dba1f4f968403388b",
                "md5": "07b22e9e2625fee793036f5d9f1162c0",
                "sha256": "ff1ee7095e55804a65db1c99e694f2fa70c7bb9696492ea04d65ce9ff59fa4d0"
            },
            "downloads": -1,
            "filename": "psaspotter-0.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07b22e9e2625fee793036f5d9f1162c0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.8",
            "size": 22177,
            "upload_time": "2024-11-01T21:13:29",
            "upload_time_iso_8601": "2024-11-01T21:13:29.674193Z",
            "url": "https://files.pythonhosted.org/packages/65/0c/eec35f9192f756311da335caf45ec9a9dc7b59564b8dba1f4f968403388b/psaspotter-0.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d90498b1c830ac20fac1e763f0942c1c96a1c2a3ee11ed1e2f667d8565cc0d8e",
                "md5": "13635a4b7a5742d934dc2f43d341f93d",
                "sha256": "c1b210a56bb4ba8685da7ebc279ffa61e877450bf9fffb8688fe2cd2ab35ea38"
            },
            "downloads": -1,
            "filename": "psaspotter-0.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "13635a4b7a5742d934dc2f43d341f93d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.8",
            "size": 22284,
            "upload_time": "2024-11-01T21:13:30",
            "upload_time_iso_8601": "2024-11-01T21:13:30.931585Z",
            "url": "https://files.pythonhosted.org/packages/d9/04/98b1c830ac20fac1e763f0942c1c96a1c2a3ee11ed1e2f667d8565cc0d8e/psaspotter-0.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-01 21:13:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ricardojob",
    "github_project": "psaspotter",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "psaspotter"
}
        
Elapsed time: 1.56033s