diff --git a/LICENSE b/LICENSE.txt similarity index 93% rename from LICENSE rename to LICENSE.txt index ecaaf66..efaa120 100644 --- a/LICENSE +++ b/LICENSE.txt @@ -1,6 +1,7 @@ The MIT License (MIT) -Copyright (c) 2013 Panayotis Vryonis +Copyright (c) 2013-2014 Panayotis Vryonis +Copyright (c) 2019 André Jaenisch Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/MANIFEST.in b/MANIFEST.in index 688bb8a..5d5a9ab 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ -include README.md -include LICENSE +include README.rst +include LICENSE.txt include bin/* include webmentiontools/* diff --git a/README.md b/README.md deleted file mode 100644 index 666d381..0000000 --- a/README.md +++ /dev/null @@ -1,77 +0,0 @@ -webmention-tools -================ - -[![CircleCI](https://circleci.com/gh/Ryuno-Ki/webmention-tools.svg?style=svg)](https://circleci.com/gh/Ryuno-Ki/webmention-tools) -![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/github/Ryuno-Ki/webmention-tools.svg?style=popout) -[![Coverage](https://codecov.io/gh/Ryuno-Ki/webmention-tools/branch/master/graph/badge.svg)](https://codecov.io/gh/Ryuno-Ki/webmention-tools) -[![Maintainability](https://api.codeclimate.com/v1/badges/bb63f7d3f38456ea8770/maintainability)](https://codeclimate.com/github/Ryuno-Ki/webmention-tools/maintainability) - -Some simple tools in python to deal with webmentions. - - - -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 webmentiontools - -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 diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..4e9cc7d --- /dev/null +++ b/README.rst @@ -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 `__, but had +to be renamed due to +`PEP-541 `__. (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 diff --git a/setup.py b/setup.py index f080423..1a9d33c 100644 --- a/setup.py +++ b/setup.py @@ -2,15 +2,30 @@ from webmentiontools import __version__ setup(version=__version__, - name="webmentiontools", - author="André Jaenisch", - author_email="andre.jaenisch@posteo.de", + name="webmention-tools", + author="Panayotis Vryonis", + author_email="vrypan@gmail.com", + maintainer="André Jaenisch", + maintainer_email="andre.jaenisch@posteo.de", 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" + ] ) diff --git a/tests/__init__.py b/test/__init__.py similarity index 100% rename from tests/__init__.py rename to test/__init__.py diff --git a/tests/test_send.py b/test/test_send.py similarity index 100% rename from tests/test_send.py rename to test/test_send.py diff --git a/tests/test_urlinfo.py b/test/test_urlinfo.py similarity index 100% rename from tests/test_urlinfo.py rename to test/test_urlinfo.py diff --git a/tests/test_webmentionio.py b/test/test_webmentionio.py similarity index 100% rename from tests/test_webmentionio.py rename to test/test_webmentionio.py diff --git a/webmentiontools/__init__.py b/webmentiontools/__init__.py index 66f16e1..952863c 100644 --- a/webmentiontools/__init__.py +++ b/webmentiontools/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python3 # -*- coding: utf-8 -*- -__version__ = '0.4.0' +__version__ = '0.4.1'