Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
da569f9
add file encoding when reading README.md
s-szepe Nov 26, 2024
56b3f5d
remove unnecessary to use arguments when calling super for the parent…
s-szepe Nov 26, 2024
bf38338
remove comma after values in order to avoid it turns it into tuple
s-szepe Nov 26, 2024
fb3ddae
use literals instead of calling list/set/dict
s-szepe Nov 26, 2024
033bae3
re-organize imports
s-szepe Nov 26, 2024
24802ca
use sys.exit instead of exit
s-szepe Nov 26, 2024
4e28bc4
re-organize imports
s-szepe Nov 26, 2024
4274a76
fix C0301: Line too long and W1309: Using an f-string that does not …
s-szepe Nov 27, 2024
ea8fdfc
fix C0103: Constant name doesn't conform to UPPER_CASE naming style
s-szepe Nov 28, 2024
98bc54a
fix C0301: Line too long in scripts
s-szepe Nov 28, 2024
275dfb3
use sys.exit instead of exit
s-szepe Nov 28, 2024
3048360
fix C0301: Line too long
s-szepe Nov 28, 2024
8c1b18f
fix W1203: Use lazy % formatting in logging functions
s-szepe Nov 28, 2024
ef1c899
import models explicitly instead of wildcard
s-szepe Nov 28, 2024
8074f5e
add pylint configuration and github workflow
s-szepe Nov 28, 2024
bba7c8b
add pylint requirements
s-szepe Nov 28, 2024
b7a8160
Merge branch 'main' into feature/pylint-refactoring
sszepe Dec 4, 2024
90f41db
handle potential None values
sszepe Dec 4, 2024
6dd06f6
Merge pull request #37 from mdwRepository/feature/pylint-refactoring
kshepherd Dec 11, 2024
2321e51
Extend search_objects to allow configuration parameter
kshepherd Nov 6, 2024
7fcb83d
search_objects accepts configuration param
kshepherd Dec 11, 2024
51f9e47
Merge pull request #32 from kshepherd/search_with_configuration
kshepherd Dec 11, 2024
6046091
resolve pid to dspaceobject
kshepherd Dec 11, 2024
aeb9a9a
Merge pull request #39 from kshepherd/find_by_identifier
kshepherd Dec 11, 2024
7e1d7d1
Prepare release 0.1.13
kshepherd Dec 11, 2024
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
29 changes: 29 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --ignore-paths=^tests/.*$ --output=lint_${{ matrix.python-version }}.txt || true
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: lint_${{ matrix.python-version }}.txt
path: lint_${{ matrix.python-version }}.txt
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[MAIN]
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

### 0.1.13

Date: 2024-12-11

PyPI release page: https://pypi.org/project/dspace-rest-client/0.1.13/

**Changes**

1. Update requests and pysolr dependencies and improve setup.py (thanks @alanorth) https://github.com/the-library-code/dspace-rest-python/pull/24
2. Add auto-paginating `get_*_iter` methods for most `get_*` methods (thanks @dpk) https://github.com/the-library-code/dspace-rest-python/pull/27
3. Improve version number maintenance https://github.com/the-library-code/dspace-rest-python/pull/30
4. New `create_item_version` method (thanks @soaringjupiter) https://github.com/the-library-code/dspace-rest-python/pull/31
5. Allow `embed=['...', '...']` parameter in most methods that return objects, to allow embedded HAL resources https://github.com/the-library-code/dspace-rest-python/pull/20
6. Extend `search_objects[_iter]` to accept a configuration parameter https://github.com/the-library-code/dspace-rest-python/pull/32
7. Integrate pylint scaffolding (thanks @sszepe and @mdwRepository) https://github.com/the-library-code/dspace-rest-python/pull/37
8. New `resolve_identifier_to_dso` method https://github.com/the-library-code/dspace-rest-python/pull/39
9. Small pydoc improvements
10. Added new example usage to `example.py`

### 0.1.12

Date: 2024-08-06
Expand All @@ -10,6 +29,7 @@ PyPI release page: https://pypi.org/project/dspace-rest-client/0.1.12/

1. Initialise search result objects as `SimpleDSpaceObject` rather than base `DSpaceObject` class (thanks to @JemmaPilcher)
2. Introduce / tidy new `SearchResult` model as work towards https://github.com/the-library-code/dspace-rest-python/issues/17
3. Fix `get_items` method parameters (thanks @ckubgi) https://github.com/the-library-code/dspace-rest-python/pull/21

### 0.1.11

Expand Down
31 changes: 15 additions & 16 deletions console.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
import code
import os
import sys

from dspace_rest_client.client import DSpaceClient
# Import models as needed
#from dspace_rest_client.models import Community, Collection, Item, Bundle, Bitstream
import code
import os

# The DSpace client will look for the same environment variables, but we can also look for them here explicitly
# and as an example
url = 'http://localhost:8080/server/api'
if 'DSPACE_API_ENDPOINT' in os.environ:
url = os.environ['DSPACE_API_ENDPOINT']
username = 'username@test.system.edu'
if 'DSPACE_API_USERNAME' in os.environ:
username = os.environ['DSPACE_API_USERNAME']
password = 'password'
if 'DSPACE_API_PASSWORD' in os.environ:
password = os.environ['DSPACE_API_PASSWORD']
DEFAULT_URL = 'http://localhost:8080/server/api'
DEFAULT_USERNAME = 'username@test.system.edu'
DEFAULT_PASSWORD = 'password'

# Configuration from environment variables
URL = os.environ.get('DSPACE_API_ENDPOINT', DEFAULT_URL)
USERNAME = os.environ.get('DSPACE_API_USERNAME', DEFAULT_USERNAME)
PASSWORD = os.environ.get('DSPACE_API_PASSWORD', DEFAULT_PASSWORD)

# Instantiate DSpace client
d = DSpaceClient(api_endpoint=url, username=username, password=password)
d = DSpaceClient(api_endpoint=URL, username=USERNAME, password=PASSWORD)

# Authenticate against the DSpace client
authenticated = d.authenticate()
if not authenticated:
print(f'Error logging in! Giving up.')
exit(1)
print('Error logging in! Giving up.')
sys.exit(1)

code.interact(local=locals())
2 changes: 1 addition & 1 deletion dspace_rest_client/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from . import *
__version__ = '0.1.12'
__version__ = '0.1.13'
Loading