contentintelpy 0.1.1__py3-none-any.whl → 0.1.3__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.
@@ -1,6 +1,44 @@
1
1
  from .pipeline.pipeline import Pipeline
2
2
  from .pipeline.context import PipelineContext
3
3
  from .pipeline.base_node import Node
4
+ import importlib
5
+ import sys
6
+
7
+ def _show_welcome_hint():
8
+ """Shows a one-time setup hint if core optional dependencies are missing."""
9
+ try:
10
+ importlib.import_module("transformers")
11
+ except ImportError:
12
+ # ANSI escape codes for color
13
+ YELLOW = "\033[93m"
14
+ RESET = "\033[0m"
15
+ BOLD = "\033[1m"
16
+
17
+ # Core [core] extra is missing
18
+ print(f"\n{YELLOW}{'═'*60}")
19
+ print(f"{BOLD}Welcome to ContentIntelPy!{RESET}{YELLOW}")
20
+ print("═"*60)
21
+ print("You've installed the base package. To unlock the full power of")
22
+ print("the Content Intelligence Pipeline, install the extras below:")
23
+
24
+ print(f"\n{BOLD}📦 FULL INSTALLATION (Recommended){RESET}{YELLOW}")
25
+ print(" pip install \"contentintelpy[core,ner,translation,summarization]\"")
26
+
27
+ print(f"\n{BOLD}🛠️ CAPABILITIES BY EXTRA:{RESET}{YELLOW}")
28
+ print(" [core] -> Sentiment, Classification, Keywords, Language Detection")
29
+ print(" [ner] -> Entity Recognition (Person, Org, Location)")
30
+ print(" [translation] -> Multi-language NLLB & Argos Support")
31
+ print(" [summarization]-> Abstractive (BART) & Extractive (Sumy) Summary")
32
+
33
+ print(f"\n{BOLD}💡 GETTING STARTED:{RESET}{YELLOW}")
34
+ print(" import contentintelpy as ci")
35
+ print(" pipeline = ci.create_default_pipeline()")
36
+ print(" result = pipeline.run({'text': 'Your text here'})")
37
+ print(f"{'═'*60}{RESET}\n")
38
+
39
+ # Run hint on first import if in an interactive session
40
+ if sys.stdout.isatty():
41
+ _show_welcome_hint()
4
42
 
5
43
  # Import Nodes for the default pipeline
6
44
  from .nodes.language_node import LanguageDetectionNode
@@ -22,6 +22,10 @@ class PipelineContext:
22
22
  self._data["errors"] = {}
23
23
  self._data["errors"][node_name] = error_message
24
24
 
25
+ def has_errors(self) -> bool:
26
+ """Check if any errors have been logged in the current context."""
27
+ return len(self._data.get("errors", {})) > 0
28
+
25
29
  def to_dict(self) -> Dict[str, Any]:
26
30
  """Return the raw dictionary state."""
27
31
  return self._data
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: contentintelpy
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Production-grade NLP library for unified content intelligence.
5
5
  Author-email: Ronit Fulari <ronitfulari31@gmail.com>
6
6
  License: MIT
@@ -1,4 +1,4 @@
1
- contentintelpy/__init__.py,sha256=HSJcTru6PksguTH52iFj7ORhqSuHXIDHMQotj5KMmBc,1977
1
+ contentintelpy/__init__.py,sha256=IJ4z3kvR8_86gq9Fa7ksahp4l9gtjEb37VwAmgShTyw,3667
2
2
  contentintelpy/nodes/classification_node.py,sha256=ivfAHdYXZU-5eVbtgxD94_TiRHcq-mJg4ukOc7KqwXU,2116
3
3
  contentintelpy/nodes/keyword_extract_node.py,sha256=o-OTOdkdEIYnd_ZczdAjwJkWnjzlKLa28WnEZCKy_og,3024
4
4
  contentintelpy/nodes/language_node.py,sha256=sKRa65kLrb1IRYGrkT82tu8LgdhIXdN5EwhUrH6pSqI,1971
@@ -8,7 +8,7 @@ contentintelpy/nodes/sentiment_node.py,sha256=oFuw1Z0d6f4BWSYtnp8UN0gMCvL3nl5b4h
8
8
  contentintelpy/nodes/summarization_node.py,sha256=XHdT8lMN-1_fiGBGkqbblPfJgkvQTf7XIq99z7w_6Bw,2803
9
9
  contentintelpy/nodes/translation_node.py,sha256=zebwFqp22bo4Oi5gKyNGZKduAl_grfZTC53PKPsKVko,4511
10
10
  contentintelpy/pipeline/base_node.py,sha256=hYLx2yAURpbmTr9x4kG8qVIlNI1Q0UJckBltW5LJl-o,1394
11
- contentintelpy/pipeline/context.py,sha256=u_YsEe4oi-A6MM9igtQ0cOeX88fRd_Uj9umU4040W0E,1257
11
+ contentintelpy/pipeline/context.py,sha256=fAtlqrrVSnGVx1DqJq15WT9nLE-MsuKP81xlqxu1cAY,1424
12
12
  contentintelpy/pipeline/pipeline.py,sha256=gTgRcF34KxAJMxtac7wHdesD33q3CIP9hncvILHQ-3c,888
13
13
  contentintelpy/services/ner_service.py,sha256=7-sEAqxYRpVksd-sZ5CPgAq3HfVeeb0OaRd0YPIqzPs,737
14
14
  contentintelpy/services/sentiment_service.py,sha256=Yc6u0l8m_uN5ZxgUMr9DQziwi50cMlTZuaAOS8A7pJc,1130
@@ -16,8 +16,8 @@ contentintelpy/services/summarization_service.py,sha256=XK3vAGGoQS1dXxaO4nKjyrFl
16
16
  contentintelpy/services/translation_service.py,sha256=6yNLLJ7mAE7ptHvprX1JUoUN-65Ot7ZdTszqqxMY1TA,1191
17
17
  contentintelpy/utils/lazy_import.py,sha256=km1_WmFYKBGJwNbB1lEJSiix3Rnr1RwMbW7MbrMtqf4,661
18
18
  contentintelpy/utils/model_registry.py,sha256=e8KK1AiZ1jJvsxNwapQjNLKiCeETZd8gWJKaoO-Bl_E,5823
19
- contentintelpy-0.1.1.dist-info/licenses/LICENSE,sha256=lZ8hT4isGfdFVxdD7gDRnt3RJqyrkO1L5GseyN3A9hM,1092
20
- contentintelpy-0.1.1.dist-info/METADATA,sha256=SbRCE3Q7PYnIfFk1uNuJeE0Vv0TEtkeQLD8_bk97h5M,4324
21
- contentintelpy-0.1.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
- contentintelpy-0.1.1.dist-info/top_level.txt,sha256=sxoE-r2-frUi3qwADEiYcFFxZW5hMI1Mjw87hcGMulQ,15
23
- contentintelpy-0.1.1.dist-info/RECORD,,
19
+ contentintelpy-0.1.3.dist-info/licenses/LICENSE,sha256=lZ8hT4isGfdFVxdD7gDRnt3RJqyrkO1L5GseyN3A9hM,1092
20
+ contentintelpy-0.1.3.dist-info/METADATA,sha256=63x8weJD39nbqdw1arCGYXYKkqcEZb76_9x8nu3SKqw,4324
21
+ contentintelpy-0.1.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
22
+ contentintelpy-0.1.3.dist-info/top_level.txt,sha256=sxoE-r2-frUi3qwADEiYcFFxZW5hMI1Mjw87hcGMulQ,15
23
+ contentintelpy-0.1.3.dist-info/RECORD,,