Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: mention check_duplicates and save_duplicates, fixes #291 #294

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion docs/core_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ You can use pyuploadcare in any Python project. You need to pass
your project keys to ``Uploadcare`` client::

from pyuploadcare import Uploadcare
uploadcare = Uploadcare(public_key='<your public key>', secret_key='<your private key>')
uploadcare = Uploadcare(
public_key='<your public key>',
secret_key='<your private key>'
)


Uploading files
Expand All @@ -25,6 +28,20 @@ Upload file from url::

ucare_file: File = uploadcare.upload("https://github.githubassets.com/images/modules/logos_page/Octocat.png")

Use ``upload_from_url`` or ``upload_from_url_sync`` to access additional parameters, such as ``check_duplicates`` and ``save_duplicates``, when uploading from url::

file_from_url: FileFromUrl = uploadcare.upload_from_url(
"https://github.githubassets.com/images/modules/logos_page/Octocat.png",
store=True,
filename="octocat.png",
check_duplicates=True,
save_duplicates=True,
)

ucare_file: File = uploadcare.upload_from_url_sync(
"https://github.githubassets.com/images/modules/logos_page/Octocat.png",
)

Upload multiple files. Direct upload method is used::

file1 = open('file1.txt', 'rb')
Expand Down
Loading