formatizer 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.4
2
+ Name: formatizer
3
+ Version: 0.1.3
4
+ Summary: Literal string formatting for Python versions older than 3.6
5
+ Home-page: https://codeberg.org/fgimian/formatizer
6
+ Author: Fotis Gimian
7
+ Author-email: fgimiansoftware@gmail.com
8
+ License: MIT
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 2.7
15
+ Classifier: Programming Language :: Python :: 3.4
16
+ Classifier: Programming Language :: Python :: 3.5
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Classifier: Topic :: Utilities
19
+ License-File: LICENSE
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: license-file
27
+ Dynamic: summary
28
+
29
+ Formatizer
30
+ ==========
31
+
32
+ |License| |Latest Version| |Python Versions|
33
+
34
+ |Logo|
35
+
36
+ .. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
37
+ :target: https://codeberg.org/fgimian/formatizer/src/main/LICENSE
38
+ .. |Latest Version| image:: https://img.shields.io/pypi/v/formatizer.svg
39
+ :target: https://pypi.python.org/pypi/formatizer/
40
+ .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/formatizer.svg
41
+ :target: https://pypi.python.org/pypi/formatizer/
42
+ .. |Logo| image:: https://codeberg.org/fgimian/formatizer/raw/main/images/formatizer-logo.png
43
+ :alt: Formatizer Logo
44
+
45
+ Artwork courtesy of `Open Clip Art
46
+ Library <https://openclipart.org/detail/75799/registry-book>`_
47
+
48
+ Introduction
49
+ ------------
50
+
51
+ Formatizer provides literal string formatting for Python versions older
52
+ than 3.6. This replaces the need for substitution using ``%`` or the
53
+ ``format`` function.
54
+
55
+ Formatizer is covered by unit tests and Flake8 compliance. Please note
56
+ that this library does use ``eval`` to perform its expression
57
+ processing.
58
+
59
+ Quick Start
60
+ -----------
61
+
62
+ Install Formatizer in your virtualenv as follows:
63
+
64
+ .. code:: bash
65
+
66
+ pip install formatizer
67
+
68
+ And now, go ahead and use the f function similarly to `PEP
69
+ 498 <https://www.python.org/dev/peps/pep-0498/>`_:
70
+
71
+ .. code:: python
72
+
73
+ from __future__ import print_function
74
+ from formatizer import f
75
+
76
+ GREETING = 'hi'
77
+
78
+ def main():
79
+ name = 'Fotis'
80
+ print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
81
+
82
+ if __name__ == '__main__':
83
+ main()
84
+
85
+ All local and global variables will be recognised by the ``f`` function
86
+ and complete Python expressions are also allowed between the braces much
87
+ like Python 3.6.
88
+
89
+ Running Tests
90
+ -------------
91
+
92
+ You may run the unit tests as follows:
93
+
94
+ .. code:: bash
95
+
96
+ git clone https://codeberg.org/fgimian/formatizer.git
97
+ cd formatizer
98
+ python setup.py test
99
+
100
+ License
101
+ -------
102
+
103
+ Formatizer is released under the **MIT** license. Please see the
104
+ `LICENSE <https://codeberg.org/fgimian/formatizer/src/main/LICENSE>`_
105
+ file for more details.
@@ -0,0 +1,77 @@
1
+ Formatizer
2
+ ==========
3
+
4
+ |License| |Latest Version| |Python Versions|
5
+
6
+ |Logo|
7
+
8
+ .. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
9
+ :target: https://codeberg.org/fgimian/formatizer/src/main/LICENSE
10
+ .. |Latest Version| image:: https://img.shields.io/pypi/v/formatizer.svg
11
+ :target: https://pypi.python.org/pypi/formatizer/
12
+ .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/formatizer.svg
13
+ :target: https://pypi.python.org/pypi/formatizer/
14
+ .. |Logo| image:: https://codeberg.org/fgimian/formatizer/raw/main/images/formatizer-logo.png
15
+ :alt: Formatizer Logo
16
+
17
+ Artwork courtesy of `Open Clip Art
18
+ Library <https://openclipart.org/detail/75799/registry-book>`_
19
+
20
+ Introduction
21
+ ------------
22
+
23
+ Formatizer provides literal string formatting for Python versions older
24
+ than 3.6. This replaces the need for substitution using ``%`` or the
25
+ ``format`` function.
26
+
27
+ Formatizer is covered by unit tests and Flake8 compliance. Please note
28
+ that this library does use ``eval`` to perform its expression
29
+ processing.
30
+
31
+ Quick Start
32
+ -----------
33
+
34
+ Install Formatizer in your virtualenv as follows:
35
+
36
+ .. code:: bash
37
+
38
+ pip install formatizer
39
+
40
+ And now, go ahead and use the f function similarly to `PEP
41
+ 498 <https://www.python.org/dev/peps/pep-0498/>`_:
42
+
43
+ .. code:: python
44
+
45
+ from __future__ import print_function
46
+ from formatizer import f
47
+
48
+ GREETING = 'hi'
49
+
50
+ def main():
51
+ name = 'Fotis'
52
+ print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
53
+
54
+ if __name__ == '__main__':
55
+ main()
56
+
57
+ All local and global variables will be recognised by the ``f`` function
58
+ and complete Python expressions are also allowed between the braces much
59
+ like Python 3.6.
60
+
61
+ Running Tests
62
+ -------------
63
+
64
+ You may run the unit tests as follows:
65
+
66
+ .. code:: bash
67
+
68
+ git clone https://codeberg.org/fgimian/formatizer.git
69
+ cd formatizer
70
+ python setup.py test
71
+
72
+ License
73
+ -------
74
+
75
+ Formatizer is released under the **MIT** license. Please see the
76
+ `LICENSE <https://codeberg.org/fgimian/formatizer/src/main/LICENSE>`_
77
+ file for more details.
@@ -0,0 +1,105 @@
1
+ Metadata-Version: 2.4
2
+ Name: formatizer
3
+ Version: 0.1.3
4
+ Summary: Literal string formatting for Python versions older than 3.6
5
+ Home-page: https://codeberg.org/fgimian/formatizer
6
+ Author: Fotis Gimian
7
+ Author-email: fgimiansoftware@gmail.com
8
+ License: MIT
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 2.7
15
+ Classifier: Programming Language :: Python :: 3.4
16
+ Classifier: Programming Language :: Python :: 3.5
17
+ Classifier: Topic :: Software Development :: Libraries
18
+ Classifier: Topic :: Utilities
19
+ License-File: LICENSE
20
+ Dynamic: author
21
+ Dynamic: author-email
22
+ Dynamic: classifier
23
+ Dynamic: description
24
+ Dynamic: home-page
25
+ Dynamic: license
26
+ Dynamic: license-file
27
+ Dynamic: summary
28
+
29
+ Formatizer
30
+ ==========
31
+
32
+ |License| |Latest Version| |Python Versions|
33
+
34
+ |Logo|
35
+
36
+ .. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
37
+ :target: https://codeberg.org/fgimian/formatizer/src/main/LICENSE
38
+ .. |Latest Version| image:: https://img.shields.io/pypi/v/formatizer.svg
39
+ :target: https://pypi.python.org/pypi/formatizer/
40
+ .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/formatizer.svg
41
+ :target: https://pypi.python.org/pypi/formatizer/
42
+ .. |Logo| image:: https://codeberg.org/fgimian/formatizer/raw/main/images/formatizer-logo.png
43
+ :alt: Formatizer Logo
44
+
45
+ Artwork courtesy of `Open Clip Art
46
+ Library <https://openclipart.org/detail/75799/registry-book>`_
47
+
48
+ Introduction
49
+ ------------
50
+
51
+ Formatizer provides literal string formatting for Python versions older
52
+ than 3.6. This replaces the need for substitution using ``%`` or the
53
+ ``format`` function.
54
+
55
+ Formatizer is covered by unit tests and Flake8 compliance. Please note
56
+ that this library does use ``eval`` to perform its expression
57
+ processing.
58
+
59
+ Quick Start
60
+ -----------
61
+
62
+ Install Formatizer in your virtualenv as follows:
63
+
64
+ .. code:: bash
65
+
66
+ pip install formatizer
67
+
68
+ And now, go ahead and use the f function similarly to `PEP
69
+ 498 <https://www.python.org/dev/peps/pep-0498/>`_:
70
+
71
+ .. code:: python
72
+
73
+ from __future__ import print_function
74
+ from formatizer import f
75
+
76
+ GREETING = 'hi'
77
+
78
+ def main():
79
+ name = 'Fotis'
80
+ print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
81
+
82
+ if __name__ == '__main__':
83
+ main()
84
+
85
+ All local and global variables will be recognised by the ``f`` function
86
+ and complete Python expressions are also allowed between the braces much
87
+ like Python 3.6.
88
+
89
+ Running Tests
90
+ -------------
91
+
92
+ You may run the unit tests as follows:
93
+
94
+ .. code:: bash
95
+
96
+ git clone https://codeberg.org/fgimian/formatizer.git
97
+ cd formatizer
98
+ python setup.py test
99
+
100
+ License
101
+ -------
102
+
103
+ Formatizer is released under the **MIT** license. Please see the
104
+ `LICENSE <https://codeberg.org/fgimian/formatizer/src/main/LICENSE>`_
105
+ file for more details.
@@ -7,7 +7,7 @@ if PY3: # pragma: no cover
7
7
 
8
8
 
9
9
  class LiteralFormatter(object):
10
- def format(self, format_string, globals, locals, recursion_depth=2):
10
+ def format(self, format_string, globals_, locals_, recursion_depth=2):
11
11
  if recursion_depth < 0:
12
12
  raise ValueError('Max string recursion exceeded')
13
13
 
@@ -23,9 +23,9 @@ class LiteralFormatter(object):
23
23
 
24
24
  # An expression (e.g. '{1 + 2}')
25
25
  if expression is not None:
26
- obj = eval(expression, globals, locals)
26
+ obj = eval(expression, globals_, locals_)
27
27
  obj = self.convert_field(obj, conversion)
28
- format_spec = self.format(format_spec, globals, locals,
28
+ format_spec = self.format(format_spec, globals_, locals_,
29
29
  recursion_depth - 1)
30
30
  result.append(format(obj, format_spec))
31
31
 
@@ -1,12 +1,11 @@
1
- [pytest]
2
- addopts = -s --cov=formatizer --cov-report=term-missing --flake8
3
- flake8-ignore = F841
4
-
5
- [flake8]
6
- ignore = F841
7
-
8
- [egg_info]
9
- tag_build =
10
- tag_date = 0
11
- tag_svn_revision = 0
12
-
1
+ [tool:pytest]
2
+ addopts = -s --cov=formatizer --cov-report=term-missing --flake8
3
+ flake8-ignore = F841
4
+
5
+ [flake8]
6
+ ignore = F841
7
+
8
+ [egg_info]
9
+ tag_build =
10
+ tag_date = 0
11
+
@@ -30,12 +30,12 @@ with open('README.rst') as f:
30
30
 
31
31
  setup(
32
32
  name='formatizer',
33
- version='0.1.1',
33
+ version='0.1.3',
34
34
  description='Literal string formatting for Python versions older than 3.6',
35
35
  long_description=long_description,
36
36
  author='Fotis Gimian',
37
37
  author_email='fgimiansoftware@gmail.com',
38
- url='https://github.com/fgimian/formatizer',
38
+ url='https://codeberg.org/fgimian/formatizer',
39
39
  license='MIT',
40
40
  py_modules=['formatizer'],
41
41
  tests_require=['pytest-cov', 'pytest-flake8', 'pytest-sugar', 'pytest'],
@@ -46,9 +46,7 @@ setup(
46
46
  'License :: OSI Approved :: MIT License',
47
47
  'Operating System :: OS Independent',
48
48
  'Programming Language :: Python',
49
- 'Programming Language :: Python :: 2.6',
50
49
  'Programming Language :: Python :: 2.7',
51
- 'Programming Language :: Python :: 3.3',
52
50
  'Programming Language :: Python :: 3.4',
53
51
  'Programming Language :: Python :: 3.5',
54
52
  'Topic :: Software Development :: Libraries',
formatizer-0.1.1/PKG-INFO DELETED
@@ -1,76 +0,0 @@
1
- Metadata-Version: 1.1
2
- Name: formatizer
3
- Version: 0.1.1
4
- Summary: Literal string formatting for Python versions older than 3.6
5
- Home-page: https://github.com/fgimian/formatizer
6
- Author: Fotis Gimian
7
- Author-email: fgimiansoftware@gmail.com
8
- License: MIT
9
- Description: Formatizer
10
- ==========
11
-
12
- |Build Status| |Coverage Status|
13
-
14
- .. |Build Status| image:: https://travis-ci.org/fgimian/formatizer.svg?branch=master
15
- :target: https://travis-ci.org/fgimian/formatizer
16
- .. |Coverage Status| image:: https://coveralls.io/repos/fgimian/formatizer/badge.png
17
- :target: https://coveralls.io/r/fgimian/formatizer
18
-
19
- .. image:: https://raw.githubusercontent.com/fgimian/formatizer/master/images/formatizer-logo.png
20
- :height: 225px
21
- :alt: Formatizer Logo
22
-
23
- Awesome artwork provided courtesy of `Open Clip Art
24
- Library <https://openclipart.org/detail/75799/registry-book>`__
25
-
26
- Formatizer provides literal string formatting for Python versions older
27
- than 3.6. This replaces the need for substitution using ``%`` or the
28
- ``format`` function.
29
-
30
- Formatizer is covered by unit tests and Flake8 compliance. Please note
31
- that this library does use ``eval`` to perform its expression
32
- processing.
33
-
34
- Quick Start
35
- -----------
36
-
37
- Install Formatizer in your virtualenv as follows:
38
-
39
- .. code:: bash
40
-
41
- pip install formatizer
42
-
43
- And now, go ahead and use the f function similarly to `PEP
44
- 498 <https://www.python.org/dev/peps/pep-0498/>`__:
45
-
46
- .. code:: python
47
-
48
- from __future__ import print_function
49
- from formatizer import f
50
-
51
- GREETING = 'hi'
52
-
53
- def main():
54
- name = 'Fotis'
55
- print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
56
-
57
- if __name__ == '__main__':
58
- main()
59
-
60
- All local and global variables will be recognised by the ``f`` function
61
- and complete Python expressions are also allowed between the braces much
62
- like Python 3.6.
63
-
64
- Platform: UNKNOWN
65
- Classifier: Development Status :: 4 - Beta
66
- Classifier: Intended Audience :: Developers
67
- Classifier: License :: OSI Approved :: MIT License
68
- Classifier: Operating System :: OS Independent
69
- Classifier: Programming Language :: Python
70
- Classifier: Programming Language :: Python :: 2.6
71
- Classifier: Programming Language :: Python :: 2.7
72
- Classifier: Programming Language :: Python :: 3.3
73
- Classifier: Programming Language :: Python :: 3.4
74
- Classifier: Programming Language :: Python :: 3.5
75
- Classifier: Topic :: Software Development :: Libraries
76
- Classifier: Topic :: Utilities
@@ -1,54 +0,0 @@
1
- Formatizer
2
- ==========
3
-
4
- |Build Status| |Coverage Status|
5
-
6
- .. |Build Status| image:: https://travis-ci.org/fgimian/formatizer.svg?branch=master
7
- :target: https://travis-ci.org/fgimian/formatizer
8
- .. |Coverage Status| image:: https://coveralls.io/repos/fgimian/formatizer/badge.png
9
- :target: https://coveralls.io/r/fgimian/formatizer
10
-
11
- .. image:: https://raw.githubusercontent.com/fgimian/formatizer/master/images/formatizer-logo.png
12
- :height: 225px
13
- :alt: Formatizer Logo
14
-
15
- Awesome artwork provided courtesy of `Open Clip Art
16
- Library <https://openclipart.org/detail/75799/registry-book>`__
17
-
18
- Formatizer provides literal string formatting for Python versions older
19
- than 3.6. This replaces the need for substitution using ``%`` or the
20
- ``format`` function.
21
-
22
- Formatizer is covered by unit tests and Flake8 compliance. Please note
23
- that this library does use ``eval`` to perform its expression
24
- processing.
25
-
26
- Quick Start
27
- -----------
28
-
29
- Install Formatizer in your virtualenv as follows:
30
-
31
- .. code:: bash
32
-
33
- pip install formatizer
34
-
35
- And now, go ahead and use the f function similarly to `PEP
36
- 498 <https://www.python.org/dev/peps/pep-0498/>`__:
37
-
38
- .. code:: python
39
-
40
- from __future__ import print_function
41
- from formatizer import f
42
-
43
- GREETING = 'hi'
44
-
45
- def main():
46
- name = 'Fotis'
47
- print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
48
-
49
- if __name__ == '__main__':
50
- main()
51
-
52
- All local and global variables will be recognised by the ``f`` function
53
- and complete Python expressions are also allowed between the braces much
54
- like Python 3.6.
@@ -1,76 +0,0 @@
1
- Metadata-Version: 1.1
2
- Name: formatizer
3
- Version: 0.1.1
4
- Summary: Literal string formatting for Python versions older than 3.6
5
- Home-page: https://github.com/fgimian/formatizer
6
- Author: Fotis Gimian
7
- Author-email: fgimiansoftware@gmail.com
8
- License: MIT
9
- Description: Formatizer
10
- ==========
11
-
12
- |Build Status| |Coverage Status|
13
-
14
- .. |Build Status| image:: https://travis-ci.org/fgimian/formatizer.svg?branch=master
15
- :target: https://travis-ci.org/fgimian/formatizer
16
- .. |Coverage Status| image:: https://coveralls.io/repos/fgimian/formatizer/badge.png
17
- :target: https://coveralls.io/r/fgimian/formatizer
18
-
19
- .. image:: https://raw.githubusercontent.com/fgimian/formatizer/master/images/formatizer-logo.png
20
- :height: 225px
21
- :alt: Formatizer Logo
22
-
23
- Awesome artwork provided courtesy of `Open Clip Art
24
- Library <https://openclipart.org/detail/75799/registry-book>`__
25
-
26
- Formatizer provides literal string formatting for Python versions older
27
- than 3.6. This replaces the need for substitution using ``%`` or the
28
- ``format`` function.
29
-
30
- Formatizer is covered by unit tests and Flake8 compliance. Please note
31
- that this library does use ``eval`` to perform its expression
32
- processing.
33
-
34
- Quick Start
35
- -----------
36
-
37
- Install Formatizer in your virtualenv as follows:
38
-
39
- .. code:: bash
40
-
41
- pip install formatizer
42
-
43
- And now, go ahead and use the f function similarly to `PEP
44
- 498 <https://www.python.org/dev/peps/pep-0498/>`__:
45
-
46
- .. code:: python
47
-
48
- from __future__ import print_function
49
- from formatizer import f
50
-
51
- GREETING = 'hi'
52
-
53
- def main():
54
- name = 'Fotis'
55
- print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
56
-
57
- if __name__ == '__main__':
58
- main()
59
-
60
- All local and global variables will be recognised by the ``f`` function
61
- and complete Python expressions are also allowed between the braces much
62
- like Python 3.6.
63
-
64
- Platform: UNKNOWN
65
- Classifier: Development Status :: 4 - Beta
66
- Classifier: Intended Audience :: Developers
67
- Classifier: License :: OSI Approved :: MIT License
68
- Classifier: Operating System :: OS Independent
69
- Classifier: Programming Language :: Python
70
- Classifier: Programming Language :: Python :: 2.6
71
- Classifier: Programming Language :: Python :: 2.7
72
- Classifier: Programming Language :: Python :: 3.3
73
- Classifier: Programming Language :: Python :: 3.4
74
- Classifier: Programming Language :: Python :: 3.5
75
- Classifier: Topic :: Software Development :: Libraries
76
- Classifier: Topic :: Utilities
File without changes
File without changes