Skip to content

doccano-client failed to upload a file #50

@kovidiament

Description

@kovidiament

How to reproduce the behaviour

doccano_client = DoccanoClient(
    'http://127.0.0.1:8000/',
    'admin',
    'password'
)
project_info = doccano_client.create_project(name="First Python Project")
upload_file = doccano_client.post_doc_upload(project_id=project_info['id'],
                                             file_name='anexample.json',
                                             format='JSON'
                                             )

Content of an example:

[
    {
        "text": "**Terrible** customer **service**.",
        "label": [],
        "metadata": "hi there",
        "ticker": "TSL"
    },
    {
        "text": "**Great** customer service.",
        "label": [],
        "metadata": "hi there",
        "ticker": "TSL"
    }
]

The problem is, I get exit code 0, but when I look in the dataset for the project, the content is not uploaded. It only works when I do it in GUI.

Your Environment

  • Operating System:
  • Python Version Used: 3.7
  • When you install doccano: 7/5/21
  • How did you install doccano (Heroku button etc): docker

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions