Skip to content

Commit 187d0ea

Browse files
authored
Merge pull request #99 from lokalise/SPYTHON-21_remove_file
Delete file endpoint
2 parents 193ff38 + 90203d9 commit 187d0ea

40 files changed

+350
-224
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3 Clause
22

3-
Copyright 2020 Lokalise Group and Ilya Bodrov
3+
Copyright 2020 Lokalise Group and Ilya Krukowski
44

55
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
66

Pipfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ verify_ssl = true
55

66
[dev-packages]
77
pytest = "~=7.1"
8-
vcrpy = "~=4.1"
8+
vcrpy = "~=4.2"
99
pytest-vcr = "~=1.0.2"
1010
pytest-cov = "~=3.0"
11-
pylint = "~= 2.13"
11+
pylint = "~= 2.14"
1212
pytest-pylint = "~= 0.3"
1313
mypy = "~= 0.950"
1414
python-dotenv = "~= 0.19.2"
1515
autopep8 = "~= 1.6"
1616
importlib-metadata = "*"
1717

1818
[packages]
19-
requests = "~=2.27"
19+
requests = "~=2.28"

Pipfile.lock

Lines changed: 190 additions & 182 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![Downloads](https://pepy.tech/badge/python-lokalise-api)](https://pepy.tech/project/python-lokalise-api)
77
[![Docs](https://readthedocs.org/projects/python-lokalise-api/badge/?version=latest&style=flat)](https://python-lokalise-api.readthedocs.io)
88

9-
Official Python 3 interface for the [Lokalise APIv2](https://app.lokalise.com/api2docs) that represents returned data as Python objects.
9+
Official Python 3 interface for the [Lokalise APIv2](https://developers.lokalise.com/reference/lokalise-rest-api) that represents returned data as Python objects.
1010

1111
## Quick start
1212

@@ -50,4 +50,4 @@ Find detailed documentation at [python-lokalise-api.readthedocs.io](https://pyth
5050

5151
This plugin is licensed under the [BSD 3 Clause License](https://github.com/lokalise/python-lokalise-api/blob/master/LICENSE).
5252

53-
Copyright (c) [Lokalise team](https://lokalise.com) and [Ilya Bodrov](http://bodrovis.tech)
53+
Copyright (c) [Lokalise team](https://lokalise.com) and [Ilya Krukowski](http://bodrovis.tech)

docs/additional_info/changelog.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@
33
Changelog
44
=========
55

6+
1.5.0 (07-Jul-2022)
7+
-------------------
8+
9+
* Added support for `Delete file endpoint <https://python-lokalise-api.readthedocs.io/en/latest/api/files.html#delete-file>`_:
10+
11+
.. code-block:: python
12+
13+
response = client.delete_file(project_id, file_id)
14+
response['file_deleted'] # => True
15+
616
1.4.0 (07-Mar-2022)
717
-------------------
818

docs/additional_info/exception_handling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Exception handling
44
==================
55

6-
`Learn more about error codes in the official doc <https://app.lokalise.com/api2docs/curl/#resource-errors>`_.
6+
`Learn more about error codes in the official doc <https://developers.lokalise.com/reference/api-errors>`_.
77

88
The plugin may raise the following exceptions:
99

docs/api/branches.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Branches endpoint
22
=================
33

4-
`Branches documentation <https://app.lokalise.com/api2docs/curl/#resource-branches>`_
4+
`Branches documentation <https://developers.lokalise.com/reference/list-all-branches>`_
55

66
Fetch all branches
77
------------------

docs/api/comments.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Comments endpoint
22
=================
33

4-
`Comments documentation <https://app.lokalise.com/api2docs/curl/#resource-comments>`_
4+
`Comments documentation <https://developers.lokalise.com/reference/list-project-comments>`_
55

66
Fetch all project comments
77
--------------------------

docs/api/contributors.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Contributors endpoint
22
=====================
33

4-
`Contributors documentation <https://app.lokalise.com/api2docs/curl/#resource-contributors>`_
4+
`Contributors documentation <https://developers.lokalise.com/reference/list-all-contributors>`_
55

66
Fetch all contributors
77
----------------------

docs/api/files.rst

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Files endpoint
22
==============
33

4-
`Files documentation <https://app.lokalise.com/api2docs/curl/#resource-files>`_
4+
`Files documentation <https://developers.lokalise.com/reference/list-all-files>`_
55

66
Fetch all files
77
---------------
@@ -69,3 +69,21 @@ Example:
6969
"replace_breaks": False
7070
})
7171
response['bundle_url'] # => "https://s3-eu-west-1.amazonaws.com/path/to/bundle.zip"
72+
73+
Delete file
74+
-----------
75+
76+
Please note that this endpoint does not support "software localization" projects.
77+
78+
.. py:function:: delete_file(project_id, file_id)
79+
80+
:param str project_id: ID of the project
81+
:param file_id: ID of the file to delete
82+
:return: Dictionary with project ID and "file_deleted" set to True
83+
84+
Example:
85+
86+
.. code-block:: python
87+
88+
response = client.delete_file("123.abc", 1234)
89+
response['file_deleted'] # => True

0 commit comments

Comments
 (0)