visualcurrent / Notion-2-Obsidan

Conversion routines to convert all Notion .md exports to full Obsidian compatibility
262 stars 47 forks source link

Do we need to remove the UID from all files and folders ourselves? #39

Open ToontjeM opened 1 year ago

ToontjeM commented 1 year ago

The script apparently doesn't do that?

arozx commented 1 year ago

Yes the script does not have this feature. I'm pretty sure the software is not being actively maintained so I created a fork with a few changes which automatically removes UID's as well as other improvements.

ToontjeM commented 1 year ago

Will try that one later today. Thanks!

Aragur commented 1 year ago

Yes the script does not have this feature. I'm pretty sure the software is not being actively maintained so I created a fork with a few changes which automatically removes UID's as well as other improvements.

Your script also doesn't remove any UIDs

arozx commented 1 year ago

I forgot to mention that you have to unzip the folder once. This is because when you download the zip from notion it gives you a zip nested in another zip for some reason.

Yes the script does not have this feature. I'm pretty sure the software is not being actively maintained so I created a fork with a few changes which automatically removes UID's as well as other improvements.

Your script also doesn't remove any UIDs

Aragur commented 1 year ago

@arozx Thanks, got it. But now it's crashing with the following error:

Traceback (most recent call last):
  File "/Users/giesel/Downloads/notion_2_obsidan-master/N2O.py", line 96, in <module>
    mdTitle = N2Omodule.N2Ocsv(csvFile)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/giesel/Downloads/notion_2_obsidan-master/N2Omodule.py", line 98, in N2Ocsv
    for row in reader: # I don't know how this works but it does what I want
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/csv.py", line 110, in __next__
    self.fieldnames
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/csv.py", line 97, in fieldnames
    self._fieldnames = next(self.reader)
                       ^^^^^^^^^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/encodings/utf_8_sig.py", line 69, in _buffer_decode
    return codecs.utf_8_decode(input, errors, final)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xad in position 45: invalid start byte
arozx commented 1 year ago

This might work though I have no way of testing for MacOS. https://github.com/arozx/notion_2_obsidan/tree/testing

Aragur commented 1 year ago

@arozx Same issue

Traceback (most recent call last):
  File "/Users/giesel/Downloads/notion_2_obsidan-testing/N2O.py", line 96, in <module>
    mdTitle = N2Omodule.N2Ocsv(csvFile)
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/giesel/Downloads/notion_2_obsidan-testing/N2Omodule.py", line 96, in N2Ocsv
    reader = DictReader(StringIO(csvFile.read().decode('utf-8-sig')), delimiter=',', quotechar='"')
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.4_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/encodings/utf_8_sig.py", line 23, in decode
    (output, consumed) = codecs.utf_8_decode(input, errors, True)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xad in position 45: invalid start byte
arozx commented 1 year ago

One workaround could be to use a Virtual Machine such as virtual box to run the program on a Linux or windows machine. You could also try using GitHub code spaces or replit to run the application or use a windows or Linux computer. I am unable to reproduce the error, so unfortunately do not have a proper solution to the issue.

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xad in position 45: invalid start byte

TheoOliveira commented 6 months ago

See if that helps guys, one thing i'd like to point it out. The dev took his time to develop this we should come not asking and demanding features but willing to help how to implement that or help somehow. He's doing for free, remember that.

https://gist.github.com/TheoOliveira/74e9fea0c1a8538d23b3bfce943e8e2e

In case theres is interest i can make a PR to integrate that to the current script.