sgex


Namesgex JSON
Version 0.7.5 PyPI version JSON
download
home_pageNone
SummarySketch Grammar Explorer (Sketch Engine API wrapper)
upload_time2024-09-17 15:58:06
maintainerNone
docs_urlNone
authorNone
requires_python>=3.11
licenseBSD 3-Clause License Copyright (c) 2022, Loryn Isaacs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords sketch engine api wrapper corpus linguistics text analysis natural language processing
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Sketch Grammar Explorer

[![PyPI Latest Release](https://img.shields.io/pypi/v/sgex.svg)](https://pypi.org/project/sgex/)
[![PyPI - Python Versions](https://img.shields.io/pypi/pyversions/sgex)](https://pypi.org/project/sgex)
[![Package Status](https://img.shields.io/pypi/status/sgex.svg)](https://pypi.org/project/sgex/)
[![License](https://img.shields.io/pypi/l/sgex.svg)](https://github.com/pandas-dev/sgex/blob/main/LICENSE)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6812334.svg)](https://doi.org/10.5281/zenodo.6812334)

## Introduction

Sketch Grammar Explorer is an API wrapper for [Sketch Engine](https://www.sketchengine.eu/), a corpus management software useful for linguistic research. The goal is to build a flexible scaffold for any kind of programmatic work with Sketch Engine and [NoSketch Engine](https://nlp.fi.muni.cz/trac/noske).

## Installation

Clone SGEX or install it with `pip install sgex` (main dependencies are `pandas pyyaml aiohttp aiofiles`).

Get a [Sketch Engine API key](https://www.sketchengine.eu/documentation/api-documentation/#toggle-id-1). Be sure to reference SkE's documentation and schema:

`wget https://www.sketchengine.eu/apidoc/openapi.yaml -O .openapi.yaml`

## Getting started

A quick intro on the API (examples use a local NoSketch Engine server).

>Most things are identical for SkE's main server, apart from using credentials and more call types being available. SGEX currently uses the Bonito API, with URLs ending in `/bonito/run.cgi`, not newer paths like `/search/corp_info`.

### Package modules

- `job`: the primary module - makes requests and manipulates data
- `call`: classes and methods for API call types
- `query`: functions to generate/manipulate CQL queries
- `util`: utility functions

### The Job class

Calls are made with the `job` module, which can also be run as a script. The `Job` class has a few options:

```py
from sgex.job import Job

j = Job(
	# define API calls
	infile: str | list | None = None,
	params: str | dict | list | None = None,
	# set server info
	server: str = "local",
	default_servers: dict = default_servers,
	# supply credentials
	api_key: str | None = None,
	username: str | None = None,
	# manage caching
	cache_dir: str = "data",
	clear_cache: bool = False,
	# run asynchronous requests
	thread: bool = False,
	# control request throttling
	wait_dict: dict = wait_dict,
	# make a dry run
	dry_run: bool = False,
	# change verbosity
	verbose: bool = False,
	)

j.run()
```

*See the [code repository](https://github.com/engisalor/sketch-grammar-explorer) for full documentation.*

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "sgex",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.11",
    "maintainer_email": null,
    "keywords": "sketch engine, api wrapper, corpus linguistics, text analysis, natural language processing",
    "author": null,
    "author_email": "Loryn Isaacs <50170623+engisalor@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/3c/28/3b3aac3b3b4abac0e074608e4322802d9fea0bc970b68cc52e012cd4d69a/sgex-0.7.5.tar.gz",
    "platform": null,
    "description": "# Sketch Grammar Explorer\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/sgex.svg)](https://pypi.org/project/sgex/)\n[![PyPI - Python Versions](https://img.shields.io/pypi/pyversions/sgex)](https://pypi.org/project/sgex)\n[![Package Status](https://img.shields.io/pypi/status/sgex.svg)](https://pypi.org/project/sgex/)\n[![License](https://img.shields.io/pypi/l/sgex.svg)](https://github.com/pandas-dev/sgex/blob/main/LICENSE)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.6812334.svg)](https://doi.org/10.5281/zenodo.6812334)\n\n## Introduction\n\nSketch Grammar Explorer is an API wrapper for [Sketch Engine](https://www.sketchengine.eu/), a corpus management software useful for linguistic research. The goal is to build a flexible scaffold for any kind of programmatic work with Sketch Engine and [NoSketch Engine](https://nlp.fi.muni.cz/trac/noske).\n\n## Installation\n\nClone SGEX or install it with `pip install sgex` (main dependencies are `pandas pyyaml aiohttp aiofiles`).\n\nGet a [Sketch Engine API key](https://www.sketchengine.eu/documentation/api-documentation/#toggle-id-1). Be sure to reference SkE's documentation and schema:\n\n`wget https://www.sketchengine.eu/apidoc/openapi.yaml -O .openapi.yaml`\n\n## Getting started\n\nA quick intro on the API (examples use a local NoSketch Engine server).\n\n>Most things are identical for SkE's main server, apart from using credentials and more call types being available. SGEX currently uses the Bonito API, with URLs ending in `/bonito/run.cgi`, not newer paths like `/search/corp_info`.\n\n### Package modules\n\n- `job`: the primary module - makes requests and manipulates data\n- `call`: classes and methods for API call types\n- `query`: functions to generate/manipulate CQL queries\n- `util`: utility functions\n\n### The Job class\n\nCalls are made with the `job` module, which can also be run as a script. The `Job` class has a few options:\n\n```py\nfrom sgex.job import Job\n\nj = Job(\n\t# define API calls\n\tinfile: str | list | None = None,\n\tparams: str | dict | list | None = None,\n\t# set server info\n\tserver: str = \"local\",\n\tdefault_servers: dict = default_servers,\n\t# supply credentials\n\tapi_key: str | None = None,\n\tusername: str | None = None,\n\t# manage caching\n\tcache_dir: str = \"data\",\n\tclear_cache: bool = False,\n\t# run asynchronous requests\n\tthread: bool = False,\n\t# control request throttling\n\twait_dict: dict = wait_dict,\n\t# make a dry run\n\tdry_run: bool = False,\n\t# change verbosity\n\tverbose: bool = False,\n\t)\n\nj.run()\n```\n\n*See the [code repository](https://github.com/engisalor/sketch-grammar-explorer) for full documentation.*\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2022, Loryn Isaacs All rights reserved.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Sketch Grammar Explorer (Sketch Engine API wrapper)",
    "version": "0.7.5",
    "project_urls": {
        "repository": "https://github.com/engisalor/sketch-grammar-explorer.git"
    },
    "split_keywords": [
        "sketch engine",
        " api wrapper",
        " corpus linguistics",
        " text analysis",
        " natural language processing"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "825d50b14e089770eacfee3d591317a4fb75b70424742beced18d8e30bfe616e",
                "md5": "04d5a49ddacb07fe1e349803f40934a7",
                "sha256": "61896dfc53156daf045cd2f0b7a985e6163127a400bd4992df826ca7f3c444f1"
            },
            "downloads": -1,
            "filename": "sgex-0.7.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "04d5a49ddacb07fe1e349803f40934a7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 21630,
            "upload_time": "2024-09-17T15:58:04",
            "upload_time_iso_8601": "2024-09-17T15:58:04.867467Z",
            "url": "https://files.pythonhosted.org/packages/82/5d/50b14e089770eacfee3d591317a4fb75b70424742beced18d8e30bfe616e/sgex-0.7.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3c283b3aac3b3b4abac0e074608e4322802d9fea0bc970b68cc52e012cd4d69a",
                "md5": "94b6d2661c3f308b796d384d2559225c",
                "sha256": "e0025f97fe0116c2cde8eb402a4ecd37a2bf062232fd9110b5d5d23ace149771"
            },
            "downloads": -1,
            "filename": "sgex-0.7.5.tar.gz",
            "has_sig": false,
            "md5_digest": "94b6d2661c3f308b796d384d2559225c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 35546,
            "upload_time": "2024-09-17T15:58:06",
            "upload_time_iso_8601": "2024-09-17T15:58:06.327793Z",
            "url": "https://files.pythonhosted.org/packages/3c/28/3b3aac3b3b4abac0e074608e4322802d9fea0bc970b68cc52e012cd4d69a/sgex-0.7.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-17 15:58:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "engisalor",
    "github_project": "sketch-grammar-explorer",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "sgex"
}
        
Elapsed time: 0.39861s