A Python wrapper module for OpenTrep
Project description
OpenTrepWrapper
Refefences
- OpenTREP project: https://github.com/trep/opentrep
- This GitHub project: https://github.com/trrep/wrapper
- OpenTravelData (OPTD) project: https://github.com/opentraveldata/opentraveldata
Configuration
Installation of OpenTREP
This module does not install OpenTREP, you have to do that.
On RedHat/CentOS/Fedora, OpenTREP is packaged and can therefore easily
be installed with the native packager manager (dnf
or yum
).
On the platforms, it can be installed by following the instructions
in the README.md
file.
Test the wrapper application
- Import the module:
>>> from OpenTrepWrapper import main_trep, index_trep
>>> from OpenTrepWrapper import DEFAULT_LOG, DEFAULT_FMT, DEFAULT_DB
- Index the OPTD data file:
>>> index_trep (xapianDBPath = '/tmp/opentrep/xapian_traveldb', logFilePath = '/tmp/opentrep/opeentrep-indexer.log', verbose = False)
- Search:
>>> main_trep (searchString = 'nce sfo', outputFormat = 'S', xapianDBPath = '/tmp/opentrep/xapian_traveldb', logFilePath = '/tmp/opentrep/opeentrep-searcher.log', verbose = False)
([(89.8466, 'NCE'), (357.45599999999996, 'SFO')], '')
- You may put the package created by
setuptools
in the repository with:
$ export TREP_VER="0.07.4"
$ export TREP_DIR="${HOME}/dev/deliveries/opentrep-latest"
$ export PYTHONPATH=${TREP_DIR}/lib/python3.7/site-packages/pyopentrep:${TREP_DIR}/lib
$ rake
- On MacOS, if there is an issue with the interceptors:
$ ASAN_OPTIONS=detect_container_overflow=0 \
DYLD_INSERT_LIBRARIES=/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib \
/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python test.py
......
----------------------------------------------------------------------
Ran 6 tests in 2.832s
OK
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 Distributions
Close
Hashes for OpenTrepWrapper-0.7.4.post3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a0ab63379f804eb8fa3a8f63e03c900d4f57cf0ad19346a32511b0c56e8980d |
|
MD5 | ff5b5a5bbace308b5c33df2f7136b369 |
|
BLAKE2b-256 | d1a824f18cb98585ce9cdcfe4e0c43b45443f482017dcf2602b20e5e3e7c1192 |
Close
Hashes for OpenTrepWrapper-0.7.4.post3-py3.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a2d15bace143bd40b1c499ec58dca1633f106177d59be08baa92bc848f91626 |
|
MD5 | ba65133a6b6a6be5c491123e110271e9 |
|
BLAKE2b-256 | e3b41f5516dcec3151f941c50c7c6da2b9de21a9fdf1d3f34133b037a5a0f2c8 |
Close
Hashes for OpenTrepWrapper-0.7.4.post3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcb2f19822de7b715e086849197ca8a519914ce079645ad8e52bd77d99490db0 |
|
MD5 | 736cb993d961d5547131fc640f7cc5f9 |
|
BLAKE2b-256 | 129eab1da97ef7bc753ab9e2e99beabde378b1130c6b9803653721e5afcca2d2 |