attachments 0.2.2__tar.gz → 0.2.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.
Files changed (33) hide show
  1. {attachments-0.2.2/src/attachments.egg-info → attachments-0.2.3}/PKG-INFO +35 -1
  2. {attachments-0.2.2 → attachments-0.2.3}/README.md +34 -0
  3. {attachments-0.2.2 → attachments-0.2.3}/pyproject.toml +1 -1
  4. {attachments-0.2.2 → attachments-0.2.3/src/attachments.egg-info}/PKG-INFO +35 -1
  5. {attachments-0.2.2 → attachments-0.2.3}/LICENSE +0 -0
  6. {attachments-0.2.2 → attachments-0.2.3}/setup.cfg +0 -0
  7. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/__init__.py +0 -0
  8. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/audio_processing.py +0 -0
  9. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/config.py +0 -0
  10. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/core.py +0 -0
  11. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/detectors.py +0 -0
  12. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/exceptions.py +0 -0
  13. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/image_processing.py +0 -0
  14. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/office_contact_sheet.py +0 -0
  15. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/parsers.py +0 -0
  16. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/renderers.py +0 -0
  17. {attachments-0.2.2 → attachments-0.2.3}/src/attachments/utils.py +0 -0
  18. {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/SOURCES.txt +0 -0
  19. {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/dependency_links.txt +0 -0
  20. {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/requires.txt +0 -0
  21. {attachments-0.2.2 → attachments-0.2.3}/src/attachments.egg-info/top_level.txt +0 -0
  22. {attachments-0.2.2 → attachments-0.2.3}/tests/test_audio_processing.py +0 -0
  23. {attachments-0.2.2 → attachments-0.2.3}/tests/test_base.py +0 -0
  24. {attachments-0.2.2 → attachments-0.2.3}/tests/test_core_functionality.py +0 -0
  25. {attachments-0.2.2 → attachments-0.2.3}/tests/test_document_parsing.py +0 -0
  26. {attachments-0.2.2 → attachments-0.2.3}/tests/test_html_parsing.py +0 -0
  27. {attachments-0.2.2 → attachments-0.2.3}/tests/test_image_processing.py +0 -0
  28. {attachments-0.2.2 → attachments-0.2.3}/tests/test_indexing_slicing.py +0 -0
  29. {attachments-0.2.2 → attachments-0.2.3}/tests/test_markdown_rendering.py +0 -0
  30. {attachments-0.2.2 → attachments-0.2.3}/tests/test_office_contact_sheet.py +0 -0
  31. {attachments-0.2.2 → attachments-0.2.3}/tests/test_pdf_parsing.py +0 -0
  32. {attachments-0.2.2 → attachments-0.2.3}/tests/test_pptx_parsing.py +0 -0
  33. {attachments-0.2.2 → attachments-0.2.3}/tests/test_simple.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: attachments
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A Python library to handle various file types for LLMs.
5
5
  Author-email: Maxim Rivest <mrive052@gmail.com>
6
6
  License-Expression: MIT
@@ -88,6 +88,40 @@ response = OpenAI().responses.create(model="gpt-4.1-nano", input=[{"role": "user
88
88
  response.output_text
89
89
  ```
90
90
 
91
+ ## How to give attachments to anthropic llms?
92
+
93
+ ```python
94
+ import anthropic
95
+ from attachments import Attachments
96
+
97
+ pptx_file = Attachments(
98
+ "https://github.com/microsoft/markitdown/raw/refs/heads/main/packages/markitdown/tests/test_files/test.pptx")
99
+
100
+ prompt = f"""
101
+ Analyze the following documents:
102
+ {pptx_file}
103
+ """
104
+
105
+ content = [
106
+ {
107
+ "type": "image",
108
+ "source": {
109
+ "type": "base64",
110
+ "media_type": image.split(";")[0].split(":")[1], # this is ugly but it works
111
+ "data": image.split(",")[1] # this is ugly but it works
112
+ }
113
+ }
114
+ for image in pptx_file.images
115
+ ] + [{"type": "text", "text": prompt}]
116
+
117
+ message = anthropic.Anthropic().messages.create(
118
+ max_tokens=8192,
119
+ model="claude-3-5-haiku-20241022",
120
+ messages=[{"role": "user", "content": content}])
121
+ print(message.content)
122
+ ```
123
+
124
+
91
125
  ## Usage
92
126
 
93
127
  ### Basic Initialization
@@ -49,6 +49,40 @@ response = OpenAI().responses.create(model="gpt-4.1-nano", input=[{"role": "user
49
49
  response.output_text
50
50
  ```
51
51
 
52
+ ## How to give attachments to anthropic llms?
53
+
54
+ ```python
55
+ import anthropic
56
+ from attachments import Attachments
57
+
58
+ pptx_file = Attachments(
59
+ "https://github.com/microsoft/markitdown/raw/refs/heads/main/packages/markitdown/tests/test_files/test.pptx")
60
+
61
+ prompt = f"""
62
+ Analyze the following documents:
63
+ {pptx_file}
64
+ """
65
+
66
+ content = [
67
+ {
68
+ "type": "image",
69
+ "source": {
70
+ "type": "base64",
71
+ "media_type": image.split(";")[0].split(":")[1], # this is ugly but it works
72
+ "data": image.split(",")[1] # this is ugly but it works
73
+ }
74
+ }
75
+ for image in pptx_file.images
76
+ ] + [{"type": "text", "text": prompt}]
77
+
78
+ message = anthropic.Anthropic().messages.create(
79
+ max_tokens=8192,
80
+ model="claude-3-5-haiku-20241022",
81
+ messages=[{"role": "user", "content": content}])
82
+ print(message.content)
83
+ ```
84
+
85
+
52
86
  ## Usage
53
87
 
54
88
  ### Basic Initialization
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "attachments"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  authors = [
9
9
  { name="Maxim Rivest", email="mrive052@gmail.com" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: attachments
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: A Python library to handle various file types for LLMs.
5
5
  Author-email: Maxim Rivest <mrive052@gmail.com>
6
6
  License-Expression: MIT
@@ -88,6 +88,40 @@ response = OpenAI().responses.create(model="gpt-4.1-nano", input=[{"role": "user
88
88
  response.output_text
89
89
  ```
90
90
 
91
+ ## How to give attachments to anthropic llms?
92
+
93
+ ```python
94
+ import anthropic
95
+ from attachments import Attachments
96
+
97
+ pptx_file = Attachments(
98
+ "https://github.com/microsoft/markitdown/raw/refs/heads/main/packages/markitdown/tests/test_files/test.pptx")
99
+
100
+ prompt = f"""
101
+ Analyze the following documents:
102
+ {pptx_file}
103
+ """
104
+
105
+ content = [
106
+ {
107
+ "type": "image",
108
+ "source": {
109
+ "type": "base64",
110
+ "media_type": image.split(";")[0].split(":")[1], # this is ugly but it works
111
+ "data": image.split(",")[1] # this is ugly but it works
112
+ }
113
+ }
114
+ for image in pptx_file.images
115
+ ] + [{"type": "text", "text": prompt}]
116
+
117
+ message = anthropic.Anthropic().messages.create(
118
+ max_tokens=8192,
119
+ model="claude-3-5-haiku-20241022",
120
+ messages=[{"role": "user", "content": content}])
121
+ print(message.content)
122
+ ```
123
+
124
+
91
125
  ## Usage
92
126
 
93
127
  ### Basic Initialization
File without changes
File without changes