scientific-writer 2.1.1__py3-none-any.whl → 2.2.1__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 scientific-writer might be problematic. Click here for more details.
- scientific_writer/__init__.py +2 -2
- scientific_writer/api.py +10 -7
- scientific_writer/cli.py +8 -7
- scientific_writer/core.py +5 -5
- {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.1.dist-info}/METADATA +5 -1
- scientific_writer-2.2.1.dist-info/RECORD +11 -0
- scientific_writer-2.1.1.dist-info/RECORD +0 -11
- {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.1.dist-info}/WHEEL +0 -0
- {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.1.dist-info}/entry_points.txt +0 -0
- {scientific_writer-2.1.1.dist-info → scientific_writer-2.2.1.dist-info}/licenses/LICENSE +0 -0
scientific_writer/__init__.py
CHANGED
|
@@ -29,8 +29,8 @@ Example:
|
|
|
29
29
|
from .api import generate_paper
|
|
30
30
|
from .models import ProgressUpdate, PaperResult, PaperMetadata, PaperFiles
|
|
31
31
|
|
|
32
|
-
__version__ = "2.
|
|
33
|
-
__author__ = "
|
|
32
|
+
__version__ = "2.2.1"
|
|
33
|
+
__author__ = "K-Dense"
|
|
34
34
|
__license__ = "MIT"
|
|
35
35
|
|
|
36
36
|
__all__ = [
|
scientific_writer/api.py
CHANGED
|
@@ -76,10 +76,13 @@ async def generate_paper(
|
|
|
76
76
|
if cwd:
|
|
77
77
|
work_dir = Path(cwd).resolve()
|
|
78
78
|
else:
|
|
79
|
-
# Default to
|
|
80
|
-
work_dir = Path
|
|
79
|
+
# Default to user's current working directory
|
|
80
|
+
work_dir = Path.cwd()
|
|
81
81
|
|
|
82
|
-
#
|
|
82
|
+
# Get package directory for loading system instructions and skills
|
|
83
|
+
package_dir = Path(__file__).parent.parent.absolute()
|
|
84
|
+
|
|
85
|
+
# Ensure output folder exists in user's directory
|
|
83
86
|
output_folder = ensure_output_folder(work_dir, output_dir)
|
|
84
87
|
|
|
85
88
|
# Initial progress update
|
|
@@ -89,8 +92,8 @@ async def generate_paper(
|
|
|
89
92
|
percentage=0,
|
|
90
93
|
).to_dict()
|
|
91
94
|
|
|
92
|
-
# Load system instructions
|
|
93
|
-
system_instructions = load_system_instructions(
|
|
95
|
+
# Load system instructions from package
|
|
96
|
+
system_instructions = load_system_instructions(package_dir)
|
|
94
97
|
|
|
95
98
|
# Add conversation continuity instruction
|
|
96
99
|
system_instructions += "\n\n" + """
|
|
@@ -120,8 +123,8 @@ IMPORTANT - CONVERSATION CONTINUITY:
|
|
|
120
123
|
model=model,
|
|
121
124
|
allowed_tools=["Read", "Write", "Edit", "Bash", "research-lookup"],
|
|
122
125
|
permission_mode="bypassPermissions",
|
|
123
|
-
setting_sources=["
|
|
124
|
-
cwd=str(work_dir),
|
|
126
|
+
setting_sources=[str(package_dir / ".claude" / "skills")], # Load skills from package directory
|
|
127
|
+
cwd=str(work_dir), # User's working directory
|
|
125
128
|
)
|
|
126
129
|
|
|
127
130
|
# Track progress through message analysis
|
scientific_writer/cli.py
CHANGED
|
@@ -33,14 +33,15 @@ async def main():
|
|
|
33
33
|
print(f"Error: {e}")
|
|
34
34
|
sys.exit(1)
|
|
35
35
|
|
|
36
|
-
# Get the current working directory (
|
|
37
|
-
cwd = Path
|
|
36
|
+
# Get the current working directory (user's directory) and package directory
|
|
37
|
+
cwd = Path.cwd() # User's current working directory
|
|
38
|
+
package_dir = Path(__file__).parent.parent.absolute() # Package installation directory
|
|
38
39
|
|
|
39
|
-
# Ensure paper_outputs folder exists
|
|
40
|
+
# Ensure paper_outputs folder exists in user's directory
|
|
40
41
|
output_folder = ensure_output_folder(cwd)
|
|
41
42
|
|
|
42
|
-
# Load system instructions from CLAUDE.md
|
|
43
|
-
system_instructions = load_system_instructions(
|
|
43
|
+
# Load system instructions from package CLAUDE.md
|
|
44
|
+
system_instructions = load_system_instructions(package_dir)
|
|
44
45
|
|
|
45
46
|
# Add conversation continuity instruction
|
|
46
47
|
# Note: The Python CLI handles session tracking via current_paper_path
|
|
@@ -60,8 +61,8 @@ IMPORTANT - CONVERSATION CONTINUITY:
|
|
|
60
61
|
model="claude-sonnet-4-20250514", # Always use Claude Sonnet 4.5
|
|
61
62
|
allowed_tools=["Read", "Write", "Edit", "Bash", "research-lookup"], # Default Claude Code tools + research lookup
|
|
62
63
|
permission_mode="bypassPermissions", # Execute immediately without approval prompts
|
|
63
|
-
setting_sources=["
|
|
64
|
-
cwd=str(cwd), # Set working directory to
|
|
64
|
+
setting_sources=[str(package_dir / ".claude" / "skills")], # Load skills from package directory
|
|
65
|
+
cwd=str(cwd), # Set working directory to user's current directory
|
|
65
66
|
)
|
|
66
67
|
|
|
67
68
|
# Track conversation state
|
scientific_writer/core.py
CHANGED
|
@@ -35,23 +35,23 @@ def get_api_key(api_key: Optional[str] = None) -> str:
|
|
|
35
35
|
return env_key
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
def load_system_instructions(
|
|
38
|
+
def load_system_instructions(package_dir: Path) -> str:
|
|
39
39
|
"""
|
|
40
|
-
Load system instructions from CLAUDE.md file.
|
|
40
|
+
Load system instructions from package's CLAUDE.md file.
|
|
41
41
|
|
|
42
42
|
Args:
|
|
43
|
-
|
|
43
|
+
package_dir: Package installation directory containing CLAUDE.md.
|
|
44
44
|
|
|
45
45
|
Returns:
|
|
46
46
|
System instructions string.
|
|
47
47
|
"""
|
|
48
|
-
instructions_file =
|
|
48
|
+
instructions_file = package_dir / "CLAUDE.md"
|
|
49
49
|
|
|
50
50
|
if instructions_file.exists():
|
|
51
51
|
with open(instructions_file, 'r', encoding='utf-8') as f:
|
|
52
52
|
return f.read()
|
|
53
53
|
else:
|
|
54
|
-
# Fallback if CLAUDE.md doesn't exist
|
|
54
|
+
# Fallback if CLAUDE.md doesn't exist in package
|
|
55
55
|
return (
|
|
56
56
|
"You are a scientific writing assistant. Follow best practices for "
|
|
57
57
|
"scientific communication and always present a plan before execution."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scientific-writer
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: AI-powered scientific writing with programmatic API and CLI - powered by Claude Sonnet 4.5 and the Claude Agents SDK
|
|
5
5
|
License: MIT
|
|
6
6
|
License-File: LICENSE
|
|
@@ -22,6 +22,7 @@ A Python package and CLI for generating publication-ready scientific papers, rep
|
|
|
22
22
|
- Programmatic Python API with async support
|
|
23
23
|
- Research lookup with Perplexity Sonar Pro
|
|
24
24
|
- Intelligent paper detection (auto-resume editing)
|
|
25
|
+
- Clinical reports (case reports, diagnostic reports, trial reports, HIPAA compliance)
|
|
25
26
|
- Grant proposal generation (NSF, NIH, DOE, DARPA)
|
|
26
27
|
- Research posters with LaTeX
|
|
27
28
|
- Scientific schematics (CONSORT, circuits, pathways)
|
|
@@ -85,6 +86,7 @@ asyncio.run(main())
|
|
|
85
86
|
|
|
86
87
|
### 📝 Document Generation
|
|
87
88
|
- **Scientific papers** with IMRaD structure (Nature, Science, NeurIPS, etc.)
|
|
89
|
+
- **Clinical reports** (case reports, diagnostic reports, trial reports, patient documentation)
|
|
88
90
|
- **Research posters** using LaTeX (beamerposter, tikzposter, baposter)
|
|
89
91
|
- **Grant proposals** (NSF, NIH, DOE, DARPA) with agency-specific formatting
|
|
90
92
|
- **Literature reviews** with systematic citation management
|
|
@@ -158,6 +160,7 @@ asyncio.run(main())
|
|
|
158
160
|
| Task | Command Example |
|
|
159
161
|
|------|----------------|
|
|
160
162
|
| **Scientific Paper** | `> Create a Nature paper on CRISPR gene editing` |
|
|
163
|
+
| **Clinical Report** | `> Create a clinical case report for rare disease presentation` |
|
|
161
164
|
| **Grant Proposal** | `> Write an NSF proposal for quantum computing research` |
|
|
162
165
|
| **Research Poster** | `> Generate a conference poster from my paper` |
|
|
163
166
|
| **Literature Review** | `> Create a literature review on machine learning in healthcare` |
|
|
@@ -184,6 +187,7 @@ asyncio.run(main())
|
|
|
184
187
|
| Type | Example |
|
|
185
188
|
|------|---------|
|
|
186
189
|
| **Papers** | Nature, Science, NeurIPS, ICML, IEEE, ACM |
|
|
190
|
+
| **Clinical Reports** | Case reports, diagnostic reports, trial reports, patient notes |
|
|
187
191
|
| **Grants** | NSF, NIH R01/R21/K, DOE, DARPA |
|
|
188
192
|
| **Posters** | Conference posters (A0, A1, custom sizes) |
|
|
189
193
|
| **Reviews** | Systematic literature reviews |
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
scientific_writer/__init__.py,sha256=xPF-hrEG0d9qbRgPdTz6kc-N0mn2NGjKMqlTZp7BDy4,1159
|
|
2
|
+
scientific_writer/api.py,sha256=WXt0AKEoC32LUDj4xMvXPVEjOWfqBPgioDTXZhEEZ6Q,12694
|
|
3
|
+
scientific_writer/cli.py,sha256=5FO3y6Ww4zd1H5IDk1UwjJ8RhmfGGtTzWyCPaGL3J8w,14797
|
|
4
|
+
scientific_writer/core.py,sha256=jsnotLJRYDouhK1pBQofwYDWUJTw-WRz3PO05gEKSYU,6609
|
|
5
|
+
scientific_writer/models.py,sha256=KjRjMjn4GtbHLIUrx2EZB4omGcZeLbflaTJmfNV1M6Y,2629
|
|
6
|
+
scientific_writer/utils.py,sha256=z2nX3PDEcfW4pN_w47TDDC6Kmdcw5uFUGrT8T6lZYSg,9032
|
|
7
|
+
scientific_writer-2.2.1.dist-info/METADATA,sha256=yCtieXvoVbqX5PfVdJL_urL02wdLslc4l0aaNJRngUc,9992
|
|
8
|
+
scientific_writer-2.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
+
scientific_writer-2.2.1.dist-info/entry_points.txt,sha256=pI1zUsWVV6eMkNEKfEmkKozOlLRZnhAZfXBsEyqXtqg,69
|
|
10
|
+
scientific_writer-2.2.1.dist-info/licenses/LICENSE,sha256=H6FOLY6X6QMEnqcbDoq5BM0sBf-K-e1SIBAv0zSwxa4,1070
|
|
11
|
+
scientific_writer-2.2.1.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
scientific_writer/__init__.py,sha256=fomVG-chBmbCx2IjPCw8vDcGvzCPPBd5jxEeARPlwzY,1182
|
|
2
|
-
scientific_writer/api.py,sha256=nWzBIvsTfCD_Are1-7kamhjqCHn37zc86js7S3QTdi0,12464
|
|
3
|
-
scientific_writer/cli.py,sha256=Hox01o87h33HSumLVHl70AkNinS-OT6KduSzmwqmx40,14592
|
|
4
|
-
scientific_writer/core.py,sha256=XsdXb-GuKY3ER9VXN1aBdcp4hcJXb4H6-e9wkZjJ1h4,6553
|
|
5
|
-
scientific_writer/models.py,sha256=KjRjMjn4GtbHLIUrx2EZB4omGcZeLbflaTJmfNV1M6Y,2629
|
|
6
|
-
scientific_writer/utils.py,sha256=z2nX3PDEcfW4pN_w47TDDC6Kmdcw5uFUGrT8T6lZYSg,9032
|
|
7
|
-
scientific_writer-2.1.1.dist-info/METADATA,sha256=1-sUugpLCnsIH5xGMkj0q2HJLWC8Ji68UiIw367OpsY,9629
|
|
8
|
-
scientific_writer-2.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
9
|
-
scientific_writer-2.1.1.dist-info/entry_points.txt,sha256=pI1zUsWVV6eMkNEKfEmkKozOlLRZnhAZfXBsEyqXtqg,69
|
|
10
|
-
scientific_writer-2.1.1.dist-info/licenses/LICENSE,sha256=H6FOLY6X6QMEnqcbDoq5BM0sBf-K-e1SIBAv0zSwxa4,1070
|
|
11
|
-
scientific_writer-2.1.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|