Skip to content

Commit 489ca04

Browse files
committed
preparing for V1.0.0 release
1 parent be4d2e3 commit 489ca04

File tree

3 files changed

+79
-33
lines changed

3 files changed

+79
-33
lines changed

README.rst

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,75 @@
11
twitter-text-python
22
===================
33

4-
**twitter-text-python** is a Tweet parser and formatter for Python.
4+
**twitter-text-python** is a Tweet parser and formatter for Python. Extract users, hashtags, URLs and format as HTML for display.
55

66
It is based on twitter-text-java_ and passes all the unittests of
77
twitter-text-conformance_ plus some additional ones.
88

99
.. _twitter-text-java: http://github.com/mzsanford/twitter-text-java
1010
.. _twitter-text-conformance: http://github.com/mzsanford/twitter-text-conformance
1111

12-
UPDATE - forked by Ian Ozsvald, some bugs fixed, few minor changes to functionality added:
12+
This version was forked by Ian Ozsvald in January 2013 and released to PyPI, some bugs were fixed, a few minor changes to functionality added:
1313
https://github.com/ianozsvald/twitter-text-python
1414

15-
The original ttp comes from:
15+
PyPI release:
16+
http://pypi.python.org/pypi/twitter-text-python/
17+
18+
The original ttp comes from Ivo Wetzel (Ivo's version no longer supported):
1619
https://github.com/BonsaiDen/twitter-text-python
1720

1821
Usage::
1922

2023
>>> import ttp
2124
>>> p = ttp.Parser()
22-
>>> result = p.parse("@BonsaiDen Hey that's a great Tweet parser! #twp")
25+
>>> result = p.parse("@ianozsvald, you now support #IvoWertzel's tweet parser! https://github.com/ianozsvald/")
2326
>>> result.reply
24-
'BonsaiDen'
27+
'ianozsvald'
2528
>>> result.users
26-
['BonsaiDen']
29+
['ianozsvald']
2730
>>> result.tags
28-
['twp']
31+
['IvoWertzel']
2932
>>> result.urls
30-
[]
33+
['https://github.com/ianozsvald/']
3134
>>> result.html
32-
u'<a href="http://twitter.com/BonsaiDen">@BonsaiDen</a> Hey that\'s a great Tweet Parser!
33-
<a href="http://search.twitter.com/search?q=%23twp">#twp</a>'
34-
35+
u'<a href="http://twitter.com/ianozsvald">@ianozsvald</a>, you now support <a href="http://search.twitter.com/search?q=%23IvoWertzel">#IvoWertzel</a>\'s tweet parser! <a href="https://github.com/ianozsvald/">https://github.com/ianozsvald/</a>'
3536

3637
If you need different HTML output just subclass and override the ``format_*`` methods.
3738

39+
You can also ask for the span tags to be returned for each entity::
40+
41+
>>> p = ttp.Parser(include_spans=True)
42+
>>> result = p.parse("@ianozsvald, you now support #IvoWertzel's tweet parser! https://github.com/ianozsvald/")
43+
>>> result.urls
44+
[('https://github.com/ianozsvald/', (57, 87))]
45+
46+
47+
48+
Installation
49+
------------
50+
51+
$ pip install twitter-text-python # via: http://pypi.python.org/pypi/twitter-text-python
52+
$ python
53+
>>> import ttp
54+
>>> ttp.__version__
55+
'1.0.0'
56+
57+
58+
Changelog
59+
---------
60+
61+
* 2013/2/11 1.0.0 released to PyPI
62+
63+
64+
Tests
65+
-----
66+
67+
$ python tests.py
68+
.................................................................................................
69+
----------------------------------------------------------------------
70+
Ran 97 tests in 0.009s
71+
OK
72+
3873

3974
Contributing
4075
------------
@@ -43,23 +78,32 @@ The source is available on GitHub_, to
4378
contribute to the project, fork it on GitHub and send a pull request.
4479
Everyone is welcome to make improvements to **twp**!
4580

46-
.. _GitHub: http://github.com/BonsaiDen/twitter-text-python
81+
.. _GitHub: https://github.com/ianozsvald/twitter-text-python
82+
4783

4884
License
49-
=======
85+
-------
86+
87+
*MIT*
5088

51-
Copyright (c) 2010 Ivo Wetzel
89+
Copyright (c) 2012 Ivo Wetzel.
5290

53-
**twitter-text-python** is free software: you can redistribute it and/or
54-
modify it under the terms of the GNU General Public License as published by
55-
the Free Software Foundation, either version 3 of the License, or
56-
(at your option) any later version.
91+
Permission is hereby granted, free of charge, to any person obtaining a copy
92+
of this software and associated documentation files (the "Software"), to deal
93+
in the Software without restriction, including without limitation the rights
94+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
95+
copies of the Software, and to permit persons to whom the Software is
96+
furnished to do so, subject to the following conditions:
5797

58-
**twitter-text-python** is distributed in the hope that it will be useful,
59-
but WITHOUT ANY WARRANTY; without even the implied warranty of
60-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
61-
GNU General Public License for more details.
98+
The above copyright notice and this permission notice shall be included in
99+
all copies or substantial portions of the Software.
62100

63-
You should have received a copy of the GNU General Public License along with
64-
**twitter-text-python**. If not, see <http://www.gnu.org/licenses/>.
101+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
107+
THE SOFTWARE.
65108

109+
Copyright (c) 2010-2013 Ivo Wetzel

setup.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
setup(
44
name='twitter-text-python',
55
version='1.0',
6-
description='Tweet parser and formatter',
7-
long_description=open('README.rst').read(),
8-
author='Ivo Wetzel (fork by Ian Ozsvald)',
9-
author_email='',
6+
description='Twitter Tweet parser and formatter',
7+
long_description="no long description", #open('README.rst').read(),
8+
author='Maintained by Ian Ozsvald (originally by Ivo Wetzel)',
9+
author_email='ian@ianozsvald.com',
1010
url='https://github.com/ianozsvald/twitter-text-python',
11-
license='GPL',
12-
py_modules=['ttp'],
11+
license='MIT',
12+
py_modules=['ttp', 'tests'],
1313
include_package_data=True,
1414
zip_safe=False,
1515
install_requires=[],
16+
#data_files=[('./', ['README.rst'])],
1617
classifiers=[
17-
'Environment :: Web Environment',
18-
# I don't know what exactly this means, but why not?
18+
'Environment :: Console',
1919
'Intended Audience :: Developers',
20-
'License :: OSI Approved :: BSD License',
20+
#'License :: OSI Approved :: GPL License',
2121
'Operating System :: OS Independent',
2222
'Programming Language :: Python',
2323
'Topic :: Software Development :: Libraries :: Python Modules',

ttp.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import re
2626
import urllib
2727

28+
__version__ = "1.0.0"
29+
2830
# Some of this code has been translated from the twitter-text-java library:
2931
# <http://github.com/mzsanford/twitter-text-java>
3032
AT_SIGNS = ur'[@\uff20]'

0 commit comments

Comments
 (0)