-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from Ryuno-Ki/pypi
Prepare everything for publish on PyPI.
- Loading branch information
Showing
10 changed files
with
117 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
include README.md | ||
include LICENSE | ||
include README.rst | ||
include LICENSE.txt | ||
include bin/* | ||
include webmentiontools/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
webmention-tools | ||
================ | ||
|
||
|CircleCI| |Vulnerabilities| |Coverage| |Maintainability| | ||
|
||
Some simple tools in python to deal with webmentions. | ||
|
||
Note, that this package was formerly known as | ||
`webmentiontools <https://pypi.org/project/webmentiontools/>`__, but had | ||
to be renamed due to | ||
`PEP-541 <https://www.python.org/dev/peps/pep-0541/>`__. (Namely, not | ||
classified as abandoned project, because the author was reachable). | ||
|
||
Currently: | ||
|
||
- webmentiontools.send implements WebmentionSend that sends | ||
webmentions. | ||
- webmentiontools.urlinfo implements UrlInfo() that will rerurn usefull | ||
information about a web page, like title, the existance of an | ||
"in-reply-to" link, the author name, the author image, etc. | ||
- webmentiontoold.webmentionio provides a class to query webmention.io | ||
|
||
There is also the corresponting command line tool, webmention-tools | ||
(which is also a simple example on how to use the library. | ||
|
||
Check `bin/demo.py <./bin/demo.py>`__ on how to use the library to query | ||
webmention.io and present information for all URLs that mentioned | ||
http://indiewebcamp.com/webmention | ||
|
||
Installation | ||
============ | ||
|
||
pip install webmention-tools | ||
|
||
Usage | ||
===== | ||
|
||
Command line: | ||
|
||
:: | ||
|
||
webmention-tools send `source` `target` | ||
webmention-tools urlinfo `url` | ||
|
||
or | ||
|
||
Python code to send a webmention: | ||
|
||
:: | ||
|
||
from webmentiontools.send import WebmentionSend | ||
source = 'URL of page sending the webmention' | ||
target = 'URL of page to receive the webmention' | ||
mention = WebmentionSend(source, target) | ||
mention.send() | ||
|
||
Python code to get info about a webpage. | ||
|
||
:: | ||
|
||
from webmentiontools.urlinfo import UrlInfo | ||
url = 'a link to a web page' | ||
i = UrlInfo(url) | ||
if i.error: | ||
print('There was an error getting %s' % url) | ||
else: | ||
print('in-reply-to link: %s' % i.inReplyTo()) | ||
print('publication date: %s' % i.pubDate()) | ||
print('page title: %s' % i.title()) | ||
print('image link: %s' % i.image()) | ||
|
||
Development | ||
=========== | ||
|
||
1. Create a virtualenv with python3 | ||
2. Change into that directory and clone the repository | ||
3. Activate the virtualenv by ``source``\ ing ``bin/activate`` | ||
4. Change into the cloned repository and install dependencies via \`pip | ||
install -r requirements.txt' | ||
5. Run ``pytest --cov`` for unit tests with code coverage | ||
|
||
.. |CircleCI| image:: https://circleci.com/gh/Ryuno-Ki/webmention-tools.svg?style=svg | ||
:target: https://circleci.com/gh/Ryuno-Ki/webmention-tools | ||
.. |Vulnerabilities| image:: https://img.shields.io/snyk/vulnerabilities/github/Ryuno-Ki/webmention-tools.svg?style=popout | ||
.. |Coverage| image:: https://codecov.io/gh/Ryuno-Ki/webmention-tools/branch/master/graph/badge.svg | ||
:target: https://codecov.io/gh/Ryuno-Ki/webmention-tools | ||
.. |Maintainability| image:: https://api.codeclimate.com/v1/badges/bb63f7d3f38456ea8770/maintainability | ||
:target: https://codeclimate.com/github/Ryuno-Ki/webmention-tools/maintainability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,15 +2,30 @@ | |
from webmentiontools import __version__ | ||
|
||
setup(version=__version__, | ||
name="webmentiontools", | ||
author="André Jaenisch", | ||
author_email="[email protected]", | ||
name="webmention-tools", | ||
author="Panayotis Vryonis", | ||
author_email="[email protected]", | ||
maintainer="André Jaenisch", | ||
maintainer_email="[email protected]", | ||
description="Tools for webmention.org.", | ||
long_description=open('README.md').read(), | ||
packages=['webmentiontools'], | ||
install_requires=['beautifulsoup4', 'requests', 'docopt',], | ||
scripts=['bin/webmention-tools'], | ||
url='https://github.com/Ryuno-Ki/webmention-tools', | ||
license='LICENSE', | ||
long_description=open("README.rst").read(), | ||
packages=["webmentiontools",], | ||
install_requires=["beautifulsoup4", "requests", "docopt",], | ||
scripts=["bin/webmention-tools",], | ||
url="https://github.com/Ryuno-Ki/webmention-tools", | ||
license="MIT", | ||
data_files=[("", ["LICENSE.txt",])], | ||
platforms=["Linux",], | ||
keywords=["webmention"], | ||
include_package_data=True, | ||
classifiers=[ | ||
"Development Status :: 1 - Planning", | ||
"Environment :: Console", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Topic :: Internet :: WWW/HTTP" | ||
] | ||
) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding: utf-8 -*- | ||
|
||
__version__ = '0.4.0' | ||
__version__ = '0.4.1' |