nishanttharani / logseqtoobsidian Goto Github PK
View Code? Open in Web Editor NEWSome tools to help move my notes from LogSeq to Obsidian
Some tools to help move my notes from LogSeq to Obsidian
Error is:
INFO:Destination path: C:\Users\goku\Obsidian\wz_r1.md
Old note path: C:\Users\goku\logseq\journals\2022_12_01.md
Old asset path: C:\Users\goku\logseq\journals\https:\website.com\cdn\2022\20221201.jpg
New asset path: C:\Users\goku\Obsidian\journals\attachments\https:\website.com\cdn\2022\20221201.jpg
Traceback (most recent call last):
File "C:\Users\goku\LogSeqToObsidian\convert_notes.py", line 441, in <module>
line = update_assets(line, new_to_old_paths[fpath], fpath)
File "C:\Users\goku\LogSeqToObsidian\convert_notes.py", line 211, in update_assets
line = re.sub(r"!\[(.*?)]\((.*?)\)", fix_asset_embed, line)
File "C:\Users\goku\miniconda3\lib\re.py", line 210, in sub
return _compile(pattern, flags).sub(repl, string, count)
File "C:\Users\goku\LogSeqToObsidian\convert_notes.py", line 191, in fix_asset_embed
shutil.copyfile(old_asset_path, new_asset_path)
File "C:\Users\goku\miniconda3\lib\shutil.py", line 264, in copyfile
with open(src, 'rb') as fsrc:
OSError: [Errno 22] Invalid argument: 'C:\\Users\\goku\\LS\\journals\\https:\\website.com\\cdn\\2022\\20221201.jpg'
Line in journal is:
- ![](https://website.com/cdn/2022/20221201.jpg)
I nosed through the script and did not see any code nearby that attempts to download these, would you like me to implement that? For now I've just removed the offending URLs from my journal.
Thank you for writing this.
Python 2.7.18
python convert_notes.py -logseq ~/nextcloud/Notes/ --output ~/Documents/obsidian
File "convert_notes.py", line 37
def is_markdown_file(fpath: str) -> bool:
^
SyntaxError: invalid syntax
Python 3.8.1
Traceback (most recent call last):
File "convert_notes.py", line 58, in <module>
def get_markdown_file_properties(fpath: str) -> tuple[dict, int]:
TypeError: 'type' object is not subscriptable
I'm not sure why this is throwing this syntax error when I run
Hi, there
First of all, I want to express my gratitude for your script. I am delighted to inform you that the script has been successfully executed and has performed well in certain aspects.
The script has run successfully and has shown promising results.
I have noticed that the script has made some improvements in handling properties. The previous ::
has been successfully converted to a colon (:
). For example, Public:: true
is now transformed into Public: true
. This improvement aligns the property format with the expected standard.
However, there are still some issues that need to be addressed. The hyphen symbol (-
) in unordered lists is still present before the highest-level item, and we would like to remove it.
Additionally, a forward slash (/
) has been added before the quotation symbol (>
) which causes the quotation symbol to be incorrectly recognized.
Furthermore, there is still a significant amount of indentation present, and we would like to remove it to align the content to the left.
I would appreciate it if you could provide suggestions to help optimize this script and achieve the desired outcome. Thank you for your assistance.
Best regards,
KL
It would be great to make the attachments folder configurable so I can merge it with the rest of my Obsidian assets which live in a top level assets
folder.
Can anyone help diagnose this error?
Traceback (most recent call last):
File "~/Desktop/convert_notes.py", line 330, in
assert os.path.exists(old_base) and os.path.isdir(old_base)
AssertionError
Thank you so much for making this utility! I'm testing out Obsidian, and your script has been a time saver.
Would it be possible to convert task items to Obsidian's standard, and remove Logseq specific markup like :LOGBOOK:
So...
TODO My task
DONE Finished
... would become ...
- [ ] My task
- [x] Finished
This error is mostly caused by my own mistake.Nevertheless I'm sharing it here in case others may encouter the same thing.
I'm using this script to convert my Logseq note to Obsidian, while getting this error below:
Traceback (most recent call last):
File "/Users/mettli/Documents/code/LogSeqToObsidian/convert_notes.py", line 397, in <module>
lines = f.readlines()
^^^^^^^^^^^^^
File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 79: invalid continuation byte
0xd5
is a character used by windows, since I changed my computer to mac before, this may have been the cause of the issue.
The soultion is quiet simple though, finding the 396th lines code and modify it as follow:
with open(fpath, "r", errors="ignore") as f:
This worked for me, and I hope it may be helpful for others who facing the similar issue.
I stumbled upon that sometimes the order of processing for the files is different and produces different results. I have realized it that sometimes the - TODO
are not translated to - [ ]
and sometimes they are. Same content, same line, just different executions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.