9
9
# Python String Utils
10
10
##### Latest version: [ 1.0.0] ( (https://github.com/daveoncode/python-string-utils/blob/master/CHANGELOG.md) )
11
11
12
- An handy library to validate, manipulate and generate strings, which is:
12
+ A handy library to validate, manipulate and generate strings, which is:
13
13
14
14
- Simple and "pythonic"
15
15
- Fully documented!
@@ -24,16 +24,17 @@ An handy library to validate, manipulate and generate strings, which is:
24
24
25
25
### Library structure
26
26
27
- The library is basically a python package ` string_utils ` , containing the following modules:
27
+ The library basically consists in the python package ` string_utils ` , containing the following modules:
28
28
29
29
- ` validation.py ` (contains string check api)
30
30
- ` manipulation.py ` (contains string transformation api)
31
31
- ` generation.py ` (contains string generation api)
32
32
- ` errors.py ` (contains library-specific errors)
33
33
- ` _regex.py ` (contains compiled regex ** FOR INTERNAL USAGE ONLY** )
34
34
35
- plus a secondary package ` tests ` which includes several submodules, specifically one for each test suite and named according to
36
- the api to test (eg. tests for ` is_ip() ` will be in ` test_is_ip.py ` and so on)
35
+ Plus a secondary package ` tests ` which includes several submodules.\
36
+ Specifically one for each test suite and named according to the api to test (eg. tests for ` is_ip() `
37
+ will be in ` test_is_ip.py ` and so on)
37
38
38
39
### Api overview
39
40
@@ -234,7 +235,8 @@ prettify(' unprettified string ,, like this one,will be"prettified" .it\' s awes
234
235
235
236
** asciify** : Converts all non-ascii chars contained in a string into the closest possible ascii representation
236
237
~~~~
237
- asciify('èéùúòóäåëýñÅÀÁÇÌÍÑÓË') # returns 'eeuuooaaeynAAACIINOE' (string is deliberately dumb in order to show char conversion)
238
+ asciify('èéùúòóäåëýñÅÀÁÇÌÍÑÓË')
239
+ # returns 'eeuuooaaeynAAACIINOE' (string is deliberately dumb in order to show char conversion)
238
240
~~~~
239
241
240
242
** slugify** : Convert a string into formatted slug
@@ -286,7 +288,7 @@ roman_encode(37) # returns 'XXXVII'
286
288
roman_decode('XXXVII') # returns 37
287
289
~~~~
288
290
289
- **roman_range**: Generator which returns roman numbers on each iteration
291
+ **roman_range**: Generator which returns roman numbers on each iteration (perhaps one of the most funny api)
290
292
~~~~
291
293
for n in roman_range(10): print(n) # prints: I, II, III, IV, V, VI, VII, VIII, IX, X
292
294
~~~~
@@ -296,6 +298,7 @@ for n in roman_range(10): print(n) # prints: I, II, III, IV, V, VI, VII, VIII, I
296
298
**uuid**: Returns the string representation of a newly created UUID object
297
299
~~~~
298
300
uuid() # possible output: 'ce2cd4ee-83de-46f6-a054-5ee4ddae1582'
301
+ uuid(as_hex=True) # possible output: 'ce2cd4ee83de46f6a0545ee4ddae1582'
299
302
~~~~
300
303
301
304
**random_string**: Creates a string of the specified size with random chars
0 commit comments