datamule 0.381__py3-none-any.whl → 1.0.2__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.
- datamule/__init__.py +46 -86
- datamule/book/book.py +34 -0
- datamule/book/eftsquery.py +127 -0
- datamule/book/xbrl_retriever.py +88 -0
- datamule/config.py +29 -0
- datamule/data/company_former_names.csv +8148 -8148
- datamule/data/company_metadata.csv +10049 -10049
- datamule/data/company_tickers.csv +9999 -10168
- datamule/data/sec-glossary.csv +728 -728
- datamule/data/xbrl_descriptions.csv +10024 -10024
- datamule/document.py +279 -0
- datamule/downloader/downloader.py +374 -0
- datamule/downloader/premiumdownloader.py +335 -0
- datamule/helper.py +123 -136
- datamule/mapping_dicts/txt_mapping_dicts.py +232 -0
- datamule/mapping_dicts/xml_mapping_dicts.py +19 -0
- datamule/monitor.py +238 -0
- datamule/mulebot/__init__.py +1 -1
- datamule/mulebot/helper.py +34 -34
- datamule/mulebot/mulebot.py +129 -129
- datamule/mulebot/mulebot_server/server.py +86 -86
- datamule/mulebot/mulebot_server/static/css/minimalist.css +173 -173
- datamule/mulebot/mulebot_server/static/scripts/artifacts.js +67 -67
- datamule/mulebot/mulebot_server/static/scripts/chat.js +91 -91
- datamule/mulebot/mulebot_server/static/scripts/filingArtifacts.js +55 -55
- datamule/mulebot/mulebot_server/static/scripts/listArtifacts.js +14 -14
- datamule/mulebot/mulebot_server/static/scripts/main.js +56 -56
- datamule/mulebot/mulebot_server/static/scripts/prefilledPrompt.js +26 -26
- datamule/mulebot/mulebot_server/static/scripts/suggestions.js +46 -46
- datamule/mulebot/mulebot_server/static/scripts/tableArtifacts.js +128 -128
- datamule/mulebot/mulebot_server/static/scripts/utils.js +27 -27
- datamule/mulebot/mulebot_server/templates/chat-minimalist.html +90 -90
- datamule/mulebot/search.py +51 -51
- datamule/mulebot/tools.py +82 -82
- datamule/packageupdater.py +207 -0
- datamule/portfolio.py +106 -0
- datamule/submission.py +76 -0
- datamule-1.0.2.dist-info/METADATA +27 -0
- datamule-1.0.2.dist-info/RECORD +43 -0
- {datamule-0.381.dist-info → datamule-1.0.2.dist-info}/WHEEL +1 -1
- datamule/data/filing_types.csv +0 -485
- datamule/data/ftd_locations.csv +0 -388
- datamule/datamule_api.py +0 -21
- datamule/dataset_builder/_init.py +0 -1
- datamule/dataset_builder/dataset_builder.py +0 -260
- datamule/downloader/dropbox_downloader.py +0 -225
- datamule/downloader/ftd.py +0 -216
- datamule/downloader/information_table_13f.py +0 -231
- datamule/downloader/sec_downloader.py +0 -635
- datamule/filing_viewer/__init__.py +0 -1
- datamule/filing_viewer/filing_viewer.py +0 -256
- datamule/global_vars.py +0 -202
- datamule/parser/__init__.py +0 -1
- datamule/parser/basic_10k_parser.py +0 -82
- datamule/parser/basic_10q_parser.py +0 -73
- datamule/parser/basic_13d_parser.py +0 -58
- datamule/parser/basic_13g_parser.py +0 -61
- datamule/parser/basic_8k_parser.py +0 -84
- datamule/parser/company_concepts_parser.py +0 -0
- datamule/parser/form_d_parser.py +0 -70
- datamule/parser/generalized_item_parser.py +0 -78
- datamule/parser/generalized_xml_parser.py +0 -0
- datamule/parser/helper.py +0 -75
- datamule/parser/information_table_parser_13fhr.py +0 -41
- datamule/parser/insider_trading_parser.py +0 -158
- datamule/parser/mappings.py +0 -95
- datamule/parser/n_port_p_parser.py +0 -70
- datamule/parser/sec_parser.py +0 -79
- datamule/parser/sgml_parser.py +0 -180
- datamule/sec_filing.py +0 -126
- datamule/sec_search.py +0 -20
- datamule-0.381.dist-info/METADATA +0 -132
- datamule-0.381.dist-info/RECORD +0 -61
- /datamule/{downloader → book}/__init__.py +0 -0
- {datamule-0.381.dist-info → datamule-1.0.2.dist-info}/top_level.txt +0 -0
@@ -1,56 +1,56 @@
|
|
1
|
-
// filingArtifacts.js
|
2
|
-
export function renderFilingArtifact(artifactData) {
|
3
|
-
const { content: html, data, section_id } = artifactData;
|
4
|
-
|
5
|
-
const container = document.createElement('div');
|
6
|
-
container.className = 'filing-container';
|
7
|
-
container.style.width = '100%';
|
8
|
-
container.style.height = '600px';
|
9
|
-
|
10
|
-
const iframe = document.createElement('iframe');
|
11
|
-
iframe.srcdoc = html;
|
12
|
-
iframe.style.width = '100%';
|
13
|
-
iframe.style.height = '100%';
|
14
|
-
iframe.style.border = 'none';
|
15
|
-
|
16
|
-
container.appendChild(iframe);
|
17
|
-
|
18
|
-
const artifactContent = document.getElementById('artifact-content');
|
19
|
-
if (artifactContent) {
|
20
|
-
artifactContent.innerHTML = '';
|
21
|
-
artifactContent.appendChild(container);
|
22
|
-
}
|
23
|
-
|
24
|
-
iframe.onload = () => {
|
25
|
-
if (section_id) {
|
26
|
-
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
27
|
-
const targetElement = iframeDocument.getElementById(section_id);
|
28
|
-
if (targetElement) {
|
29
|
-
targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
30
|
-
}
|
31
|
-
}
|
32
|
-
};
|
33
|
-
|
34
|
-
const buttonContainer = document.createElement('div');
|
35
|
-
buttonContainer.className = 'mt-3';
|
36
|
-
|
37
|
-
const downloadHtmlBtn = document.createElement('button');
|
38
|
-
downloadHtmlBtn.className = 'btn btn-secondary me-2';
|
39
|
-
downloadHtmlBtn.textContent = 'Download Filing HTML';
|
40
|
-
downloadHtmlBtn.onclick = () => {
|
41
|
-
const blob = new Blob([html], { type: 'text/html' });
|
42
|
-
saveAs(blob, 'filing.html');
|
43
|
-
};
|
44
|
-
buttonContainer.appendChild(downloadHtmlBtn);
|
45
|
-
|
46
|
-
const downloadJsonBtn = document.createElement('button');
|
47
|
-
downloadJsonBtn.className = 'btn btn-secondary';
|
48
|
-
downloadJsonBtn.textContent = 'Download Filing Data (JSON)';
|
49
|
-
downloadJsonBtn.onclick = () => {
|
50
|
-
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
|
51
|
-
saveAs(blob, 'filing_data.json');
|
52
|
-
};
|
53
|
-
buttonContainer.appendChild(downloadJsonBtn);
|
54
|
-
|
55
|
-
artifactContent.appendChild(buttonContainer);
|
1
|
+
// filingArtifacts.js
|
2
|
+
export function renderFilingArtifact(artifactData) {
|
3
|
+
const { content: html, data, section_id } = artifactData;
|
4
|
+
|
5
|
+
const container = document.createElement('div');
|
6
|
+
container.className = 'filing-container';
|
7
|
+
container.style.width = '100%';
|
8
|
+
container.style.height = '600px';
|
9
|
+
|
10
|
+
const iframe = document.createElement('iframe');
|
11
|
+
iframe.srcdoc = html;
|
12
|
+
iframe.style.width = '100%';
|
13
|
+
iframe.style.height = '100%';
|
14
|
+
iframe.style.border = 'none';
|
15
|
+
|
16
|
+
container.appendChild(iframe);
|
17
|
+
|
18
|
+
const artifactContent = document.getElementById('artifact-content');
|
19
|
+
if (artifactContent) {
|
20
|
+
artifactContent.innerHTML = '';
|
21
|
+
artifactContent.appendChild(container);
|
22
|
+
}
|
23
|
+
|
24
|
+
iframe.onload = () => {
|
25
|
+
if (section_id) {
|
26
|
+
const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
|
27
|
+
const targetElement = iframeDocument.getElementById(section_id);
|
28
|
+
if (targetElement) {
|
29
|
+
targetElement.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
30
|
+
}
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
const buttonContainer = document.createElement('div');
|
35
|
+
buttonContainer.className = 'mt-3';
|
36
|
+
|
37
|
+
const downloadHtmlBtn = document.createElement('button');
|
38
|
+
downloadHtmlBtn.className = 'btn btn-secondary me-2';
|
39
|
+
downloadHtmlBtn.textContent = 'Download Filing HTML';
|
40
|
+
downloadHtmlBtn.onclick = () => {
|
41
|
+
const blob = new Blob([html], { type: 'text/html' });
|
42
|
+
saveAs(blob, 'filing.html');
|
43
|
+
};
|
44
|
+
buttonContainer.appendChild(downloadHtmlBtn);
|
45
|
+
|
46
|
+
const downloadJsonBtn = document.createElement('button');
|
47
|
+
downloadJsonBtn.className = 'btn btn-secondary';
|
48
|
+
downloadJsonBtn.textContent = 'Download Filing Data (JSON)';
|
49
|
+
downloadJsonBtn.onclick = () => {
|
50
|
+
const blob = new Blob([JSON.stringify(data, null, 2)], { type: 'application/json' });
|
51
|
+
saveAs(blob, 'filing_data.json');
|
52
|
+
};
|
53
|
+
buttonContainer.appendChild(downloadJsonBtn);
|
54
|
+
|
55
|
+
artifactContent.appendChild(buttonContainer);
|
56
56
|
}
|
@@ -1,15 +1,15 @@
|
|
1
|
-
// listArtifacts.js
|
2
|
-
export function renderListArtifact(listData) {
|
3
|
-
let html = `<h4>URLs</h4><ul class="list-group">`;
|
4
|
-
|
5
|
-
listData.forEach(url => {
|
6
|
-
html += `<li class="list-group-item"><a href="${url}" target="_blank">${url}</a></li>`;
|
7
|
-
});
|
8
|
-
|
9
|
-
html += '</ul>';
|
10
|
-
|
11
|
-
const artifactContent = document.getElementById('artifact-content');
|
12
|
-
if (artifactContent) {
|
13
|
-
artifactContent.innerHTML = html;
|
14
|
-
}
|
1
|
+
// listArtifacts.js
|
2
|
+
export function renderListArtifact(listData) {
|
3
|
+
let html = `<h4>URLs</h4><ul class="list-group">`;
|
4
|
+
|
5
|
+
listData.forEach(url => {
|
6
|
+
html += `<li class="list-group-item"><a href="${url}" target="_blank">${url}</a></li>`;
|
7
|
+
});
|
8
|
+
|
9
|
+
html += '</ul>';
|
10
|
+
|
11
|
+
const artifactContent = document.getElementById('artifact-content');
|
12
|
+
if (artifactContent) {
|
13
|
+
artifactContent.innerHTML = html;
|
14
|
+
}
|
15
15
|
}
|
@@ -1,57 +1,57 @@
|
|
1
|
-
// main.js
|
2
|
-
import { appendMessage, sendMessage, handleResponse, showThinkingIndicator, hideThinkingIndicator } from './chat.js';
|
3
|
-
import { initializeArtifacts } from './artifacts.js';
|
4
|
-
import { handleDocumentClick } from './tableArtifacts.js';
|
5
|
-
import { initializeSuggestions } from './suggestions.js';
|
6
|
-
import { handlePrefilledPrompt } from './prefilledPrompt.js';
|
7
|
-
|
8
|
-
let chatInitialized = false;
|
9
|
-
|
10
|
-
function initializeChat() {
|
11
|
-
if (chatInitialized) return;
|
12
|
-
chatInitialized = true;
|
13
|
-
|
14
|
-
console.log('Initializing chat');
|
15
|
-
|
16
|
-
initializeArtifacts();
|
17
|
-
initializeSuggestions();
|
18
|
-
|
19
|
-
const chatForm = document.getElementById('chat-form');
|
20
|
-
const userInput = document.getElementById('user-input');
|
21
|
-
|
22
|
-
if (chatForm) {
|
23
|
-
chatForm.addEventListener('submit', async (e) => {
|
24
|
-
e.preventDefault();
|
25
|
-
console.log('Form submitted');
|
26
|
-
const message = userInput.value.trim();
|
27
|
-
if (message) {
|
28
|
-
appendMessage('You', message);
|
29
|
-
userInput.value = '';
|
30
|
-
showThinkingIndicator();
|
31
|
-
try {
|
32
|
-
const response = await sendMessage(message);
|
33
|
-
handleResponse(response);
|
34
|
-
} catch (error) {
|
35
|
-
console.error('Error processing message:', error);
|
36
|
-
} finally {
|
37
|
-
hideThinkingIndicator();
|
38
|
-
}
|
39
|
-
}
|
40
|
-
});
|
41
|
-
}
|
42
|
-
|
43
|
-
document.addEventListener('click', handleDocumentClick);
|
44
|
-
}
|
45
|
-
|
46
|
-
// Wait for the DOM to be fully loaded before initializing
|
47
|
-
if (document.readyState === 'loading') {
|
48
|
-
document.addEventListener('DOMContentLoaded', initializeChat);
|
49
|
-
} else {
|
50
|
-
initializeChat();
|
51
|
-
}
|
52
|
-
|
53
|
-
// Add this new event listener for the window load event
|
54
|
-
window.addEventListener('load', () => {
|
55
|
-
console.log('Window fully loaded, handling prefilled prompt');
|
56
|
-
handlePrefilledPrompt();
|
1
|
+
// main.js
|
2
|
+
import { appendMessage, sendMessage, handleResponse, showThinkingIndicator, hideThinkingIndicator } from './chat.js';
|
3
|
+
import { initializeArtifacts } from './artifacts.js';
|
4
|
+
import { handleDocumentClick } from './tableArtifacts.js';
|
5
|
+
import { initializeSuggestions } from './suggestions.js';
|
6
|
+
import { handlePrefilledPrompt } from './prefilledPrompt.js';
|
7
|
+
|
8
|
+
let chatInitialized = false;
|
9
|
+
|
10
|
+
function initializeChat() {
|
11
|
+
if (chatInitialized) return;
|
12
|
+
chatInitialized = true;
|
13
|
+
|
14
|
+
console.log('Initializing chat');
|
15
|
+
|
16
|
+
initializeArtifacts();
|
17
|
+
initializeSuggestions();
|
18
|
+
|
19
|
+
const chatForm = document.getElementById('chat-form');
|
20
|
+
const userInput = document.getElementById('user-input');
|
21
|
+
|
22
|
+
if (chatForm) {
|
23
|
+
chatForm.addEventListener('submit', async (e) => {
|
24
|
+
e.preventDefault();
|
25
|
+
console.log('Form submitted');
|
26
|
+
const message = userInput.value.trim();
|
27
|
+
if (message) {
|
28
|
+
appendMessage('You', message);
|
29
|
+
userInput.value = '';
|
30
|
+
showThinkingIndicator();
|
31
|
+
try {
|
32
|
+
const response = await sendMessage(message);
|
33
|
+
handleResponse(response);
|
34
|
+
} catch (error) {
|
35
|
+
console.error('Error processing message:', error);
|
36
|
+
} finally {
|
37
|
+
hideThinkingIndicator();
|
38
|
+
}
|
39
|
+
}
|
40
|
+
});
|
41
|
+
}
|
42
|
+
|
43
|
+
document.addEventListener('click', handleDocumentClick);
|
44
|
+
}
|
45
|
+
|
46
|
+
// Wait for the DOM to be fully loaded before initializing
|
47
|
+
if (document.readyState === 'loading') {
|
48
|
+
document.addEventListener('DOMContentLoaded', initializeChat);
|
49
|
+
} else {
|
50
|
+
initializeChat();
|
51
|
+
}
|
52
|
+
|
53
|
+
// Add this new event listener for the window load event
|
54
|
+
window.addEventListener('load', () => {
|
55
|
+
console.log('Window fully loaded, handling prefilled prompt');
|
56
|
+
handlePrefilledPrompt();
|
57
57
|
});
|
@@ -1,27 +1,27 @@
|
|
1
|
-
// prefilledPrompt.js
|
2
|
-
import { sendMessage, handleResponse, appendMessage } from './chat.js';
|
3
|
-
|
4
|
-
export function handlePrefilledPrompt() {
|
5
|
-
const urlParams = new URLSearchParams(window.location.search);
|
6
|
-
const prefilled_prompt = urlParams.get('prompt');
|
7
|
-
if (prefilled_prompt) {
|
8
|
-
const userInput = document.getElementById('user-input');
|
9
|
-
if (userInput) {
|
10
|
-
userInput.value = prefilled_prompt;
|
11
|
-
appendMessage('You', prefilled_prompt); // Show the user's message in the chat
|
12
|
-
}
|
13
|
-
if (typeof sendMessage === 'function') {
|
14
|
-
sendMessage(prefilled_prompt).then(response => {
|
15
|
-
handleResponse(response);
|
16
|
-
if (userInput) {
|
17
|
-
userInput.value = ''; // Clear the input field after sending
|
18
|
-
}
|
19
|
-
}).catch(error => {
|
20
|
-
console.error('Error processing prefilled prompt:', error);
|
21
|
-
if (userInput) {
|
22
|
-
userInput.value = ''; // Clear the input field even if there's an error
|
23
|
-
}
|
24
|
-
});
|
25
|
-
}
|
26
|
-
}
|
1
|
+
// prefilledPrompt.js
|
2
|
+
import { sendMessage, handleResponse, appendMessage } from './chat.js';
|
3
|
+
|
4
|
+
export function handlePrefilledPrompt() {
|
5
|
+
const urlParams = new URLSearchParams(window.location.search);
|
6
|
+
const prefilled_prompt = urlParams.get('prompt');
|
7
|
+
if (prefilled_prompt) {
|
8
|
+
const userInput = document.getElementById('user-input');
|
9
|
+
if (userInput) {
|
10
|
+
userInput.value = prefilled_prompt;
|
11
|
+
appendMessage('You', prefilled_prompt); // Show the user's message in the chat
|
12
|
+
}
|
13
|
+
if (typeof sendMessage === 'function') {
|
14
|
+
sendMessage(prefilled_prompt).then(response => {
|
15
|
+
handleResponse(response);
|
16
|
+
if (userInput) {
|
17
|
+
userInput.value = ''; // Clear the input field after sending
|
18
|
+
}
|
19
|
+
}).catch(error => {
|
20
|
+
console.error('Error processing prefilled prompt:', error);
|
21
|
+
if (userInput) {
|
22
|
+
userInput.value = ''; // Clear the input field even if there's an error
|
23
|
+
}
|
24
|
+
});
|
25
|
+
}
|
26
|
+
}
|
27
27
|
}
|
@@ -1,47 +1,47 @@
|
|
1
|
-
// suggestions.js
|
2
|
-
import { appendMessage, sendMessage, handleResponse, showThinkingIndicator, hideThinkingIndicator } from './chat.js';
|
3
|
-
import { renderArtifact, showArtifacts } from './artifacts.js';
|
4
|
-
|
5
|
-
export function initializeSuggestions() {
|
6
|
-
const userInput = document.getElementById('user-input');
|
7
|
-
const chatForm = document.getElementById('chat-form');
|
8
|
-
const suggestionItems = document.querySelectorAll('.suggestion-item');
|
9
|
-
|
10
|
-
// Function to handle suggestion click
|
11
|
-
function handleSuggestionClick(event) {
|
12
|
-
const suggestionText = event.target.textContent;
|
13
|
-
userInput.value = suggestionText;
|
14
|
-
executeChatRequest(suggestionText);
|
15
|
-
userInput.value = ''; // Clear the input after executing the request
|
16
|
-
}
|
17
|
-
|
18
|
-
// Add click event listeners to all suggestion items
|
19
|
-
suggestionItems.forEach(item => {
|
20
|
-
item.addEventListener('click', handleSuggestionClick);
|
21
|
-
});
|
22
|
-
|
23
|
-
// Function to execute chat request
|
24
|
-
async function executeChatRequest(message) {
|
25
|
-
try {
|
26
|
-
appendMessage('You', message);
|
27
|
-
showThinkingIndicator();
|
28
|
-
const response = await sendMessage(message);
|
29
|
-
handleResponse(response);
|
30
|
-
} catch (error) {
|
31
|
-
console.error('Error executing chat request:', error);
|
32
|
-
appendMessage('Bot', 'Sorry, there was an error processing your request.');
|
33
|
-
} finally {
|
34
|
-
hideThinkingIndicator();
|
35
|
-
}
|
36
|
-
}
|
37
|
-
|
38
|
-
// Prevent default form submission
|
39
|
-
chatForm.addEventListener('submit', function (event) {
|
40
|
-
event.preventDefault();
|
41
|
-
const message = userInput.value.trim();
|
42
|
-
if (message) {
|
43
|
-
executeChatRequest(message);
|
44
|
-
userInput.value = ''; // Clear the input after executing the request
|
45
|
-
}
|
46
|
-
});
|
1
|
+
// suggestions.js
|
2
|
+
import { appendMessage, sendMessage, handleResponse, showThinkingIndicator, hideThinkingIndicator } from './chat.js';
|
3
|
+
import { renderArtifact, showArtifacts } from './artifacts.js';
|
4
|
+
|
5
|
+
export function initializeSuggestions() {
|
6
|
+
const userInput = document.getElementById('user-input');
|
7
|
+
const chatForm = document.getElementById('chat-form');
|
8
|
+
const suggestionItems = document.querySelectorAll('.suggestion-item');
|
9
|
+
|
10
|
+
// Function to handle suggestion click
|
11
|
+
function handleSuggestionClick(event) {
|
12
|
+
const suggestionText = event.target.textContent;
|
13
|
+
userInput.value = suggestionText;
|
14
|
+
executeChatRequest(suggestionText);
|
15
|
+
userInput.value = ''; // Clear the input after executing the request
|
16
|
+
}
|
17
|
+
|
18
|
+
// Add click event listeners to all suggestion items
|
19
|
+
suggestionItems.forEach(item => {
|
20
|
+
item.addEventListener('click', handleSuggestionClick);
|
21
|
+
});
|
22
|
+
|
23
|
+
// Function to execute chat request
|
24
|
+
async function executeChatRequest(message) {
|
25
|
+
try {
|
26
|
+
appendMessage('You', message);
|
27
|
+
showThinkingIndicator();
|
28
|
+
const response = await sendMessage(message);
|
29
|
+
handleResponse(response);
|
30
|
+
} catch (error) {
|
31
|
+
console.error('Error executing chat request:', error);
|
32
|
+
appendMessage('Bot', 'Sorry, there was an error processing your request.');
|
33
|
+
} finally {
|
34
|
+
hideThinkingIndicator();
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
// Prevent default form submission
|
39
|
+
chatForm.addEventListener('submit', function (event) {
|
40
|
+
event.preventDefault();
|
41
|
+
const message = userInput.value.trim();
|
42
|
+
if (message) {
|
43
|
+
executeChatRequest(message);
|
44
|
+
userInput.value = ''; // Clear the input after executing the request
|
45
|
+
}
|
46
|
+
});
|
47
47
|
}
|