Package: twingly-search
A Python library for Twingly’s Search API (previously known as Analytics
API). Twingly is a blog search service that provides a searchable API
known asTwingly Search
API.InstallationInstall via PyPIpipinstalltwingly-searchOr addtwingly-searchto your application’srequirements
fileand then runpipinstall-rrequirements.txtOr from source codegitclonehttps://github.com/twingly/twingly-search-api-python.gitcdtwingly-search-api-pythonpythonsetup.pyinstallUsagefromtwingly_searchimportClientclient=Client()q='github page-size: 10 lang:sv tspan:24h'result=client.execute_query(q)forpostinresult.posts:printpost.urlExample code can be found inexamples/.Thetwingly_searchlibrary talks to a commercial blog search API and
requires an API key. Best practice is to set theTWINGLY_SEARCH_KEYenvironment variable to the obtained key.twingly_search.Clientcan
be passed a key at initialization if your setup does not allow
environment variables.To learn more about the capabilities of the API, please read theTwingly Search API
documentation.Documentationtwingly_searchis documented withpydoc. To read the
documentation directly in your console you can runpydoctwingly_searchor you can start a local pydoc web server withpydoc-p1234twingly_searchIn this case documentation will be available athttp://localhost:1234/twingly_search.htmlRequirementsAPI key,sign upviatwingly.comto get onePython 2.7+, 3.0+ withSNIsupport, seeRequests
FAQfor more informationDevelopmentTestsInstall all dependenciesmake localdepsRun the testsmake testReleaseMake the releaseTo be able to publish the package, installtwineand, optionally,python-dotenv:pip install twine
pip install python-dotenv[cli] # optionalIf usingpython-dotenvor equivalent: setTWINE_USERNAMEandTWINE_PASSWORDin.env, using the PyPI username and password.You will needpandocto convert README.md to reStructuredText:brew install pandoc
pip install pypandocBump the version insetup.pyand__init__.py.Create a tag with the same version and push it to GitHub:git tag <VERSION> && git push --follow-tagsPublish toPyPi,
assuming usage ofpython-dotenv:dotenv run ./publish-to-pypi.shUpdate the changelogInstallGitHub Changelog
Generatorif you don’t have itgem install github_changelog_generatorSetCHANGELOG_GITHUB_TOKENto a personal access token to increase
your GitHub API rate limitGenerate the changeloggithub_changelog_generatorLicenseThe MIT License (MIT)Copyright (c) 2016 Twingly ABPermission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
“Software”), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.