formatizer 0.1.1__tar.gz → 0.1.2__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,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: formatizer
3
+ Version: 0.1.2
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
+ .. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
35
+ :target: https://codeberg.org/fgimian/formatizer/src/main/LICENSE
36
+ .. |Latest Version| image:: https://img.shields.io/pypi/v/formatizer.svg
37
+ :target: https://pypi.python.org/pypi/formatizer/
38
+ .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/formatizer.svg
39
+ :target: https://pypi.python.org/pypi/formatizer/
40
+
41
+ .. image:: https://codeberg.org/fgimian/formatizer/raw/main/images/formatizer-logo.png
42
+ :alt: Formatizer Logo
43
+
44
+ Artwork courtesy of `Open Clip Art
45
+ Library <https://openclipart.org/detail/75799/registry-book>`_
46
+
47
+ Introduction
48
+ ------------
49
+
50
+ Formatizer provides literal string formatting for Python versions older
51
+ than 3.6. This replaces the need for substitution using ``%`` or the
52
+ ``format`` function.
53
+
54
+ Formatizer is covered by unit tests and Flake8 compliance. Please note
55
+ that this library does use ``eval`` to perform its expression
56
+ processing.
57
+
58
+ Quick Start
59
+ -----------
60
+
61
+ Install Formatizer in your virtualenv as follows:
62
+
63
+ .. code:: bash
64
+
65
+ pip install formatizer
66
+
67
+ And now, go ahead and use the f function similarly to `PEP
68
+ 498 <https://www.python.org/dev/peps/pep-0498/>`_:
69
+
70
+ .. code:: python
71
+
72
+ from __future__ import print_function
73
+ from formatizer import f
74
+
75
+ GREETING = 'hi'
76
+
77
+ def main():
78
+ name = 'Fotis'
79
+ print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
80
+
81
+ if __name__ == '__main__':
82
+ main()
83
+
84
+ All local and global variables will be recognised by the ``f`` function
85
+ and complete Python expressions are also allowed between the braces much
86
+ like Python 3.6.
87
+
88
+ Running Tests
89
+ -------------
90
+
91
+ You may run the unit tests as follows:
92
+
93
+ .. code:: bash
94
+
95
+ git clone https://codeberg.org/fgimian/formatizer.git
96
+ cd formatizer
97
+ python setup.py test
98
+
99
+ License
100
+ -------
101
+
102
+ Formatizer is released under the **MIT** license. Please see the
103
+ `LICENSE <https://codeberg.org/fgimian/formatizer/src/main/LICENSE>`_
104
+ file for more details.
@@ -0,0 +1,76 @@
1
+ Formatizer
2
+ ==========
3
+
4
+ |License| |Latest Version| |Python Versions|
5
+
6
+ .. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
7
+ :target: https://codeberg.org/fgimian/formatizer/src/main/LICENSE
8
+ .. |Latest Version| image:: https://img.shields.io/pypi/v/formatizer.svg
9
+ :target: https://pypi.python.org/pypi/formatizer/
10
+ .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/formatizer.svg
11
+ :target: https://pypi.python.org/pypi/formatizer/
12
+
13
+ .. image:: https://codeberg.org/fgimian/formatizer/raw/main/images/formatizer-logo.png
14
+ :alt: Formatizer Logo
15
+
16
+ Artwork courtesy of `Open Clip Art
17
+ Library <https://openclipart.org/detail/75799/registry-book>`_
18
+
19
+ Introduction
20
+ ------------
21
+
22
+ Formatizer provides literal string formatting for Python versions older
23
+ than 3.6. This replaces the need for substitution using ``%`` or the
24
+ ``format`` function.
25
+
26
+ Formatizer is covered by unit tests and Flake8 compliance. Please note
27
+ that this library does use ``eval`` to perform its expression
28
+ processing.
29
+
30
+ Quick Start
31
+ -----------
32
+
33
+ Install Formatizer in your virtualenv as follows:
34
+
35
+ .. code:: bash
36
+
37
+ pip install formatizer
38
+
39
+ And now, go ahead and use the f function similarly to `PEP
40
+ 498 <https://www.python.org/dev/peps/pep-0498/>`_:
41
+
42
+ .. code:: python
43
+
44
+ from __future__ import print_function
45
+ from formatizer import f
46
+
47
+ GREETING = 'hi'
48
+
49
+ def main():
50
+ name = 'Fotis'
51
+ print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
52
+
53
+ if __name__ == '__main__':
54
+ main()
55
+
56
+ All local and global variables will be recognised by the ``f`` function
57
+ and complete Python expressions are also allowed between the braces much
58
+ like Python 3.6.
59
+
60
+ Running Tests
61
+ -------------
62
+
63
+ You may run the unit tests as follows:
64
+
65
+ .. code:: bash
66
+
67
+ git clone https://codeberg.org/fgimian/formatizer.git
68
+ cd formatizer
69
+ python setup.py test
70
+
71
+ License
72
+ -------
73
+
74
+ Formatizer is released under the **MIT** license. Please see the
75
+ `LICENSE <https://codeberg.org/fgimian/formatizer/src/main/LICENSE>`_
76
+ file for more details.
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: formatizer
3
+ Version: 0.1.2
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
+ .. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg
35
+ :target: https://codeberg.org/fgimian/formatizer/src/main/LICENSE
36
+ .. |Latest Version| image:: https://img.shields.io/pypi/v/formatizer.svg
37
+ :target: https://pypi.python.org/pypi/formatizer/
38
+ .. |Python Versions| image:: https://img.shields.io/pypi/pyversions/formatizer.svg
39
+ :target: https://pypi.python.org/pypi/formatizer/
40
+
41
+ .. image:: https://codeberg.org/fgimian/formatizer/raw/main/images/formatizer-logo.png
42
+ :alt: Formatizer Logo
43
+
44
+ Artwork courtesy of `Open Clip Art
45
+ Library <https://openclipart.org/detail/75799/registry-book>`_
46
+
47
+ Introduction
48
+ ------------
49
+
50
+ Formatizer provides literal string formatting for Python versions older
51
+ than 3.6. This replaces the need for substitution using ``%`` or the
52
+ ``format`` function.
53
+
54
+ Formatizer is covered by unit tests and Flake8 compliance. Please note
55
+ that this library does use ``eval`` to perform its expression
56
+ processing.
57
+
58
+ Quick Start
59
+ -----------
60
+
61
+ Install Formatizer in your virtualenv as follows:
62
+
63
+ .. code:: bash
64
+
65
+ pip install formatizer
66
+
67
+ And now, go ahead and use the f function similarly to `PEP
68
+ 498 <https://www.python.org/dev/peps/pep-0498/>`_:
69
+
70
+ .. code:: python
71
+
72
+ from __future__ import print_function
73
+ from formatizer import f
74
+
75
+ GREETING = 'hi'
76
+
77
+ def main():
78
+ name = 'Fotis'
79
+ print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))
80
+
81
+ if __name__ == '__main__':
82
+ main()
83
+
84
+ All local and global variables will be recognised by the ``f`` function
85
+ and complete Python expressions are also allowed between the braces much
86
+ like Python 3.6.
87
+
88
+ Running Tests
89
+ -------------
90
+
91
+ You may run the unit tests as follows:
92
+
93
+ .. code:: bash
94
+
95
+ git clone https://codeberg.org/fgimian/formatizer.git
96
+ cd formatizer
97
+ python setup.py test
98
+
99
+ License
100
+ -------
101
+
102
+ Formatizer is released under the **MIT** license. Please see the
103
+ `LICENSE <https://codeberg.org/fgimian/formatizer/src/main/LICENSE>`_
104
+ 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.2',
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