cch-labeler


Namecch-labeler JSON
Version 0.0.0 PyPI version JSON
download
home_pageNone
SummaryA package for labeling data
upload_time2024-04-30 21:41:05
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords labeling
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Python Bindings for Security Labeler


## Usages

**From Python Interpreter**

```bash
Python 3.10.13 (main, Aug 24 2023, 12:59:26) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from labeler import labeler
INFO:2023-12-08 06:19:28,950 get_library_name:12 - Operating System: macos-14.1.2-arm64-arm-64bit
INFO:2023-12-08 06:19:28,950 get_library_name:13 - CPU Architecture: ('64bit', '')
>>> labeler.evaluate('{"number":1}', "when number > 0 then 'tag1' else 'tag2'")
'tag1'
```


<br>

**From Python Script**

```python
from labeler import labeler

content = '{"number":1}'
statement = "when number > 0 then 'tag1' else 'tag2'"

result: str = labeler.evaluate(content, statement)

print(f"result:{result}")
```


<br>

## How to Build (as the developer)

**Prerequisites**

- Shared libraries must have been built prior building the Python pacakge.

  - Libraries are expected to exist in the [labeler](../labeler/) directory with `libkoverse_labeler-` prefix.



<br>

**Make Targets**

Several make targets are provided.

- **clean** - delete files under `build/*`, `dist/*`, `src/*.egg-info/`, `inputs/*`, `src/labeler/libs/*.so`, `src/labeler/libs/*.dylib` directory but keep the `.gitkeep` file.

- **init** - install Python **build** package.

- **copy_test_data** - copy the test data from `../inputs` directory to the current directory.

- **copy_library** - copy library files from `../labeler` directory into `./src/labeler/libs/` directory.

- **install_extra_dependencies** - install extra depdencies needed for testing.

- **build** - build and package

- **tests** - run the test

- **test_upload** - upload package to Test PyPI.


<br>

**Building the package**


```bash
make init
make build
```

<br>

## How to Run Tests

```bash
make tests
```

<br>

## How to Publish to TestPyPI

```bash
make test_upload
```
<br>


## How to Install the package (as a user)

```bash
pip install cffi

pip install -i https://test.pypi.org/simple/ labeler

# or in one go
pip install -i https://test.pypi.org/simple/ labeler --extra-index-url https://pypi.org/simple/ cffi

```

<br>

## Editable Install

This assumes the package has been built locally already.

```bash
pip install -e .
```

<br>

**Install extra dependencies**

```bash
pip install -e ".[dev]"
```

<br>


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "cch-labeler",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "labeling",
    "author": null,
    "author_email": "Chih-Chieh Huang <cchdroid@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "# Python Bindings for Security Labeler\n\n\n## Usages\n\n**From Python Interpreter**\n\n```bash\nPython 3.10.13 (main, Aug 24 2023, 12:59:26) [Clang 15.0.0 (clang-1500.0.40.1)] on darwin\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n>>> from labeler import labeler\nINFO:2023-12-08 06:19:28,950 get_library_name:12 - Operating System: macos-14.1.2-arm64-arm-64bit\nINFO:2023-12-08 06:19:28,950 get_library_name:13 - CPU Architecture: ('64bit', '')\n>>> labeler.evaluate('{\"number\":1}', \"when number > 0 then 'tag1' else 'tag2'\")\n'tag1'\n```\n\n\n<br>\n\n**From Python Script**\n\n```python\nfrom labeler import labeler\n\ncontent = '{\"number\":1}'\nstatement = \"when number > 0 then 'tag1' else 'tag2'\"\n\nresult: str = labeler.evaluate(content, statement)\n\nprint(f\"result:{result}\")\n```\n\n\n<br>\n\n## How to Build (as the developer)\n\n**Prerequisites**\n\n- Shared libraries must have been built prior building the Python pacakge.\n\n  - Libraries are expected to exist in the [labeler](../labeler/) directory with `libkoverse_labeler-` prefix.\n\n\n\n<br>\n\n**Make Targets**\n\nSeveral make targets are provided.\n\n- **clean** - delete files under `build/*`, `dist/*`, `src/*.egg-info/`, `inputs/*`, `src/labeler/libs/*.so`, `src/labeler/libs/*.dylib` directory but keep the `.gitkeep` file.\n\n- **init** - install Python **build** package.\n\n- **copy_test_data** - copy the test data from `../inputs` directory to the current directory.\n\n- **copy_library** - copy library files from `../labeler` directory into `./src/labeler/libs/` directory.\n\n- **install_extra_dependencies** - install extra depdencies needed for testing.\n\n- **build** - build and package\n\n- **tests** - run the test\n\n- **test_upload** - upload package to Test PyPI.\n\n\n<br>\n\n**Building the package**\n\n\n```bash\nmake init\nmake build\n```\n\n<br>\n\n## How to Run Tests\n\n```bash\nmake tests\n```\n\n<br>\n\n## How to Publish to TestPyPI\n\n```bash\nmake test_upload\n```\n<br>\n\n\n## How to Install the package (as a user)\n\n```bash\npip install cffi\n\npip install -i https://test.pypi.org/simple/ labeler\n\n# or in one go\npip install -i https://test.pypi.org/simple/ labeler --extra-index-url https://pypi.org/simple/ cffi\n\n```\n\n<br>\n\n## Editable Install\n\nThis assumes the package has been built locally already.\n\n```bash\npip install -e .\n```\n\n<br>\n\n**Install extra dependencies**\n\n```bash\npip install -e \".[dev]\"\n```\n\n<br>\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A package for labeling data",
    "version": "0.0.0",
    "project_urls": null,
    "split_keywords": [
        "labeling"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c961a5acdac4c072c29c92007eb84e9c0b48bdf16aa7c0be25511c4d31c69c33",
                "md5": "0c4d3eb74d62c1a4cda1d7c264c0160d",
                "sha256": "88061288ba6d9d27805a1ea23a3b70c0035fcff2ef2b95384ad52c9159ba1773"
            },
            "downloads": -1,
            "filename": "cch_labeler-0.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0c4d3eb74d62c1a4cda1d7c264c0160d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 29958,
            "upload_time": "2024-04-30T21:41:05",
            "upload_time_iso_8601": "2024-04-30T21:41:05.988178Z",
            "url": "https://files.pythonhosted.org/packages/c9/61/a5acdac4c072c29c92007eb84e9c0b48bdf16aa7c0be25511c4d31c69c33/cch_labeler-0.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-30 21:41:05",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "cch-labeler"
}
        
Elapsed time: 0.25273s