feilian 1.1.3__py3-none-any.whl → 1.1.4__py3-none-any.whl

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.

Potentially problematic release.


This version of feilian might be problematic. Click here for more details.

feilian/arg.py CHANGED
@@ -1,6 +1,10 @@
1
1
  # -*- coding: utf-8 -*-
2
2
 
3
- from typing import Union, List, Any, Iterable, Callable, Set, Optional, Tuple, Literal, Dict, Hashable
3
+ from typing import Union, List, Any, Iterable, Callable, Set, Optional, Tuple, Dict, Hashable
4
+ try:
5
+ from typing import Literal
6
+ except ImportError:
7
+ from typing_extensions import Literal
4
8
 
5
9
  _build_in_na_checkers = {
6
10
  'always_na': lambda x: True,
feilian/dataframe.py CHANGED
@@ -4,10 +4,13 @@
4
4
  Encapsulate methods for pandas `DataFrame`.
5
5
  """
6
6
 
7
- from typing import Union, Iterable, Dict, Literal, List, Any, Sequence, Callable, Tuple, Hashable
8
- import os
9
- import warnings
7
+ from typing import Union, Iterable, Dict, List, Any, Sequence, Callable, Tuple, Hashable
8
+ try:
9
+ from typing import Literal
10
+ except ImportError:
11
+ from typing_extensions import Literal
10
12
 
13
+ import os
11
14
  import pandas as pd
12
15
  import random
13
16
  import collections
feilian/json.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  from typing import Dict, List, Union, Any
4
4
  import json
5
+ from .io import ensure_parent_dir_exist
5
6
 
6
7
  def read_json(filepath: str, encoding='utf-8', **kwargs):
7
8
  """
@@ -15,5 +16,6 @@ def save_json(filepath: str, data: Union[Dict[str, Any], List[Any]],
15
16
  """
16
17
  An agent for `json.dump()` with some default value.
17
18
  """
19
+ ensure_parent_dir_exist(filepath)
18
20
  with open(filepath, 'w', encoding=encoding, newline=newline) as f:
19
21
  json.dump(data, f, indent=indent, ensure_ascii=ensure_ascii, **kwargs)
feilian/string.py ADDED
@@ -0,0 +1,13 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ from typing import Any, Callable
4
+
5
+ def join_values(*values: Any, sep='', func: Callable[[Any], str] = str, do_trim=False, ignore_empty=False):
6
+ def f():
7
+ for x in values:
8
+ s = func(x)
9
+ if do_trim:
10
+ s = s.strip()
11
+ if s or not ignore_empty:
12
+ yield s
13
+ return sep.join(f())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: feilian
3
- Version: 1.1.3
3
+ Version: 1.1.4
4
4
  Summary: General data processing tool.
5
5
  Home-page: https://github.com/darkpeath/feilian
6
6
  Author: darkpeath
@@ -0,0 +1,12 @@
1
+ feilian/__init__.py,sha256=D_OYSAfDALQnRsbaAXMnHyC0LtykaIXLTHq7XNcsYjU,763
2
+ feilian/arg.py,sha256=lGZ99RkU9uhE_ziaFK2SClS3vrygteNNxTm3i_68SWw,8359
3
+ feilian/dataframe.py,sha256=121EcLvAkbBWv_antTABTJUaq3MIl1IHh1bPjaPCC0c,9853
4
+ feilian/datetime.py,sha256=IONvWhLeGEy9IVe6GWKEW3FhrfRrShyhGP8-RTf9r3c,763
5
+ feilian/io.py,sha256=aYN3QwWcLoRKzhGMNutqdkmxArVcXfeWXzxCB07LcFc,155
6
+ feilian/json.py,sha256=1GsnL-CASi4xBaycMN-Tw1ytxty7GeL2wmt7nfLfnB4,754
7
+ feilian/string.py,sha256=G_X3dnR0Oxmi4hXF-6E5jm5M7GPjGoMYrSMyI1dj6Z4,370
8
+ feilian/version.py,sha256=qI88ygIU5YG1b7BXxWD6l2jeVvcb78eQ__3BmRl3KCU,217
9
+ feilian-1.1.4.dist-info/METADATA,sha256=pc2HUo4iTEzUOakzR-Js_SiNrdqHyUSg68h_HRw0dh4,911
10
+ feilian-1.1.4.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
11
+ feilian-1.1.4.dist-info/top_level.txt,sha256=1Q2-B6KJrcTr7drW_kik35PTVEUJLPP4wVrn0kYKwGw,8
12
+ feilian-1.1.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.1)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,11 +0,0 @@
1
- feilian/__init__.py,sha256=D_OYSAfDALQnRsbaAXMnHyC0LtykaIXLTHq7XNcsYjU,763
2
- feilian/arg.py,sha256=FrMHVCqwS_wbIzLjuVyPhJM_8IgkNkI7ZxKly7KlIH4,8270
3
- feilian/dataframe.py,sha256=GvMH_NXDX6q21rPz1OP0oCrA0PQS1Av_9qgrUC-h-Fw,9780
4
- feilian/datetime.py,sha256=IONvWhLeGEy9IVe6GWKEW3FhrfRrShyhGP8-RTf9r3c,763
5
- feilian/io.py,sha256=aYN3QwWcLoRKzhGMNutqdkmxArVcXfeWXzxCB07LcFc,155
6
- feilian/json.py,sha256=fcGHxwUEpCVaMkE9HoILC693e1_H-P6J4a8Y_6Locig,676
7
- feilian/version.py,sha256=qI88ygIU5YG1b7BXxWD6l2jeVvcb78eQ__3BmRl3KCU,217
8
- feilian-1.1.3.dist-info/METADATA,sha256=-Ej9JuY2vI6dJxoSuWxR6d9BiT1Dqx0kirGuEO-X8Nw,911
9
- feilian-1.1.3.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
10
- feilian-1.1.3.dist-info/top_level.txt,sha256=1Q2-B6KJrcTr7drW_kik35PTVEUJLPP4wVrn0kYKwGw,8
11
- feilian-1.1.3.dist-info/RECORD,,