-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
49 lines (42 loc) · 1.72 KB
/
Copy pathsetup.py
File metadata and controls
49 lines (42 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"""setup.py"""
from distutils.core import setup
setup(name='numutil',
version='0.1.0',
description='Utilities for parsing strings into numbers, and printing numbers as pretty strings',
author='Naftali Harris',
author_email='naftaliharris@gmail.com',
url='www.naftaliharris.com',
packages=['.'],
keywords = ["number", "parse", "text", 'user-entered'],
classifiers = [
"Programming Language :: Python",
"Development Status :: 2 - Pre-Alpha",
"Environment :: Other Environment",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Natural Language :: English",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Linguistic",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content :: CGI Tools/Libraries",
],
long_description = """\
Convert between numbers and strings
-----------------------------------
Strings to Numbers::
>>> from numutil import str2num, num2str
>>> str2num('1.3 million')
1300000
>>> str2num('three and a half')
Fraction(7, 2)
>>> str2num('123,456.789')
123456.789
Numbers to Strings::
>>> num2str(1234567, style='newspaper')
'1.23 million'
>>> num2str(1234567, style='words')
'one million, two hundred thirty four thousand, five hundred sixty seven'
numutil might be useful for people mining data from text, or for people running web apps that need to parse numbers from user-entered strings, or render numbers in a user-friendly format.
"""
)