You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**TODO:** Put a description of your extension here: What does it do? What features does it have? Consider including some screenshots or embedding a video!
6
-
7
-
8
-
## Requirements
9
-
10
-
**TODO:** For example, you might want to mention here which versions of CKAN this
11
-
extension works with.
12
-
13
-
If your extension works across different versions you can add the following table:
14
-
15
-
Compatibility with core CKAN versions:
16
-
17
-
| CKAN version | Compatible? |
18
-
| --------------- | ------------- |
19
-
| 2.6 and earlier | not tested |
20
-
| 2.7 | not tested |
21
-
| 2.8 | not tested |
22
-
| 2.9 | not tested |
23
-
24
-
Suggested values:
25
-
26
-
* "yes"
27
-
* "not tested" - I can't think of a reason why it wouldn't work
28
-
* "not yet" - there is an intention to get it working
29
-
* "no"
30
-
4
+
This CKAN extension allows users to create and manage versions of datasets. It provides a versioning system that tracks changes made to datasets over time and allows user to view and download previous versions.
31
5
32
6
## Installation
33
-
34
-
**TODO:** Add any additional install steps to the list below.
35
-
For example installing any non-Python dependencies or adding any required
36
-
config settings.
37
-
38
7
To install ckanext-versions:
39
8
40
9
1. Activate your CKAN virtual environment, for example:
@@ -56,68 +25,68 @@ To install ckanext-versions:
56
25
57
26
sudo service apache2 reload
58
27
28
+
## API Documentation
59
29
60
-
## Config settings
61
-
62
-
None at present
30
+
### `package_version_create`
31
+
**Description**: Creates a new version of a dataset.
63
32
64
-
**TODO:** Document any optional config settings here. For example:
33
+
**Parameters**:
34
+
-`package_id` (str): The ID of the dataset.
35
+
-`name` (str): The name of the version.
36
+
-`description` (str, optional): The description of the version.
37
+
-`creator_user_id` (str, optional): The ID of the user creating the version.
65
38
66
-
# The minimum number of hours to wait before re-checking a resource
-`data_dict` (dict): Contains the version details to update.
80
47
48
+
**Returns**: A dictionary representing the updated version.
81
49
82
-
## Tests
83
50
84
-
To run the tests, do:
51
+
### `package_version_show`
52
+
**Description**: Retrieves details of a specific dataset version.
85
53
86
-
pytest --ckan-ini=test.ini
54
+
**Parameters**:
55
+
-`id` (str): The ID of the version.
87
56
57
+
**Returns**: A dictionary representing the version.
88
58
89
-
## Releasing a new version of ckanext-versions
90
59
91
-
If ckanext-versions should be available on PyPI you can follow these steps to publish a new version:
92
60
93
-
1. Update the version number in the `pyproject.toml` file. See [PEP 440](http://legacy.python.org/dev/peps/pep-0440/#public-version-identifiers) for how to choose version numbers.
61
+
### `package_version_list`
62
+
**Description**: Lists all versions of a dataset.
94
63
95
-
2. Make sure you have the latest version of necessary packages:
64
+
**Parameters**:
65
+
-`package_id` (str): The ID of the dataset.
96
66
97
-
pip install --upgrade setuptools wheel twine
67
+
**Returns**: A list of dictionaries representing the versions.
98
68
99
-
3. Create a source and binary distributions of the new version:
100
69
101
-
python -m build && twine check dist/*
102
70
103
-
Fix any errors you get.
71
+
### `package_version_delete`
72
+
**Description**: Deletes a specific dataset version.
104
73
105
-
4. Upload the source distribution to PyPI:
74
+
**Parameters**:
75
+
-`id` (str): The ID of the version to delete.
106
76
107
-
twine upload dist/*
77
+
**Returns**: A dictionary indicating success.
108
78
109
-
5. Commit any outstanding changes:
110
79
111
-
git commit -a
112
-
git push
113
80
114
-
6. Tag the new release of the project on GitHub with the version number from
115
-
the `setup.py` file. For example if the version number in `setup.py` is
116
-
0.0.1 then do:
81
+
### `package_version_diff`
82
+
**Description**: Returns a diff of the current version compared to the previous version.
117
83
118
-
git tag 0.0.1
119
-
git push --tags
84
+
**Parameters**:
85
+
-`id` (str): The ID of the version.
86
+
-`diff_type` (str, optional): The type of diff (`unified`, `context`, or `html`).
0 commit comments