Notion-2-Obsidan icon indicating copy to clipboard operation
Notion-2-Obsidan copied to clipboard

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

Open ToontjeM opened this issue 2 years ago • 9 comments

The script apparently doesn't do that?

ToontjeM avatar Jul 12 '23 09:07 ToontjeM

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.

arozx avatar Jul 12 '23 11:07 arozx

Will try that one later today. Thanks!

ToontjeM avatar Jul 12 '23 11:07 ToontjeM

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 avatar Jul 14 '23 09:07 Aragur

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

arozx avatar Jul 14 '23 11:07 arozx

@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/[email protected]/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/[email protected]/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/[email protected]/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

Aragur avatar Jul 14 '23 11:07 Aragur

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

arozx avatar Jul 14 '23 12:07 arozx

@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/[email protected]/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

Aragur avatar Jul 14 '23 13:07 Aragur

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

arozx avatar Jul 14 '23 18:07 arozx

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.

TheoOliveira avatar Feb 10 '24 06:02 TheoOliveira