Python client for MINE system
Reason this release was yanked:
Buggy
Project description
minetext
MINE is a collaboration project between the Niedersächsische Staats- und Universitätsbibliothek Göttingen (SUB) and the Gesellschaft für wissenschaftliche Datenverarbeitung Göttingen (GWDG) with the goal to offer a convenient platform for text analysis.
minetext
is a Python package, which facilitates the interaction between Python clients and the MINE system. For other
clients, REST API of MINE is the way to go.
Note: minetext
only works on Python version >=3.7
.
To install it, simply run
$ pip install minetext
Examples
Simple search
from minetext import EsRequest, Mine
es_request = EsRequest(search_term='biology')
mine = Mine(es_request)
response = mine.search()
for hit in response:
print(hit.meta.score, hit.mine.dc_title)
The example above shows us how to search in MINE. It is done in 3 steps:
- Line 3: create an instance of the :ref:
EsRequest <api_esRequest>
class with the query set tobiology
. - Line 4: create an instance of the :ref:
Mine <api_mine>
class. Since all operations are done via this instance, creating this instance is the first required step to interact with the MINE system. - Line 6: search for the word
biology
in MINE. To access the result, simply loop through theresponse
, as shown in line 8.
Get full-text
from minetext import EsRequest, Mine
# Search for all documents which have full-text
es_request = EsRequest(search_term='_exists_:content')
mine = Mine(es_request)
mine.login()
response = mine.search()
for hit in response:
print(hit.content)
To access the full-text, authentication is required. It is done by calling the login
method of the Mine
class,
as shown in the example above on line 5. The full-text, if existed, will be accessible via hit.content
.
The syntax of the search_term
is the query string syntax.
Note: the response
object is an instance of the Response
class from the elasticsearch-dsl
package
For more information, please refer to the full documentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file minetext-0.5.0.tar.gz
.
File metadata
- Download URL: minetext-0.5.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9811897b849b5dcaf8296b7169b07fe4093fa7832a9492d8b5f1bebb0878da84 |
|
MD5 | 0effe361ac4a28d46f4a3f9f6dfa23ef |
|
BLAKE2b-256 | eea0387fe3d66b3266798366e7c0e343014f71b74b6c7c9f505ddb0ea63def62 |
Provenance
File details
Details for the file minetext-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: minetext-0.5.0-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38872f729daed7cd66d1ffbeb9a19a0432d2d9e66c3b29440f3313aed2814701 |
|
MD5 | f29641c73b85c3b3b5c4bbe9aab9495d |
|
BLAKE2b-256 | a3ba229ef215b2fa7cf2514fa79b08ed138f97ee12265656106a80898bc2b8a2 |