sgex


Namesgex JSON
Version 0.7.4 PyPI version JSON
download
home_pageNone
SummarySketch Grammar Explorer (Sketch Engine API wrapper)
upload_time2024-05-11 21:07:51
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 aiofiles aiohttp aiosignal attrs frozenlist idna multidict numpy pandas python-dateutil pytz PyYAML six tzdata yarl
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).

**UPDATE**

SGEX `0.7.0+` is another redesign of the package meant to facilitate enhancements. The workflow is improved and it's streamlined for adapting to SkE's updated API schema. Old methods are deprecated and unavailable in new releases.

## 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/42/9f/8fa3e109d1eb96b9e4f4694536d9b457cc07390ed0003485640520f1821a/sgex-0.7.4.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**UPDATE**\n\nSGEX `0.7.0+` is another redesign of the package meant to facilitate enhancements. The workflow is improved and it's streamlined for adapting to SkE's updated API schema. Old methods are deprecated and unavailable in new releases.\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.4",
    "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": "095cc3ac7a9bb0e23ea548913ffb33ccf7a6d9974cd3ff1c3c2d13504a9b7df8",
                "md5": "6a7b41b8608bce63bed32c2d0252216b",
                "sha256": "cad0d95f5e9e14a9e3a9499276e946103dacf51a2bcc608fec98c3b361b4f2f9"
            },
            "downloads": -1,
            "filename": "sgex-0.7.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6a7b41b8608bce63bed32c2d0252216b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11",
            "size": 20085,
            "upload_time": "2024-05-11T21:07:49",
            "upload_time_iso_8601": "2024-05-11T21:07:49.712800Z",
            "url": "https://files.pythonhosted.org/packages/09/5c/c3ac7a9bb0e23ea548913ffb33ccf7a6d9974cd3ff1c3c2d13504a9b7df8/sgex-0.7.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "429f8fa3e109d1eb96b9e4f4694536d9b457cc07390ed0003485640520f1821a",
                "md5": "47a139e47d23c9033edde46805355e27",
                "sha256": "65d5fb42c85851447609a0f81ff07325414389d51e0e202de9cde1c5a56b9856"
            },
            "downloads": -1,
            "filename": "sgex-0.7.4.tar.gz",
            "has_sig": false,
            "md5_digest": "47a139e47d23c9033edde46805355e27",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11",
            "size": 33482,
            "upload_time": "2024-05-11T21:07:51",
            "upload_time_iso_8601": "2024-05-11T21:07:51.880235Z",
            "url": "https://files.pythonhosted.org/packages/42/9f/8fa3e109d1eb96b9e4f4694536d9b457cc07390ed0003485640520f1821a/sgex-0.7.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-11 21:07:51",
    "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": [
        {
            "name": "aiofiles",
            "specs": [
                [
                    "==",
                    "23.2.1"
                ]
            ]
        },
        {
            "name": "aiohttp",
            "specs": [
                [
                    "==",
                    "3.9.5"
                ]
            ]
        },
        {
            "name": "aiosignal",
            "specs": [
                [
                    "==",
                    "1.3.1"
                ]
            ]
        },
        {
            "name": "attrs",
            "specs": [
                [
                    "==",
                    "23.2.0"
                ]
            ]
        },
        {
            "name": "frozenlist",
            "specs": [
                [
                    "==",
                    "1.4.1"
                ]
            ]
        },
        {
            "name": "idna",
            "specs": [
                [
                    "==",
                    "3.7"
                ]
            ]
        },
        {
            "name": "multidict",
            "specs": [
                [
                    "==",
                    "6.0.5"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.26.4"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.2.2"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    "==",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    "==",
                    "2024.1"
                ]
            ]
        },
        {
            "name": "PyYAML",
            "specs": [
                [
                    "==",
                    "6.0.1"
                ]
            ]
        },
        {
            "name": "six",
            "specs": [
                [
                    "==",
                    "1.16.0"
                ]
            ]
        },
        {
            "name": "tzdata",
            "specs": [
                [
                    "==",
                    "2024.1"
                ]
            ]
        },
        {
            "name": "yarl",
            "specs": [
                [
                    "==",
                    "1.9.4"
                ]
            ]
        }
    ],
    "lcname": "sgex"
}
        
Elapsed time: 0.29187s