Skip to content

Commit 9d906e6

Browse files
authored
Merge pull request #36 from Ryuno-Ki/pypi
Prepare everything for publish on PyPI.
2 parents 4f7d91e + 2b2e83f commit 9d906e6

File tree

10 files changed

+117
-90
lines changed

10 files changed

+117
-90
lines changed

LICENSE renamed to LICENSE.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013 Panayotis Vryonis
3+
Copyright (c) 2013-2014 Panayotis Vryonis
4+
Copyright (c) 2019 André Jaenisch
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy of
67
this software and associated documentation files (the "Software"), to deal in

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include README.md
2-
include LICENSE
1+
include README.rst
2+
include LICENSE.txt
33
include bin/*
44
include webmentiontools/*

README.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

README.rst

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
webmention-tools
2+
================
3+
4+
|CircleCI| |Vulnerabilities| |Coverage| |Maintainability|
5+
6+
Some simple tools in python to deal with webmentions.
7+
8+
Note, that this package was formerly known as
9+
`webmentiontools <https://pypi.org/project/webmentiontools/>`__, but had
10+
to be renamed due to
11+
`PEP-541 <https://www.python.org/dev/peps/pep-0541/>`__. (Namely, not
12+
classified as abandoned project, because the author was reachable).
13+
14+
Currently:
15+
16+
- webmentiontools.send implements WebmentionSend that sends
17+
webmentions.
18+
- webmentiontools.urlinfo implements UrlInfo() that will rerurn usefull
19+
information about a web page, like title, the existance of an
20+
"in-reply-to" link, the author name, the author image, etc.
21+
- webmentiontoold.webmentionio provides a class to query webmention.io
22+
23+
There is also the corresponting command line tool, webmention-tools
24+
(which is also a simple example on how to use the library.
25+
26+
Check `bin/demo.py <./bin/demo.py>`__ on how to use the library to query
27+
webmention.io and present information for all URLs that mentioned
28+
http://indiewebcamp.com/webmention
29+
30+
Installation
31+
============
32+
33+
pip install webmention-tools
34+
35+
Usage
36+
=====
37+
38+
Command line:
39+
40+
::
41+
42+
webmention-tools send `source` `target`
43+
webmention-tools urlinfo `url`
44+
45+
or
46+
47+
Python code to send a webmention:
48+
49+
::
50+
51+
from webmentiontools.send import WebmentionSend
52+
source = 'URL of page sending the webmention'
53+
target = 'URL of page to receive the webmention'
54+
mention = WebmentionSend(source, target)
55+
mention.send()
56+
57+
Python code to get info about a webpage.
58+
59+
::
60+
61+
from webmentiontools.urlinfo import UrlInfo
62+
url = 'a link to a web page'
63+
i = UrlInfo(url)
64+
if i.error:
65+
print('There was an error getting %s' % url)
66+
else:
67+
print('in-reply-to link: %s' % i.inReplyTo())
68+
print('publication date: %s' % i.pubDate())
69+
print('page title: %s' % i.title())
70+
print('image link: %s' % i.image())
71+
72+
Development
73+
===========
74+
75+
1. Create a virtualenv with python3
76+
2. Change into that directory and clone the repository
77+
3. Activate the virtualenv by ``source``\ ing ``bin/activate``
78+
4. Change into the cloned repository and install dependencies via \`pip
79+
install -r requirements.txt'
80+
5. Run ``pytest --cov`` for unit tests with code coverage
81+
82+
.. |CircleCI| image:: https://circleci.com/gh/Ryuno-Ki/webmention-tools.svg?style=svg
83+
:target: https://circleci.com/gh/Ryuno-Ki/webmention-tools
84+
.. |Vulnerabilities| image:: https://img.shields.io/snyk/vulnerabilities/github/Ryuno-Ki/webmention-tools.svg?style=popout
85+
.. |Coverage| image:: https://codecov.io/gh/Ryuno-Ki/webmention-tools/branch/master/graph/badge.svg
86+
:target: https://codecov.io/gh/Ryuno-Ki/webmention-tools
87+
.. |Maintainability| image:: https://api.codeclimate.com/v1/badges/bb63f7d3f38456ea8770/maintainability
88+
:target: https://codeclimate.com/github/Ryuno-Ki/webmention-tools/maintainability

setup.py

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@
22
from webmentiontools import __version__
33

44
setup(version=__version__,
5-
name="webmentiontools",
6-
author="André Jaenisch",
7-
author_email="andre.jaenisch@posteo.de",
5+
name="webmention-tools",
6+
author="Panayotis Vryonis",
7+
author_email="vrypan@gmail.com",
8+
maintainer="André Jaenisch",
9+
maintainer_email="andre.jaenisch@posteo.de",
810
description="Tools for webmention.org.",
9-
long_description=open('README.md').read(),
10-
packages=['webmentiontools'],
11-
install_requires=['beautifulsoup4', 'requests', 'docopt',],
12-
scripts=['bin/webmention-tools'],
13-
url='https://github.com/Ryuno-Ki/webmention-tools',
14-
license='LICENSE',
11+
long_description=open("README.rst").read(),
12+
packages=["webmentiontools",],
13+
install_requires=["beautifulsoup4", "requests", "docopt",],
14+
scripts=["bin/webmention-tools",],
15+
url="https://github.com/Ryuno-Ki/webmention-tools",
16+
license="MIT",
17+
data_files=[("", ["LICENSE.txt",])],
18+
platforms=["Linux",],
19+
keywords=["webmention"],
1520
include_package_data=True,
21+
classifiers=[
22+
"Development Status :: 1 - Planning",
23+
"Environment :: Console",
24+
"Intended Audience :: Developers",
25+
"License :: OSI Approved :: MIT License",
26+
"Operating System :: POSIX :: Linux",
27+
"Programming Language :: Python :: 3.6",
28+
"Programming Language :: Python :: 3.7",
29+
"Topic :: Internet :: WWW/HTTP"
30+
]
1631
)
File renamed without changes.
File renamed without changes.

webmentiontools/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
__version__ = '0.4.0'
4+
__version__ = '0.4.1'

0 commit comments

Comments
 (0)