Skip to content

Commit

Permalink
Merge pull request #36 from Ryuno-Ki/pypi
Browse files Browse the repository at this point in the history
Prepare everything for publish on PyPI.
  • Loading branch information
Ryuno-Ki authored May 1, 2019
2 parents 4f7d91e + 2b2e83f commit 9d906e6
Show file tree
Hide file tree
Showing 10 changed files with 117 additions and 90 deletions.
3 changes: 2 additions & 1 deletion LICENSE → LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
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/*
77 changes: 0 additions & 77 deletions README.md

This file was deleted.

88 changes: 88 additions & 0 deletions README.rst
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
33 changes: 24 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion webmentiontools/__init__.py
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'

0 comments on commit 9d906e6

Please sign in to comment.