Giter Club home page Giter Club logo

csv2notion's People

Contributors

helguera avatar vzhd1701 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

csv2notion's Issues

[Bug]: can't duplicate item within notion after using tool to upload

csv2notion version

0.3.8

What OS are you using?

Windows

OS Version / Linux distribution

Windows 11

Bug description

After uploading my data from my CSVs to a database in notion, trying to duplicate (ctrl + D or pressing the 3 dots and pressing duplicate) doesn't seem to do anything, or it's creating them somewhere in the void. if I create a new item in the database from notion, I can duplicate it. Only the ones uploaded via the csv2notion tool can't be duplicated. Thanks!

Log excerpt

No response

[Bug]: TRaceback in --merge

csv2notion version

0.3.7

What OS are you using?

Windows

OS Version / Linux distribution

Win11 22H2 22621.963

Bug description

I use
csv2notion --token [my_token] --url [my_url] --icon-column icon_url --icon-column-keep --merge --randomize-select-colors [file].csv

Log excerpt

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Python311\Scripts\csv2notion.exe\__main__.py", line 7, in <module>
  File "C:\Python311\Lib\site-packages\csv2notion\cli.py", line 82, in main
    cli(*sys.argv[1:])
  File "C:\Python311\Lib\site-packages\csv2notion\cli.py", line 31, in cli
    client = get_notion_client(
             ^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\csv2notion\notion_db.py", line 204, in get_notion_client
    client = NotionClientExtended(token_v2=token)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\csv2notion\notion_db_client.py", line 23, in __init__
    super().__init__(*args, **kwargs)
  File "C:\Python311\Lib\site-packages\notion\client.py", line 88, in __init__
    self.session = create_session(client_specified_retry)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\site-packages\notion\client.py", line 47, in create_session
    retry = Retry(
            ^^^^^^
TypeError: Retry.__init__() got an unexpected keyword argument 'allowed_methods'

[Bug]: `csv2notion --version` is slow to execute

csv2notion version

csv2notion 0.3.0

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 12.4

Bug description

Simply executing ./csv2notion --version is slow to execute - it takes around 7sec on my machine.

Is there any reason for this? I'd expect it to be instant, given it's just returning a baked in version number?

Log excerpt

No response

[Bug]: TypeError: unhashable type: 'list'

csv2notion version

csv2notion 0.3.0

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 12.4

Bug description

Error when attempting to do:

./csv2notion --token "xxx" --image-column "Image Filename" --image-column-keep --mandatory-column "Shot ID" --image-caption-column "Scene Description" --max-threads 5 --merge --log ~/Desktop/uploadlog.txt --verbose test.csv
./csv2notion --token "xxx" --max-threads 5 --merge --log ~/Desktop/uploadlog.txt --verbose test.csv
./csv2notion --token "xxx" --log ~/Desktop/uploadlog.txt --verbose test.csv

CSV Data:

Shot ID,Shot Number,Scene Location,Shot Duration,Scene Number,Scene Prefix,Scene Time,Scene Time Range,Scene Set,Script Page No.,Scene Characters,Scene Cast,Scene Description,Shot Size & Type,Camera Movement,Camera Angle,Equipment,Lens,Lighting Notes,VFX,VFX Description,SFX,SFX Description,Music Track,Production Design,Props,Props Notes,Wardrobe ID,Wardrobe Notes,Hair,Make Up,Flag,User Notes 1,User Notes 2,Start Date,End Date,Days,Image Filename
001-1,1,Location Address,00:00:05,001,INT,Dawn,Scene Time Range,Set ID,1,Scene Characters,Scene Cast,Scene Description,WS,Camera Movement,Eye Line,Equipment,Focal length,Lighting Notes,false,VFX Description,false,SFX Description,Music Track,Production Design,Props ID,Props Notes,Wardrobe ID,Wardrobe Notes,Hair,Make Up,false,User Notes 1,User Notes 2,Start Date,End Date,Days,,
001-2,2,Location Address,00:00:05,001,INT,Dawn,Scene Time Range,Set ID,1,Scene Characters,Scene Cast,Scene Description,WS,Camera Movement,Eye Line,Equipment,Focal length,Lighting Notes,false,VFX Description,false,SFX Description,Music Track,Production Design,Props ID,Props Notes,Wardrobe ID,Wardrobe Notes,Hair,Make Up,false,User Notes 1,User Notes 2,Start Date,End Date,Days,,

Log excerpt

INFO: Validating CSV & Notion DB schema
Traceback (most recent call last):
  File "csv2notion/__main__.py", line 4, in <module>
  File "csv2notion/cli.py", line 82, in main
  File "csv2notion/cli.py", line 24, in cli
  File "csv2notion/csv_data.py", line 43, in __init__
  File "csv2notion/csv_data.py", line 75, in _column_types
  File "csv2notion/csv_data.py", line 76, in <dictcomp>
  File "csv2notion/notion_type_guess.py", line 7, in guess_type_by_values
TypeError: unhashable type: 'list'
[14671] Failed to execute script '__main__' due to unhandled exception!

INFO: Validating CSV & Notion DB schema
Traceback (most recent call last):
  File "csv2notion/__main__.py", line 4, in <module>
  File "csv2notion/cli.py", line 82, in main
  File "csv2notion/cli.py", line 24, in cli
  File "csv2notion/csv_data.py", line 43, in __init__
  File "csv2notion/csv_data.py", line 75, in _column_types
  File "csv2notion/csv_data.py", line 76, in <dictcomp>
  File "csv2notion/notion_type_guess.py", line 7, in guess_type_by_values
TypeError: unhashable type: 'list'
[14770] Failed to execute script '__main__' due to unhandled exception!

INFO: Validating CSV & Notion DB schema
Traceback (most recent call last):
  File "csv2notion/__main__.py", line 4, in <module>
  File "csv2notion/cli.py", line 82, in main
  File "csv2notion/cli.py", line 24, in cli
  File "csv2notion/csv_data.py", line 43, in __init__
  File "csv2notion/csv_data.py", line 75, in _column_types
  File "csv2notion/csv_data.py", line 76, in <dictcomp>
  File "csv2notion/notion_type_guess.py", line 7, in guess_type_by_values
TypeError: unhashable type: 'list'
[14810] Failed to execute script '__main__' due to unhandled exception!

Invalid notion [Bug]:

csv2notion version

csv2notion 0.3.9

What OS are you using?

Windows

OS Version / Linux distribution

11

Bug description

I am getting this issue-> CRITICAL: Invalid Notion token, even though the secret token does work with other programs.

Any help would be great :)

Log excerpt

csv2notion --token secret_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx test.csv
INFO: Validating CSV & Notion DB schema
CRITICAL: Invalid Notion token

[Bug]: Traceback when run merge

csv2notion version

0.3.6.

What OS are you using?

Linux

OS Version / Linux distribution

Ubuntu 22.04.1 LTS

Bug description

I use
poetry run csv2notion --token [here] --url "[here]" --merge [file].csv
and it gives me this traceback (in the log)

I already used csv2notion 2 weeks ago with the same command and it worked perfectly so I don't know what happened.

Log excerpt

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/lognece/csv2notion/csv2notion/cli.py", line 82, in main
    cli(*sys.argv[1:])
  File "/home/lognece/csv2notion/csv2notion/cli.py", line 31, in cli
    client = get_notion_client(
  File "/home/lognece/csv2notion/csv2notion/notion_db.py", line 201, in get_notion_client
    client = NotionClientExtended(token_v2=token)
  File "/home/lognece/csv2notion/csv2notion/notion_db_client.py", line 23, in __init__
    super().__init__(*args, **kwargs)
  File "/home/lognece/.cache/pypoetry/virtualenvs/csv2notion-1cy6-Njf-py3.10/lib/python3.10/site-packages/notion/client.py", line 113, in __init__
    self._update_user_info()
  File "/home/lognece/.cache/pypoetry/virtualenvs/csv2notion-1cy6-Njf-py3.10/lib/python3.10/site-packages/notion/client.py", line 145, in _update_user_info
    if not records["space"]:
KeyError: 'space'

Unsaved transactions: User does not have edit access to record

csv2notion version

csv2notion 0.3.7

What OS are you using?

Linux

OS Version / Linux distribution

Ubuntu 22.04.1 LTS

Bug description

Hi, I'm trying to create a database from a CSV file with the following command:

csv2notion --token $notion_token --column-types "text,text,text,text,text,text,text,text,number,number,text,text,text,text,text,text,text,text,text,number,date,number,number,number,number,number,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text" $csv_file

But I'm facing the error:

requests.exceptions.HTTPError: Unsaved transactions: User does not have edit access to record

Although it clearly shows me that my user does not have permission to proceed, I'm not sure what I should do to overcome it.

Any thoughts on how to proceed? Thanks in advance :)

PS1: I've copied $notion_token following the suggested tutorial: https://vzhd1701.notion.site/Find-Your-Notion-Token-5f57951434c1414d84ac72f88226eede

PS2: Removing --column-types "text,text,text,text,text,text,text,text,number,number,text,text,text,text,text,text,text,text,text,number,date,number,number,number,number,number,text,text,text,text,text,text,text,text,text,text,text,text,text,text,text" to simplify the command does not make any difference, still having the same error.

Log excerpt

INFO: Validating CSV & Notion DB schema
INFO: Creating new database
ERROR: Got 400 error attempting to POST to submitTransaction, with data: {
  "operations": [
    {
      "id": "f89ea9df-5bb8-4bf8-b0dd-f3d46b9ffd98",
      "path": [],
      "args": {
        "id": "f89ea9df-5bb8-4bf8-b0dd-f3d46b9ffd98",
        "version": 1,
        "alive": true,
        "created_by_id": "f45d138d-e616-4ea8-839e-b2416b55be67",
        "created_by_table": "notion_user",
        "created_time": 1676905261745,
        "parent_id": "f404e73e-8425-4264-9e99-236bbfc6e4d4",
        "parent_table": "space",
        "space_id": "f404e73e-8425-4264-9e99-236bbfc6e4d4",
        "type": "collection_view_page",
        "permissions": [
          {
            "role": "editor",
            "type": "user_permission",
            "user_id": "f45d138d-e616-4ea8-839e-b2416b55be67"
          }
        ]
      },
      "command": "set",
      "table": "block"
    },
    {
      "args": {
        "last_edited_by_id": "f45d138d-e616-4ea8-839e-b2416b55be67",
        "last_edited_by_table": "notion_user",
        "last_edited_time": 1676905261745
      },
      "command": "update",
      "id": "f89ea9df-5bb8-4bf8-b0dd-f3d46b9ffd98",
      "path": [],
      "table": "block"
    },
    {
      "id": "f404e73e-8425-4264-9e99-236bbfc6e4d4",
      "path": [
        "pages"
      ],
      "args": {
        "id": "f89ea9df-5bb8-4bf8-b0dd-f3d46b9ffd98"
      },
      "command": "listAfter",
      "table": "space"
    },
    {
      "args": {
        "last_edited_by_id": "f45d138d-e616-4ea8-839e-b2416b55be67",
        "last_edited_by_table": "notion_user",
        "last_edited_time": 1676905261745
      },
      "command": "update",
      "id": "f89ea9df-5bb8-4bf8-b0dd-f3d46b9ffd98",
      "path": [],
      "table": "block"
    }
  ]
}
Traceback (most recent call last):
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/bin/csv2notion", line 8, in <module>
    sys.exit(main())
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/csv2notion/cli.py", line 82, in main
    cli(*sys.argv[1:])
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/csv2notion/cli.py", line 39, in cli
    collection_id = new_database(args, client, csv_data)
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/csv2notion/cli_steps.py", line 33, in new_database
    url, collection_id = notion_db_from_csv(
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/csv2notion/notion_db.py", line 142, in notion_db_from_csv
    page_id = client.create_record(
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/notion/client.py", line 417, in create_record
    with self.as_atomic_transaction():
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/notion/client.py", line 469, in __exit__
    self.client.submit_transaction(operations)
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/notion/client.py", line 323, in submit_transaction
    self.post("submitTransaction", data)
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/ratelimit/decorators.py", line 113, in wrapper
    return func(*args, **kargs)
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/ratelimit/decorators.py", line 80, in wrapper
    return func(*args, **kargs)
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/notion/client.py", line 275, in post
    return self._post(endpoint, data)
  File "/home/joaoferreira/miniconda3/envs/csv2notion_env/lib/python3.10/site-packages/notion/client.py", line 290, in _post
    raise HTTPError(
requests.exceptions.HTTPError: Unsaved transactions: User does not have edit access to record

[Bug]: Invalid Notion Token error

csv2notion version

0.3.7

What OS are you using?

MacOS

OS Version / Linux distribution

Ventura 13.2.1

Bug description

For quite some time I've been using csv2notion without any issues.

Suddenly (starting May2) I started receiving CRITICAL: Invalid Notion token error message whenever I try to import my file. This started happening with the token that I previously used without any issue.

I've tried generating new tokens, with different browsers and tried running script on different devices - without any success. The package is installed via homebrew, so I tried updating it - also no help at all, just stuck on the same error for few days already.

I use Google login to log in to Notion, so not sure if that affects it somehow, but the way I log in hasn't changed since I started using csv2notion. Tried to find anyone with the issue that I face but I see posts on Reddit over a year old that actually don't apply anymore.

Am I just out of luck or there actually is an issue?

Log excerpt

csv2notion --token **mytokenhere** --url "myurlhere" import.csv

INFO: Validating CSV & Notion DB schema
CRITICAL: Invalid Notion token

Joins on multiple word text fields

I wouid like to be able to do joins on fields with multi-word text contents, like "first_name last_name". It seems to work fine when there are no spaces in the text, but will always create new entries if there are multple words.

Where in the code would I find the place to start looking at that?

[Bug]: Unable to batch Upload Icon Image

csv2notion version

0.3.8

What OS are you using?

MacOS

OS Version / Linux distribution

macOS Monterey 12.6.9

Bug description

@vzhd1701 I believe with the recent changes of Notion APIs, batch uploading of Icon Image is broken. Hope you can resolve and fix it soon. Thank you.

Log excerpt

2023-09-21 10:06:33,352 [INFO    ] Validating CSV & Notion DB schema
2023-09-21 10:06:34,221 [INFO    ] Uploading Marker Data Demo_V1.csv...
2023-09-21 10:06:50,153 [CRITICAL] Could not upload file /Users/XXX/Desktop/ZZZ/App/0.2.0/marker-chapter.png

[Bug]: Default Icon argument doesn't like the ⛔ emoji

csv2notion version

csv2notion 0.3.0

What OS are you using?

MacOS

OS Version / Linux distribution

macOS 12.4

Bug description

csv2notion doesn't seem to like the ⛔ emoji?

Log excerpt

./csv2notion --token "XXX" --default-icon ""️ --verbose xxx.csv     
File not found: ⛔️

[Bug]: Unable to batch Upload Images from CSV

csv2notion version

0.3.8

What OS are you using?

MacOS

OS Version / Linux distribution

macOS Monterey 12.6.9

Bug description

@vzhd1701 Along with batch uploading of Icon Image, batch uploading of images from CSV is also broken. Hope this can be resolved and fixed too. Thank you.

Log excerpt

2023-09-21 10:14:35,115 [INFO    ] Validating CSV & Notion DB schema
2023-09-21 10:14:36,224 [WARNING ] CSV columns missing from Notion DB: {'Icon Image'}
2023-09-21 10:14:36,226 [INFO    ] Uploading Marker Data Demo_V1.csv...
2023-09-21 10:15:18,575 [CRITICAL] Could not upload file Could not upload file /Users/XXX/Desktop/ZZZ/App/0.2.0/Image_01.png

[Bug]: Unable to import files with error "CRITICAL: Could not upload file path/file.jpg"

csv2notion version

0.3.8

What OS are you using?

MacOS

OS Version / Linux distribution

mac os ventura 13.2.1

Bug description

I'm unable to upload any csv files with image data. I want to upload local image file to notion db. All other columns seem to be uploaded except for the image data.

Log excerpt

INFO: Validating CSV & Notion DB schema
INFO: Uploading batch_1_output.csv...
CRITICAL: Could not upload file /Users/..../path../main.jpg

[Feature request]: Parameter to indicate to a Multi-Select column to add only new values

Suggestion

It is possible to add a parameter to indicate to a column or to all multi-select columns in general whether to add new values and not replace those that already had. For example, I have a multi-select column with categories and for an existing record that already has the categories 'planned, home', when I want to update that existing row "merge" with the label next, it replaces 'planned, home' with 'next' and what I was looking for was 'planned, home, next'.

[Bug]: Keep getting the same "CRITICAL: Provided URL links does not point to a Notion database." error

csv2notion version

0.3.5

What OS are you using?

MacOS

OS Version / Linux distribution

12.5.1. Installed using brew.

Bug description

Hi,

I can't seem to get this work as I keep getting the same CRITICAL: Provided URL links does not point to a Notion database. error.
I'm sure I'm copying the proper view link using the table options (as displayed in README's example). Did something change in the API? I'm pretty sure I'm pasting the URL correctly.

Thanks in advance!

Log excerpt

2022-09-16 00:12:32,556 [INFO    ] Validating CSV & Notion DB schema
2022-09-16 00:12:33,307 [CRITICAL] Provided URL links does not point to a Notion database.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.